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

Unified Diff: src/gpu/GrContext.cpp

Issue 477323006: Revert of Add GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/GrClipMaskManager.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index df26be6a462317c6cc4fc42119b66fc5df7b4716..091c4a899e401595fe26c4fa7f5053391d02e2cd 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -25,7 +25,6 @@
#include "GrPathRenderer.h"
#include "GrPathUtils.h"
#include "GrResourceCache.h"
-#include "GrResourceCache2.h"
#include "GrSoftwarePathRenderer.h"
#include "GrStencilBuffer.h"
#include "GrStencilAndCoverTextContext.h"
@@ -109,7 +108,6 @@
fPathRendererChain = NULL;
fSoftwarePathRenderer = NULL;
fResourceCache = NULL;
- fResourceCache2 = NULL;
fFontCache = NULL;
fDrawBuffer = NULL;
fDrawBufferVBAllocPool = NULL;
@@ -135,7 +133,6 @@
fResourceCache = SkNEW_ARGS(GrResourceCache, (MAX_RESOURCE_CACHE_COUNT,
MAX_RESOURCE_CACHE_BYTES));
fResourceCache->setOverbudgetCallback(OverbudgetCB, this);
- fResourceCache2 = SkNEW(GrResourceCache2);
fFontCache = SkNEW_ARGS(GrFontCache, (fGpu));
@@ -164,8 +161,10 @@
(*fCleanUpData[i].fFunc)(this, fCleanUpData[i].fInfo);
}
- delete fResourceCache2;
- fResourceCache2 = NULL;
+ // Since the gpu can hold scratch textures, give it a chance to let go
+ // of them before freeing the texture cache
+ fGpu->purgeResources();
+
delete fResourceCache;
fResourceCache = NULL;
delete fFontCache;
@@ -185,9 +184,7 @@
void GrContext::abandonContext() {
// abandon first to so destructors
// don't try to free the resources in the API.
- fResourceCache2->abandonAll();
-
- fGpu->contextAbandonded();
+ fGpu->abandonResources();
// a path renderer may be holding onto resources that
// are now unusable
@@ -210,6 +207,7 @@
fFontCache->freeAll();
fLayerCache->freeAll();
+ fGpu->markContextDirty();
}
void GrContext::resetContext(uint32_t state) {
@@ -220,9 +218,6 @@
this->flush();
fGpu->purgeResources();
- if (NULL != fDrawBuffer) {
- fDrawBuffer->purgeResources();
- }
fAARectRenderer->reset();
fOvalRenderer->reset();
@@ -545,10 +540,6 @@
}
void GrContext::unlockScratchTexture(GrTexture* texture) {
- if (texture->wasDestroyed()) {
- return;
- }
-
ASSERT_OWNED_RESOURCE(texture);
SkASSERT(NULL != texture->getCacheEntry());
« no previous file with comments | « src/gpu/GrClipMaskManager.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698