aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-08-18 15:42:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-18 15:42:32 -0700
commit5fa47f4fd13b3158de4599414c86d17649c2dd1c (patch)
tree729c8339c1d6a1488fc57a3102e78c7bf119b89f /include/core
parentabe795e4db533c2e230be0c2be868754e5a02a7e (diff)
Fast path translate() in SkCanvas and SkLiteDL.
This adds didTranslate() so that SkLiteDL (and other canvas recorders) can record the translate rather than the full concat. It also adds a case to SkMatrix::preTranslate() to fast path translate x translate -> translate (i.e. +=). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255283002 Review-Url: https://codereview.chromium.org/2255283002
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkCanvas.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index a32d27b4d9..52a322576e 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1352,6 +1352,9 @@ protected:
virtual void didRestore() {}
virtual void didConcat(const SkMatrix&) {}
virtual void didSetMatrix(const SkMatrix&) {}
+ virtual void didTranslate(SkScalar dx, SkScalar dy) {
+ this->didConcat(SkMatrix::MakeTrans(dx, dy));
+ }
#ifdef SK_EXPERIMENTAL_SHADOWING
virtual void didTranslateZ(SkScalar) {}