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

Unified Diff: src/gpu/GrContext.cpp

Issue 26734003: Proactive SkPixelRef invalidation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: drop the check Created 7 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 | « src/core/SkPixelRef.cpp ('k') | src/gpu/GrResourceCache.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 a84d8eec82356d5356934a47dcaa37a03ec0efe5..9cb37563ebd1c6e38d0ea67032e047c7428da428 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -393,7 +393,8 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params,
const GrTextureDesc& desc,
const GrCacheID& cacheID,
void* srcData,
- size_t rowBytes) {
+ size_t rowBytes,
+ GrResourceKey* cacheKey) {
SK_TRACE_EVENT0("GrContext::createTexture");
GrResourceKey resourceKey = GrTexture::ComputeKey(fGpu, params, desc, cacheID);
@@ -412,6 +413,10 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params,
// necessary space before adding it.
fTextureCache->purgeAsNeeded(1, texture->sizeInBytes());
fTextureCache->addResource(resourceKey, texture);
+
+ if (NULL != cacheKey) {
+ *cacheKey = resourceKey;
+ }
}
return texture;
« no previous file with comments | « src/core/SkPixelRef.cpp ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698