diff options
author | 2014-03-13 20:03:58 +0000 | |
---|---|---|
committer | 2014-03-13 20:03:58 +0000 | |
commit | 44c48d062f7996b5b46917e1b312a32ad101f326 (patch) | |
tree | 7870101b3784d3dccf3602fefa3f8a4f143c8d48 /include/core | |
parent | 1037d92bbc10cafb61d050638e8cbe5a3aa6706f (diff) |
De-virtualize SkCanvas matrix ops.
This moves the matrix management logic into non-virtual SkCanvas
methods, and turns the virtuals into protected notifiers.
R=reed@google.com, robertphillips@google.com, bsalomon@google.com
BUG=skia:2297
Author: fmalita@chromium.org
Review URL: https://codereview.chromium.org/195793012
git-svn-id: http://skia.googlecode.com/svn/trunk@13799 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkCanvas.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index bcfba16cd9..716720bc3e 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -442,38 +442,38 @@ public: @param dy The distance to translate in Y returns true if the operation succeeded (e.g. did not overflow) */ - virtual bool translate(SkScalar dx, SkScalar dy); + bool translate(SkScalar dx, SkScalar dy); /** Preconcat the current matrix with the specified scale. @param sx The amount to scale in X @param sy The amount to scale in Y returns true if the operation succeeded (e.g. did not overflow) */ - virtual bool scale(SkScalar sx, SkScalar sy); + bool scale(SkScalar sx, SkScalar sy); /** Preconcat the current matrix with the specified rotation. @param degrees The amount to rotate, in degrees returns true if the operation succeeded (e.g. did not overflow) */ - virtual bool rotate(SkScalar degrees); + bool rotate(SkScalar degrees); /** Preconcat the current matrix with the specified skew. @param sx The amount to skew in X @param sy The amount to skew in Y returns true if the operation succeeded (e.g. did not overflow) */ - virtual bool skew(SkScalar sx, SkScalar sy); + bool skew(SkScalar sx, SkScalar sy); /** Preconcat the current matrix with the specified matrix. @param matrix The matrix to preconcatenate with the current matrix @return true if the operation succeeded (e.g. did not overflow) */ - virtual bool concat(const SkMatrix& matrix); + bool concat(const SkMatrix& matrix); /** Replace the current matrix with a copy of the specified matrix. @param matrix The matrix that will be copied into the current matrix. */ - virtual void setMatrix(const SkMatrix& matrix); + void setMatrix(const SkMatrix& matrix); /** Helper for setMatrix(identity). Sets the current matrix to identity. */ @@ -1212,6 +1212,13 @@ protected: virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags); virtual void willRestore(); + virtual void didTranslate(SkScalar, SkScalar); + virtual void didScale(SkScalar, SkScalar); + virtual void didRotate(SkScalar); + virtual void didSkew(SkScalar, SkScalar); + virtual void didConcat(const SkMatrix&); + virtual void didSetMatrix(const SkMatrix&); + virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); enum ClipEdgeStyle { |