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

Unified Diff: src/gpu/GrClipMaskCache.h

Issue 663583002: Remove AutoScratchTexture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix tabbing Created 6 years, 2 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 | « include/gpu/GrContext.h ('k') | src/gpu/GrClipMaskManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskCache.h
diff --git a/src/gpu/GrClipMaskCache.h b/src/gpu/GrClipMaskCache.h
index a2495f15662afaafb90f91c4a7a1d1cffbef136e..19495f99b11baf51134d471dda019721083f922e 100644
--- a/src/gpu/GrClipMaskCache.h
+++ b/src/gpu/GrClipMaskCache.h
@@ -40,8 +40,8 @@ public:
// We could reuse the mask if bounds is a subset of last bounds. We'd have to communicate
// an offset to the caller.
- if (back->fLastMask.texture() &&
- !back->fLastMask.texture()->wasDestroyed() &&
+ if (back->fLastMask &&
+ !back->fLastMask->wasDestroyed() &&
back->fLastBound == bounds &&
back->fLastClipGenID == clipGenID) {
return true;
@@ -98,7 +98,7 @@ public:
GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
- return back->fLastMask.texture();
+ return back->fLastMask;
}
const GrTexture* getLastMask() const {
@@ -110,7 +110,7 @@ public:
GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
- return back->fLastMask.texture();
+ return back->fLastMask;
}
void acquireMask(int32_t clipGenID,
@@ -136,11 +136,11 @@ public:
GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
- if (NULL == back->fLastMask.texture()) {
+ if (NULL == back->fLastMask) {
return -1;
}
- return back->fLastMask.texture()->width();
+ return back->fLastMask->width();
}
int getLastMaskHeight() const {
@@ -152,11 +152,11 @@ public:
GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
- if (NULL == back->fLastMask.texture()) {
+ if (NULL == back->fLastMask) {
return -1;
}
- return back->fLastMask.texture()->height();
+ return back->fLastMask->height();
}
void getLastBound(SkIRect* bound) const {
@@ -206,7 +206,8 @@ private:
// HACK: set the last param to true to indicate that this request is at
// flush time and therefore we require a scratch texture with no pending IO operations.
- fLastMask.set(context, desc, GrContext::kApprox_ScratchTexMatch, /*flushing=*/true);
+ fLastMask.reset(context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch,
+ /*flushing=*/true));
fLastBound = bound;
}
@@ -216,7 +217,7 @@ private:
GrTextureDesc desc;
- fLastMask.set(NULL, desc);
+ fLastMask.reset(NULL);
fLastBound.setEmpty();
}
@@ -224,7 +225,7 @@ private:
// The mask's width & height values are used by GrClipMaskManager to correctly scale the
// texture coords for the geometry drawn with this mask. TODO: This should be a cache key
// and not a hard ref to a texture.
- GrAutoScratchTexture fLastMask;
+ SkAutoTUnref<GrTexture> fLastMask;
// fLastBound stores the bounding box of the clip mask in clip-stack space. This rect is
// used by GrClipMaskManager to position a rect and compute texture coords for the mask.
SkIRect fLastBound;
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrClipMaskManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698