skia2/experimental/svg/model/SkSVGAttribute.h
Mike Klein c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00

89 lines
2.2 KiB
C++

/*
* 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 "experimental/svg/model/SkSVGTypes.h"
#include "src/core/SkTLazy.h"
class SkSVGRenderContext;
enum class SkSVGAttribute {
kClipPath,
kClipRule,
kCx, // <circle>, <ellipse>, <radialGradient>: center x position
kCy, // <circle>, <ellipse>, <radialGradient>: center y position
kD,
kFill,
kFillOpacity,
kFillRule,
kFx, // <radialGradient>: focal point x position
kFy, // <radialGradient>: focal point y position
kGradientTransform,
kHeight,
kHref,
kOffset,
kOpacity,
kPatternTransform,
kPoints,
kR, // <circle>, <radialGradient>: radius
kRx, // <ellipse>,<rect>: horizontal (corner) radius
kRy, // <ellipse>,<rect>: vertical (corner) radius
kSpreadMethod,
kStopColor,
kStopOpacity,
kStroke,
kStrokeDashArray,
kStrokeDashOffset,
kStrokeOpacity,
kStrokeLineCap,
kStrokeLineJoin,
kStrokeMiterLimit,
kStrokeWidth,
kTransform,
kViewBox,
kVisibility,
kWidth,
kX,
kX1, // <line>: first endpoint x
kX2, // <line>: second endpoint x
kY,
kY1, // <line>: first endpoint y
kY2, // <line>: second endpoint y
kUnknown,
};
struct SkSVGPresentationAttributes {
static SkSVGPresentationAttributes MakeInitial();
// TODO: SkTLazy adds an extra ptr per attribute; refactor to reduce overhead.
SkTLazy<SkSVGPaint> fFill;
SkTLazy<SkSVGNumberType> fFillOpacity;
SkTLazy<SkSVGFillRule> fFillRule;
SkTLazy<SkSVGFillRule> fClipRule;
SkTLazy<SkSVGPaint> fStroke;
SkTLazy<SkSVGDashArray> fStrokeDashArray;
SkTLazy<SkSVGLength> fStrokeDashOffset;
SkTLazy<SkSVGLineCap> fStrokeLineCap;
SkTLazy<SkSVGLineJoin> fStrokeLineJoin;
SkTLazy<SkSVGNumberType> fStrokeMiterLimit;
SkTLazy<SkSVGNumberType> fStrokeOpacity;
SkTLazy<SkSVGLength> fStrokeWidth;
SkTLazy<SkSVGVisibility> fVisibility;
// uninherited
SkTLazy<SkSVGNumberType> fOpacity;
SkTLazy<SkSVGClip> fClipPath;
};
#endif // SkSVGAttribute_DEFINED