/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkSVGAttribute_DEFINED #define SkSVGAttribute_DEFINED #include "modules/svg/include/SkSVGTypes.h" #include "src/core/SkTLazy.h" class SkSVGRenderContext; enum class SkSVGAttribute { kClipRule, kColor, kColorInterpolation, kColorInterpolationFilters, kCx, // , , : center x position kCy, // , , : center y position kFill, kFillOpacity, kFillRule, kFilter, kFilterUnits, kFontFamily, kFontSize, kFontStyle, kFontWeight, kFx, // : focal point x position kFy, // : focal point y position kGradientUnits, kGradientTransform, kHeight, kHref, kOpacity, kPoints, kPreserveAspectRatio, kR, // , : radius kRx, // ,: horizontal (corner) radius kRy, // ,: vertical (corner) radius kSpreadMethod, kStroke, kStrokeDashArray, kStrokeDashOffset, kStrokeOpacity, kStrokeLineCap, kStrokeLineJoin, kStrokeMiterLimit, kStrokeWidth, kTransform, kText, kTextAnchor, kViewBox, kVisibility, kWidth, kX, kX1, // : first endpoint x kX2, // : second endpoint x kY, kY1, // : first endpoint y kY2, // : second endpoint y kUnknown, }; struct SkSVGPresentationAttributes { static SkSVGPresentationAttributes MakeInitial(); // TODO: SkSVGProperty adds an extra ptr per attribute; refactor to reduce overhead. SkSVGProperty fFill; SkSVGProperty fFillOpacity; SkSVGProperty fFillRule; SkSVGProperty fClipRule; SkSVGProperty fStroke; SkSVGProperty fStrokeDashArray; SkSVGProperty fStrokeDashOffset; SkSVGProperty fStrokeLineCap; SkSVGProperty fStrokeLineJoin; SkSVGProperty fStrokeMiterLimit; SkSVGProperty fStrokeOpacity; SkSVGProperty fStrokeWidth; SkSVGProperty fVisibility; SkSVGProperty fColor; SkSVGProperty fColorInterpolation; SkSVGProperty fColorInterpolationFilters; SkSVGProperty fFontFamily; SkSVGProperty fFontStyle; SkSVGProperty fFontSize; SkSVGProperty fFontWeight; SkSVGProperty fTextAnchor; // uninherited SkSVGProperty fOpacity; SkSVGProperty fClipPath; SkSVGProperty fDisplay; SkSVGProperty fMask; SkSVGProperty fFilter; SkSVGProperty fStopColor; SkSVGProperty fStopOpacity; SkSVGProperty fFloodColor; SkSVGProperty fFloodOpacity; SkSVGProperty fLightingColor; }; #endif // SkSVGAttribute_DEFINED