aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar vjiaoblack <vjiaoblack@google.com>2016-07-13 14:05:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-13 14:05:28 -0700
commite5de130788c8637d2f7df9ddb0241b78e04d5882 (patch)
treee837af1f0ce2a87a9b4be70172f74d9a5dea57a4 /include/core
parentf382b48687176f15091c2defc0002f0a189f4167 (diff)
Added the framework for having canvas/recorder/picture record depth_set's.
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkCanvas.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 97aa3c7d8e..35a8d1c7b9 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -451,6 +451,13 @@ public:
*/
void resetMatrix();
+ /** Add the specified translation to the current draw depth of the canvas.
+ @param z The distance to translate in Z.
+ Negative into screen, positive out of screen.
+ Without translation, the draw depth defaults to 0.
+ */
+ void translateZ(SkScalar z);
+
/**
* Modify the current clip with the specified rectangle.
* @param rect The rect to combine with the current clip
@@ -1260,6 +1267,10 @@ public:
void temporary_internal_describeTopLayer(SkMatrix* matrix, SkIRect* clip_bounds);
protected:
+ /** Returns the current (cumulative) draw depth of the canvas.
+ */
+ SkScalar getZ() const;
+
/** After calling saveLayer(), there can be any number of devices that make
up the top-most drawing area. LayerIter can be used to iterate through
those devices. Note that the iterator is only valid until the next API
@@ -1325,6 +1336,7 @@ protected:
virtual void didRestore() {}
virtual void didConcat(const SkMatrix&) {}
virtual void didSetMatrix(const SkMatrix&) {}
+ virtual void didTranslateZ(SkScalar) {}
virtual void onDrawAnnotation(const SkRect&, const char key[], SkData* value);
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&);