Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 947443003: Move clip off of draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index ad633931eac18ce4895bf8efcf1880902937541a..d384cd17ca5b9e20605e31c050eee33d62945a56 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -276,22 +276,23 @@ void SkGpuDevice::onAttachToCanvas(SkCanvas* canvas) {
INHERITED::onAttachToCanvas(canvas);
// Canvas promises that this ptr is valid until onDetachFromCanvas is called
- fClipData.fClipStack.reset(SkRef(canvas->getClipStack()));
+ fClipStack.reset(SkRef(canvas->getClipStack()));
}
void SkGpuDevice::onDetachFromCanvas() {
INHERITED::onDetachFromCanvas();
- fClipData.fClipStack.reset(NULL);
+ fClipData.reset();
+ fClipStack.reset(NULL);
}
// 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) {
- SkASSERT(fClipData.fClipStack);
+ SkASSERT(fClipStack.get());
- SkASSERT(draw.fClipStack && draw.fClipStack == fClipData.fClipStack);
+ SkASSERT(draw.fClipStack && draw.fClipStack == fClipStack);
- fClipData.fOrigin = this->getOrigin();
+ fClipData.setClipStack(fClipStack, &this->getOrigin());
fContext->setClip(&fClipData);
@@ -909,7 +910,7 @@ static void determine_clipped_src_rect(const GrContext* context,
const SkBitmap& bitmap,
const SkRect* srcRectPtr,
SkIRect* clippedSrcIRect) {
- const GrClipData* clip = context->getClip();
+ const GrClip* clip = context->getClip();
clip->getConservativeBounds(rt, clippedSrcIRect, NULL);
SkMatrix inv;
if (!viewMatrix.invert(&inv)) {
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698