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; |