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

Unified Diff: src/gpu/GrContext.cpp

Issue 923143002: Split out methods in GrGpuResource::CacheAccess that can be called outside of the cache. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: do warning workaround in the right place 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 | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpu.cpp » ('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 6c6ec503563d13e00a64e86ae98f517da34c24df..26b30a434adf359560c396bce8c60ba4622445ba 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -13,7 +13,7 @@
#include "GrDefaultGeoProcFactory.h"
#include "GrFontCache.h"
#include "GrGpuResource.h"
-#include "GrGpuResourceCacheAccess.h"
+#include "GrGpuResourcePriv.h"
#include "GrDistanceFieldTextContext.h"
#include "GrDrawTargetCaps.h"
#include "GrGpu.h"
@@ -249,7 +249,7 @@ GrTexture* GrContext::createTexture(const GrSurfaceDesc& desc, bool budgeted, co
if (!srcData || texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
srcData, rowBytes)) {
if (!budgeted) {
- texture->cacheAccess().makeUnbudgeted();
+ texture->resourcePriv().makeUnbudgeted();
}
return texture;
}
@@ -335,15 +335,7 @@ GrTexture* GrContext::internalRefScratchTexture(const GrSurfaceDesc& inDesc, uin
}
if (!(kNoCreate_ScratchTextureFlag & flags)) {
- GrTexture* texture = fGpu->createTexture(*desc, true, NULL, 0);
- #ifdef SK_DEBUG
- if (fGpu->caps()->reuseScratchTextures() || (desc->fFlags & kRenderTarget_GrSurfaceFlag)) {
- GrScratchKey key;
- GrTexturePriv::ComputeScratchKey(*desc, &key);
- SkASSERT(NULL == texture || texture->cacheAccess().getScratchKey() == key);
- }
- #endif
- return texture;
+ return fGpu->createTexture(*desc, true, NULL, 0);
}
return NULL;
@@ -1585,7 +1577,7 @@ bool GrContext::addResourceToCache(const GrContentKey& key, GrGpuResource* resou
if (!resource || resource->wasDestroyed()) {
return false;
}
- return resource->cacheAccess().setContentKey(key);
+ return resource->resourcePriv().setContentKey(key);
}
bool GrContext::isResourceInCache(const GrContentKey& key) const {
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698