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

Unified Diff: src/gpu/GrClipMaskCache.h

Issue 1144013007: Remove GrContext from GrClipMaskCache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 years, 7 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 | « no previous file | src/gpu/GrClipMaskCache.cpp » ('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 3aa80df04d6cec56dca18db323f89ae3fb4a02ca..4b702c0d418a424f8d40092e2318744295da5dd5 100644
--- a/src/gpu/GrClipMaskCache.h
+++ b/src/gpu/GrClipMaskCache.h
@@ -8,7 +8,7 @@
#ifndef GrClipMaskCache_DEFINED
#define GrClipMaskCache_DEFINED
-#include "GrContext.h"
+#include "GrResourceProvider.h"
#include "SkClipStack.h"
#include "SkTypes.h"
@@ -20,10 +20,9 @@ class GrTexture;
*/
class GrClipMaskCache : SkNoncopyable {
public:
- GrClipMaskCache();
+ GrClipMaskCache(GrResourceProvider*);
~GrClipMaskCache() {
-
while (!fStack.empty()) {
GrClipStackFrame* temp = (GrClipStackFrame*) fStack.back();
temp->~GrClipStackFrame();
@@ -124,7 +123,7 @@ public:
GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
- back->acquireMask(fContext, clipGenID, desc, bound);
+ back->acquireMask(fResourceProvider, clipGenID, desc, bound);
}
int getLastMaskWidth() const {
@@ -172,14 +171,6 @@ public:
*bound = back->fLastBound;
}
- void setContext(GrContext* context) {
- fContext = context;
- }
-
- GrContext* getContext() {
- return fContext;
- }
-
// TODO: Remove this when we hold cache keys instead of refs to textures.
void purgeResources() {
SkDeque::F2BIter iter(fStack);
@@ -197,7 +188,7 @@ private:
this->reset();
}
- void acquireMask(GrContext* context,
+ void acquireMask(GrResourceProvider* resourceProvider,
int32_t clipGenID,
const GrSurfaceDesc& desc,
const SkIRect& bound) {
@@ -206,7 +197,7 @@ 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.reset(context->textureProvider()->refScratchTexture(
+ fLastMask.reset(resourceProvider->refScratchTexture(
desc, GrTextureProvider::kApprox_ScratchTexMatch, /*flushing=*/true));
fLastBound = bound;
@@ -231,8 +222,8 @@ private:
SkIRect fLastBound;
};
- GrContext* fContext;
- SkDeque fStack;
+ SkDeque fStack;
+ GrResourceProvider* fResourceProvider;
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « no previous file | src/gpu/GrClipMaskCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698