Index: src/gpu/GrTexture.cpp |
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp |
index 349e6a383ff2160943d13ab2914b46c82be26e8d..033f1da8914daf2ea674059d274e1139a4168468 100644 |
--- a/src/gpu/GrTexture.cpp |
+++ b/src/gpu/GrTexture.cpp |
@@ -86,16 +86,10 @@ GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) { |
} |
////////////////////////////////////////////////////////////////////////////// |
-GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc, |
- GrSLType samplerType, bool wasMipMapDataProvided) |
- : INHERITED(gpu, lifeCycle, desc) |
+GrTexture::GrTexture(GrGpu* gpu, const GrSurfaceDesc& desc, GrSLType samplerType, |
+ bool wasMipMapDataProvided) |
+ : INHERITED(gpu, desc) |
, fSamplerType(samplerType) { |
- if (!this->isExternal() && !GrPixelConfigIsCompressed(desc.fConfig)) { |
- GrScratchKey key; |
- GrTexturePriv::ComputeScratchKey(desc, &key); |
- this->setScratchKey(key); |
- } |
- |
if (wasMipMapDataProvided) { |
fMipMapsStatus = kValid_MipMapsStatus; |
fMaxMipMapLevel = SkMipMap::ComputeLevelCount(fDesc.fWidth, fDesc.fHeight); |
@@ -105,6 +99,12 @@ GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc, |
} |
} |
+void GrTexture::computeScratchKey(GrScratchKey* key) const { |
+ if (!GrPixelConfigIsCompressed(fDesc.fConfig)) { |
+ GrTexturePriv::ComputeScratchKey(fDesc, key); |
+ } |
+} |
+ |
void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* key) { |
static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType(); |