ce8840e384
* clip-path attribute handling * clipPath container element * asPath() SkSVGNode virtual for capturing subtree geometry R=robertphillips@google.com,stephana@google.com Change-Id: I9597534fe3047b631da6309eafac055dff5696e9 Reviewed-on: https://skia-review.googlesource.com/5650 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
75 lines
1.7 KiB
C++
75 lines
1.7 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 "SkSVGTypes.h"
|
|
#include "SkTLazy.h"
|
|
|
|
class SkSVGRenderContext;
|
|
|
|
enum class SkSVGAttribute {
|
|
kClipPath,
|
|
kCx, // <circle>,<ellipse>: center x position
|
|
kCy, // <circle>,<ellipse>: center y position
|
|
kD,
|
|
kFill,
|
|
kFillOpacity,
|
|
kFillRule,
|
|
kGradientTransform,
|
|
kHeight,
|
|
kHref,
|
|
kOffset,
|
|
kOpacity,
|
|
kPoints,
|
|
kR, // <circle>: radius
|
|
kRx, // <ellipse>,<rect>: horizontal (corner) radius
|
|
kRy, // <ellipse>,<rect>: vertical (corner) radius
|
|
kSpreadMethod,
|
|
kStopColor,
|
|
kStopOpacity,
|
|
kStroke,
|
|
kStrokeOpacity,
|
|
kStrokeLineCap,
|
|
kStrokeLineJoin,
|
|
kStrokeWidth,
|
|
kTransform,
|
|
kViewBox,
|
|
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<SkSVGPaint> fStroke;
|
|
SkTLazy<SkSVGLineCap> fStrokeLineCap;
|
|
SkTLazy<SkSVGLineJoin> fStrokeLineJoin;
|
|
SkTLazy<SkSVGNumberType> fStrokeOpacity;
|
|
SkTLazy<SkSVGLength> fStrokeWidth;
|
|
|
|
// uninherited
|
|
SkTLazy<SkSVGNumberType> fOpacity;
|
|
SkTLazy<SkSVGClip> fClipPath;
|
|
};
|
|
|
|
#endif // SkSVGAttribute_DEFINED
|