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

Unified Diff: src/gpu/GrContext.cpp

Issue 26734003: Proactive SkPixelRef invalidation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tweaks 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
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index ea1df6e0ac40b66f624c30777060742cbda5489a..725fa0adb82d527f3ed069390957238bd58aedea 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;

Powered by Google App Engine
This is Rietveld 408576698