aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar vjiaoblack <vjiaoblack@google.com>2016-07-13 08:35:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-13 08:35:41 -0700
commit1185d90c785f743364cc9113d7007a59af07470c (patch)
tree56a87c2ecaa00b526aef1cb9f47589539ac469a4 /include/core
parent0abddf7bb7f77b1ff6a48efc9d1eafd053d975d2 (diff)
Added the framework for having canvas/recorder/picture record depth_set's.
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkCanvas.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 97aa3c7d8e..fb3ae6d8e0 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
@@ -501,7 +508,8 @@ public:
matrix, clipRegion() assumes its argument is already in device
coordinates, and so no transformation is performed.
@param deviceRgn The region to apply to the current clip
- @param op The region op to apply to the current clip
+ @param op The regio
+ n op to apply to the current clip
*/
void clipRegion(const SkRegion& deviceRgn,
SkRegion::Op op = SkRegion::kIntersect_Op);
@@ -1260,6 +1268,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 +1337,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&);