Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: experimental/svg/model/SkSVGAttribute.h

Issue 2234153002: [SVGDom] Add more presentation attributes. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: review Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | experimental/svg/model/SkSVGAttribute.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/svg/model/SkSVGAttribute.h
diff --git a/experimental/svg/model/SkSVGAttribute.h b/experimental/svg/model/SkSVGAttribute.h
index 1d7c96eb22fc54b1f881c6168734ca58e50856d6..4ac595d526b5a0cf431818ced0845a815840e874 100644
--- a/experimental/svg/model/SkSVGAttribute.h
+++ b/experimental/svg/model/SkSVGAttribute.h
@@ -16,10 +16,15 @@ class SkSVGRenderContext;
enum class SkSVGAttribute {
kD,
kFill,
+ kFillOpacity,
kHeight,
kRx,
kRy,
kStroke,
+ kStrokeOpacity,
+ kStrokeLineCap,
+ kStrokeLineJoin,
+ kStrokeWidth,
kTransform,
kViewBox,
kWidth,
@@ -29,22 +34,19 @@ enum class SkSVGAttribute {
kUnknown,
};
-class SkSVGPresentationAttributes {
-public:
- SkSVGPresentationAttributes();
+struct SkSVGPresentationAttributes {
+ static SkSVGPresentationAttributes MakeInitial();
- void setFill(const SkSVGColorType&);
- void setStroke(const SkSVGColorType&);
+ // TODO: SkTLazy adds an extra ptr per attribute; refactor to reduce overhead.
- void applyTo(SkSVGRenderContext*) const;
+ SkTLazy<SkSVGPaint> fFill;
+ SkTLazy<SkSVGNumberType> fFillOpacity;
-private:
- // Color only for now.
- SkSVGColorType fFill;
- SkSVGColorType fStroke;
-
- unsigned fFillIsSet : 1;
- unsigned fStrokeIsSet : 1;
+ SkTLazy<SkSVGPaint> fStroke;
+ SkTLazy<SkSVGLineCap> fStrokeLineCap;
+ SkTLazy<SkSVGLineJoin> fStrokeLineJoin;
+ SkTLazy<SkSVGNumberType> fStrokeOpacity;
+ SkTLazy<SkSVGLength> fStrokeWidth;
};
#endif // SkSVGAttribute_DEFINED
« no previous file with comments | « no previous file | experimental/svg/model/SkSVGAttribute.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698