diff options
author | Florin Malita <fmalita@chromium.org> | 2017-10-11 14:11:16 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-11 18:32:37 +0000 |
commit | b36be14c254b61510c13844311d6885775c96e8a (patch) | |
tree | 97c5f78e7650f227a73f007be3f72192a688b880 /experimental/svg/model/SkSVGSVG.cpp | |
parent | 6a69c053ff244a11ae41002bfc09b54a5dc9ec68 (diff) |
[SVGDom] Avoid some unneeded canvas save()s
The canvas only needs to be saved once, per local SkSVGRenderContext.
Add a helper (saveOnce) to implement this optimization.
Change-Id: I0c21fa78ad9fd5d3d11de0a29f8441620488d676
Reviewed-on: https://skia-review.googlesource.com/58340
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'experimental/svg/model/SkSVGSVG.cpp')
-rw-r--r-- | experimental/svg/model/SkSVGSVG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/experimental/svg/model/SkSVGSVG.cpp b/experimental/svg/model/SkSVGSVG.cpp index 592992760a..ef919a8ec1 100644 --- a/experimental/svg/model/SkSVGSVG.cpp +++ b/experimental/svg/model/SkSVGSVG.cpp @@ -33,7 +33,7 @@ bool SkSVGSVG::onPrepareToRender(SkSVGRenderContext* ctx) const { } if (!contentMatrix.isIdentity()) { - ctx->canvas()->save(); + ctx->saveOnce(); ctx->canvas()->concat(contentMatrix); } |