diff options
author | reed <reed@google.com> | 2016-07-25 08:05:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-25 08:05:23 -0700 |
commit | 2c9e20055be772feb3f44986c1af0c0a979eff49 (patch) | |
tree | 7c32fff13c4558094c16220a7f2547ff8fd9a3d2 /src/gpu | |
parent | d0e95a524c20932e0f4e68bab43995188a281395 (diff) |
remove fClipStack and attach/deattach-from-canvas
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2180793002
Review-Url: https://codereview.chromium.org/2180793002
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 20 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.h | 4 |
2 files changed, 1 insertions, 23 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 88f584711c..602396fc21 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -287,30 +287,12 @@ bool SkGpuDevice::onAccessPixels(SkPixmap* pmap) { return false; } -void SkGpuDevice::onAttachToCanvas(SkCanvas* canvas) { - ASSERT_SINGLE_OWNER - INHERITED::onAttachToCanvas(canvas); - - // Canvas promises that this ptr is valid until onDetachFromCanvas is called - fClipStack.reset(SkRef(canvas->getClipStack())); -} - -void SkGpuDevice::onDetachFromCanvas() { - ASSERT_SINGLE_OWNER - INHERITED::onDetachFromCanvas(); - fClip.reset(); - fClipStack.reset(nullptr); -} - // call this every draw call, to ensure that the context reflects our state, // and not the state from some other canvas/device void SkGpuDevice::prepareDraw(const SkDraw& draw) { ASSERT_SINGLE_OWNER - SkASSERT(fClipStack.get()); - - SkASSERT(draw.fClipStack && draw.fClipStack == fClipStack); - fClip.reset(fClipStack, &this->getOrigin()); + fClip.reset(draw.fClipStack, &this->getOrigin()); } GrDrawContext* SkGpuDevice::accessDrawContext() { diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index 7e646a13f1..4cfd02421a 100644 --- a/src/gpu/SkGpuDevice.h +++ b/src/gpu/SkGpuDevice.h @@ -146,9 +146,6 @@ public: void flush() override; - void onAttachToCanvas(SkCanvas* canvas) override; - void onDetachFromCanvas() override; - bool onAccessPixels(SkPixmap*) override; // for debugging purposes only @@ -165,7 +162,6 @@ private: sk_sp<GrRenderTarget> fRenderTarget; sk_sp<GrDrawContext> fDrawContext; - SkAutoTUnref<const SkClipStack> fClipStack; SkIPoint fClipOrigin; GrClipStackClip fClip; SkISize fSize; |