aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/svg/model/SkSVGRenderContext.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2016-12-08 16:04:24 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-09 16:06:25 +0000
commit7d529881c4dfc27782c0bced7c7e3a2788975083 (patch)
treee25bd0d250fbf3c7aee8c50bcaaaeaa1c470f015 /experimental/svg/model/SkSVGRenderContext.h
parent67702f6322b54470d11de8c66f09216db64f4274 (diff)
[SVGDom] Clipped clipPath support
ClipPaths can be clipped too, e.g.: <clipPath id="clip1" clip-path="url(#clip2)">...</clipPath> Since we're not really drawing clips but resolving their geometry, asPath() needs to take composed clipping into account (and intersect as needed). R=reed@google.com,robertphillips@google.com,stephana@google.com Change-Id: I25959e22fe50f72042147cfe6b416b6b9ac20cd4 Reviewed-on: https://skia-review.googlesource.com/5720 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/svg/model/SkSVGRenderContext.h')
-rw-r--r--experimental/svg/model/SkSVGRenderContext.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/experimental/svg/model/SkSVGRenderContext.h b/experimental/svg/model/SkSVGRenderContext.h
index ab046cd290..3cd38cbd7f 100644
--- a/experimental/svg/model/SkSVGRenderContext.h
+++ b/experimental/svg/model/SkSVGRenderContext.h
@@ -9,6 +9,7 @@
#define SkSVGRenderContext_DEFINED
#include "SkPaint.h"
+#include "SkPath.h"
#include "SkRect.h"
#include "SkSize.h"
#include "SkSVGAttribute.h"
@@ -79,6 +80,9 @@ public:
const SkPaint* fillPaint() const;
const SkPaint* strokePaint() const;
+ // The local computed clip path (not inherited).
+ const SkPath* clipPath() const { return fClipPath.getMaybeNull(); }
+
private:
// Stack-only
void* operator new(size_t) = delete;
@@ -95,6 +99,9 @@ private:
// The save count on 'fCanvas' at construction time.
// A restoreToCount() will be issued on destruction.
int fCanvasSaveCount;
+
+ // clipPath, if present for the current context (not inherited).
+ SkTLazy<SkPath> fClipPath;
};
#endif // SkSVGRenderContext_DEFINED