Chromium Code Reviews| Index: src/core/SkCanvas.cpp |
| diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
| index ce90275047a6466cf9217e32bc0e9505ed8eff36..72a90ecae914989875617112db05ddf9c95fc9fb 100644 |
| --- a/src/core/SkCanvas.cpp |
| +++ b/src/core/SkCanvas.cpp |
| @@ -294,6 +294,8 @@ public: |
| SkMatrix fMatrix; |
| int fDeferredSaveCount; |
|
robertphillips
2016/07/11 20:57:26
Should probably do this in the ctor with the other
vjiaoblack
2016/07/12 13:14:22
Done.
|
| + SkScalar fCurDrawDepth = 0; |
| + |
| MCRec(bool conservativeRasterClip) : fRasterClip(conservativeRasterClip) { |
| fFilter = nullptr; |
| fLayer = nullptr; |
| @@ -1521,6 +1523,17 @@ void SkCanvas::resetMatrix() { |
| this->setMatrix(SkMatrix::I()); |
| } |
| +void SkCanvas::setZ(SkScalar z) { |
| + this->checkForDeferredSave(); |
| + this->fMCRec->fCurDrawDepth = z; |
| + this->didSetZ(z); |
| +} |
| + |
| +SkScalar SkCanvas::getZ() const { |
| + return this->fMCRec->fCurDrawDepth; |
| +} |
| + |
| + |
| ////////////////////////////////////////////////////////////////////////////// |
| void SkCanvas::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) { |