| Index: src/gpu/GrTexture.cpp
|
| diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
|
| index 28746b93056fa4361230f5e973814f24d60b4c36..9a8754bb119b2700eda512a3c4c525911aa75f92 100644
|
| --- a/src/gpu/GrTexture.cpp
|
| +++ b/src/gpu/GrTexture.cpp
|
| @@ -51,7 +51,6 @@ size_t GrTexture::onGpuMemorySize() const {
|
| textureSize += textureSize/3;
|
| }
|
|
|
| - SkASSERT(!SkToBool(fDesc.fFlags & kRenderTarget_GrSurfaceFlag));
|
| SkASSERT(textureSize <= WorseCaseSize(fDesc));
|
|
|
| return textureSize;
|
| @@ -87,17 +86,10 @@ GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) {
|
| }
|
|
|
| //////////////////////////////////////////////////////////////////////////////
|
| -GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc,
|
| +GrTexture::GrTexture(GrGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
|
| GrSLType samplerType, bool wasMipMapDataProvided)
|
| - : INHERITED(gpu, lifeCycle, desc)
|
| + : INHERITED(gpu, budgeted, desc)
|
| , fSamplerType(samplerType) {
|
| - if (!this->isExternal() && !GrPixelConfigIsCompressed(desc.fConfig) &&
|
| - !desc.fTextureStorageAllocator.fAllocateTextureStorage) {
|
| - GrScratchKey key;
|
| - GrTexturePriv::ComputeScratchKey(desc, &key);
|
| - this->setScratchKey(key);
|
| - }
|
| -
|
| if (wasMipMapDataProvided) {
|
| fMipMapsStatus = kValid_MipMapsStatus;
|
| fMaxMipMapLevel = SkMipMap::ComputeLevelCount(fDesc.fWidth, fDesc.fHeight);
|
| @@ -107,6 +99,15 @@ GrTexture::GrTexture(GrGpu* gpu, LifeCycle lifeCycle, const GrSurfaceDesc& desc,
|
| }
|
| }
|
|
|
| +void GrTexture::initScratchKeyIfNeeded() {
|
| + if (!this->refsWrappedResources() && !GrPixelConfigIsCompressed(fDesc.fConfig) &&
|
| + !fDesc.fTextureStorageAllocator.fAllocateTextureStorage) {
|
| + GrScratchKey key;
|
| + GrTexturePriv::ComputeScratchKey(fDesc, &key);
|
| + this->setScratchKey(key);
|
| + }
|
| +}
|
| +
|
| void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* key) {
|
| static const GrScratchKey::ResourceType kType = GrScratchKey::GenerateResourceType();
|
|
|
|
|