aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-07-25 08:05:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-25 08:05:23 -0700
commit2c9e20055be772feb3f44986c1af0c0a979eff49 (patch)
tree7c32fff13c4558094c16220a7f2547ff8fd9a3d2 /src/gpu
parentd0e95a524c20932e0f4e68bab43995188a281395 (diff)
remove fClipStack and attach/deattach-from-canvas
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGpuDevice.cpp20
-rw-r--r--src/gpu/SkGpuDevice.h4
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;