aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/svg/model/SkSVGRenderContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/svg/model/SkSVGRenderContext.cpp')
-rw-r--r--experimental/svg/model/SkSVGRenderContext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/experimental/svg/model/SkSVGRenderContext.cpp b/experimental/svg/model/SkSVGRenderContext.cpp
index d8307a05c0..9de605a034 100644
--- a/experimental/svg/model/SkSVGRenderContext.cpp
+++ b/experimental/svg/model/SkSVGRenderContext.cpp
@@ -328,12 +328,20 @@ void SkSVGRenderContext::applyClip(const SkSVGClip& clip) {
const SkPath clipPath = clipNode->asPath(*this);
+ // We use the computed clip path in two ways:
+ //
+ // - apply to the current canvas, for drawing
+ // - track in the presentation context, for asPath() composition
+ //
+ // TODO: the two uses are exclusive, avoid canvas churn when non needed.
+
// Only save if needed
if (fCanvas->getSaveCount() == fCanvasSaveCount) {
fCanvas->save();
}
fCanvas->clipPath(clipPath, true);
+ fClipPath.set(clipPath);
}
const SkPaint* SkSVGRenderContext::fillPaint() const {