From 57599fe6c0336feaeeeb9b1996e77b70219b483c Mon Sep 17 00:00:00 2001 From: bsalomon Date: Thu, 25 Feb 2016 06:33:26 -0800 Subject: Move Budgeted enum out of SkSurface, use in GrTextureProvider BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005 DOCS_PREVIEW= https://skia.org/?cl=1728093005 Review URL: https://codereview.chromium.org/1728093005 --- src/gpu/GrContext.cpp | 3 ++- src/gpu/GrGpu.cpp | 7 ++++--- src/gpu/GrGpu.h | 2 +- src/gpu/GrGpuResource.cpp | 2 +- src/gpu/GrGpuResourceCacheAccess.h | 2 +- src/gpu/GrGpuResourcePriv.h | 4 ++-- src/gpu/GrLayerAtlas.cpp | 2 +- src/gpu/GrLayerCache.cpp | 2 +- src/gpu/GrResourceCache.cpp | 16 ++++++++-------- src/gpu/GrResourceCache.h | 2 +- src/gpu/GrTest.cpp | 4 ++-- src/gpu/GrTextureParamsAdjuster.cpp | 3 ++- src/gpu/GrTextureProvider.cpp | 6 +++--- src/gpu/GrYUVProvider.cpp | 5 +++-- src/gpu/SkGpuDevice.cpp | 15 ++++++--------- src/gpu/SkGpuDevice.h | 4 ++-- src/gpu/SkGr.cpp | 6 +++--- src/gpu/SkGrPixelRef.cpp | 2 +- src/gpu/effects/GrConfigConversionEffect.cpp | 9 ++++++--- src/gpu/effects/GrTextureStripAtlas.cpp | 3 ++- src/gpu/gl/GrGLGpu.cpp | 2 +- 21 files changed, 53 insertions(+), 48 deletions(-) (limited to 'src/gpu') diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 2174b8569f..8844f1ac83 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -423,7 +423,8 @@ bool GrContext::readSurfacePixels(GrSurface* src, } SkAutoTUnref temp; if (tempDrawInfo.fUseExactScratch) { - temp.reset(this->textureProvider()->createTexture(tempDrawInfo.fTempSurfaceDesc, true)); + temp.reset(this->textureProvider()->createTexture(tempDrawInfo.fTempSurfaceDesc, + SkBudgeted::kYes)); } else { temp.reset(this->textureProvider()->createApproxTexture(tempDrawInfo.fTempSurfaceDesc)); } diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 4fcd4d57af..8548e54a17 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -88,7 +88,7 @@ static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget) } } -GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, bool budgeted, +GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, SkBudgeted budgeted, const void* srcData, size_t rowBytes) { GrSurfaceDesc desc = origDesc; @@ -120,8 +120,9 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, bool budgeted, } } - GrGpuResource::LifeCycle lifeCycle = budgeted ? GrGpuResource::kCached_LifeCycle : - GrGpuResource::kUncached_LifeCycle; + GrGpuResource::LifeCycle lifeCycle = SkBudgeted::kYes == budgeted ? + GrGpuResource::kCached_LifeCycle : + GrGpuResource::kUncached_LifeCycle; desc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount()); // Attempt to catch un- or wrongly initialized sample counts; diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index fd134eae2c..0fef7a2015 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -93,7 +93,7 @@ public: * * @return The texture object if successful, otherwise nullptr. */ - GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, + GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, const void* srcData, size_t rowBytes); /** diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp index a227fd2c0f..98cea1c9a8 100644 --- a/src/gpu/GrGpuResource.cpp +++ b/src/gpu/GrGpuResource.cpp @@ -119,7 +119,7 @@ void GrGpuResource::setUniqueKey(const GrUniqueKey& key) { SkASSERT(key.isValid()); // Wrapped and uncached resources can never have a unique key. - if (!this->resourcePriv().isBudgeted()) { + if (SkBudgeted::kNo == this->resourcePriv().isBudgeted()) { return; } diff --git a/src/gpu/GrGpuResourceCacheAccess.h b/src/gpu/GrGpuResourceCacheAccess.h index 8c272420a7..70fe08503e 100644 --- a/src/gpu/GrGpuResourceCacheAccess.h +++ b/src/gpu/GrGpuResourceCacheAccess.h @@ -27,7 +27,7 @@ private: */ bool isScratch() const { return !fResource->getUniqueKey().isValid() && fResource->fScratchKey.isValid() && - fResource->resourcePriv().isBudgeted(); + SkBudgeted::kYes == fResource->resourcePriv().isBudgeted(); } /** diff --git a/src/gpu/GrGpuResourcePriv.h b/src/gpu/GrGpuResourcePriv.h index 5324dccc22..62dc85059a 100644 --- a/src/gpu/GrGpuResourcePriv.h +++ b/src/gpu/GrGpuResourcePriv.h @@ -44,10 +44,10 @@ public: /** * Does the resource count against the resource budget? */ - bool isBudgeted() const { + SkBudgeted isBudgeted() const { bool ret = GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle; SkASSERT(ret || !fResource->getUniqueKey().isValid()); - return ret; + return SkBudgeted(ret); } /** diff --git a/src/gpu/GrLayerAtlas.cpp b/src/gpu/GrLayerAtlas.cpp index 9beb509f86..df8215a607 100644 --- a/src/gpu/GrLayerAtlas.cpp +++ b/src/gpu/GrLayerAtlas.cpp @@ -66,7 +66,7 @@ void GrLayerAtlas::createBackingTexture() { desc.fHeight = fBackingTextureSize.height(); desc.fConfig = fPixelConfig; - fTexture.reset(fTexProvider->createTexture(desc, true, nullptr, 0)); + fTexture.reset(fTexProvider->createTexture(desc, SkBudgeted::kYes, nullptr, 0)); fTexture->resourcePriv().setUniqueKey(get_layer_atlas_key()); } diff --git a/src/gpu/GrLayerCache.cpp b/src/gpu/GrLayerCache.cpp index 105ee04e53..c2facbb12d 100644 --- a/src/gpu/GrLayerCache.cpp +++ b/src/gpu/GrLayerCache.cpp @@ -255,7 +255,7 @@ bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n // TODO: make the test for exact match depend on the image filters themselves SkAutoTUnref tex; if (layer->fFilter) { - tex.reset(fContext->textureProvider()->createTexture(desc, true)); + tex.reset(fContext->textureProvider()->createTexture(desc, SkBudgeted::kYes)); } else { tex.reset(fContext->textureProvider()->createApproxTexture(desc)); } diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp index 4a0c9b2b36..005b6c4ccd 100644 --- a/src/gpu/GrResourceCache.cpp +++ b/src/gpu/GrResourceCache.cpp @@ -136,7 +136,7 @@ void GrResourceCache::insertResource(GrGpuResource* resource) { fHighWaterCount = SkTMax(this->getResourceCount(), fHighWaterCount); fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes); #endif - if (resource->resourcePriv().isBudgeted()) { + if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) { ++fBudgetedCount; fBudgetedBytes += size; TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used", @@ -167,7 +167,7 @@ void GrResourceCache::removeResource(GrGpuResource* resource) { size_t size = resource->gpuMemorySize(); SkDEBUGCODE(--fCount;) fBytes -= size; - if (resource->resourcePriv().isBudgeted()) { + if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) { --fBudgetedCount; fBudgetedBytes -= size; TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used", @@ -375,7 +375,7 @@ void GrResourceCache::notifyCntReachedZero(GrGpuResource* resource, uint32_t fla this->removeFromNonpurgeableArray(resource); fPurgeableQueue.insert(resource); - if (!resource->resourcePriv().isBudgeted()) { + if (SkBudgeted::kNo == resource->resourcePriv().isBudgeted()) { // Check whether this resource could still be used as a scratch resource. if (!resource->cacheAccess().isExternal() && resource->resourcePriv().getScratchKey().isValid()) { @@ -414,7 +414,7 @@ void GrResourceCache::didChangeGpuMemorySize(const GrGpuResource* resource, size #if GR_CACHE_STATS fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes); #endif - if (resource->resourcePriv().isBudgeted()) { + if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) { fBudgetedBytes += delta; TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used", fBudgetedBytes, "free", fMaxBytes - fBudgetedBytes); @@ -433,7 +433,7 @@ void GrResourceCache::didChangeBudgetStatus(GrGpuResource* resource) { size_t size = resource->gpuMemorySize(); - if (resource->resourcePriv().isBudgeted()) { + if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) { ++fBudgetedCount; fBudgetedBytes += size; #if GR_CACHE_STATS @@ -664,7 +664,7 @@ void GrResourceCache::validate() const { SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey())); SkASSERT(!resource->cacheAccess().isExternal()); } else if (resource->resourcePriv().getScratchKey().isValid()) { - SkASSERT(!resource->resourcePriv().isBudgeted() || + SkASSERT(SkBudgeted::kNo == resource->resourcePriv().isBudgeted() || resource->getUniqueKey().isValid()); ++fCouldBeScratch; SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey())); @@ -675,10 +675,10 @@ void GrResourceCache::validate() const { ++fContent; SkASSERT(fUniqueHash->find(uniqueKey) == resource); SkASSERT(!resource->cacheAccess().isExternal()); - SkASSERT(resource->resourcePriv().isBudgeted()); + SkASSERT(SkBudgeted::kYes == resource->resourcePriv().isBudgeted()); } - if (resource->resourcePriv().isBudgeted()) { + if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) { ++fBudgetedCount; fBudgetedBytes += resource->gpuMemorySize(); } diff --git a/src/gpu/GrResourceCache.h b/src/gpu/GrResourceCache.h index adbfb7919f..8321289dff 100644 --- a/src/gpu/GrResourceCache.h +++ b/src/gpu/GrResourceCache.h @@ -220,7 +220,7 @@ public: if (resource->cacheAccess().isAdopted()) { ++fAdopted; } - if (!resource->resourcePriv().isBudgeted()) { + if (SkBudgeted::kNo == resource->resourcePriv().isBudgeted()) { fUnbudgetedSize += resource->gpuMemorySize(); } } diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp index f082a8693a..dc14016973 100644 --- a/src/gpu/GrTest.cpp +++ b/src/gpu/GrTest.cpp @@ -74,8 +74,8 @@ void GrContext::getTestTarget(GrTestTarget* tar, GrRenderTarget* rt) { desc.fConfig = kRGBA_8888_GrPixelConfig; desc.fSampleCnt = 0; - SkAutoTUnref texture(this->textureProvider()->createTexture(desc, false, - nullptr, 0)); + SkAutoTUnref texture(this->textureProvider()->createTexture( + desc, SkBudgeted::kNo, nullptr, 0)); if (nullptr == texture) { return; } diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp index fd17d2adb4..a78987cfb7 100644 --- a/src/gpu/GrTextureParamsAdjuster.cpp +++ b/src/gpu/GrTextureParamsAdjuster.cpp @@ -63,7 +63,8 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset, } } - SkAutoTUnref copy(context->textureProvider()->createTexture(rtDesc, true)); + SkAutoTUnref copy(context->textureProvider()->createTexture(rtDesc, + SkBudgeted::kYes)); if (!copy) { return nullptr; } diff --git a/src/gpu/GrTextureProvider.cpp b/src/gpu/GrTextureProvider.cpp index 7d720eb121..01c8a8e7a2 100644 --- a/src/gpu/GrTextureProvider.cpp +++ b/src/gpu/GrTextureProvider.cpp @@ -29,7 +29,7 @@ GrTextureProvider::GrTextureProvider(GrGpu* gpu, GrResourceCache* cache, GrSingl { } -GrTexture* GrTextureProvider::createTexture(const GrSurfaceDesc& desc, bool budgeted, +GrTexture* GrTextureProvider::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, const void* srcData, size_t rowBytes) { ASSERT_SINGLE_OWNER if (this->isAbandoned()) { @@ -46,7 +46,7 @@ GrTexture* GrTextureProvider::createTexture(const GrSurfaceDesc& desc, bool budg if (GrTexture* texture = this->refScratchTexture(desc, kFlags)) { if (!srcData || texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, srcData, rowBytes)) { - if (!budgeted) { + if (SkBudgeted::kNo == budgeted) { texture->resourcePriv().makeUnbudgeted(); } return texture; @@ -117,7 +117,7 @@ GrTexture* GrTextureProvider::refScratchTexture(const GrSurfaceDesc& inDesc, } if (!(kNoCreate_ScratchTextureFlag & flags)) { - return fGpu->createTexture(*desc, true, nullptr, 0); + return fGpu->createTexture(*desc, SkBudgeted::kYes, nullptr, 0); } return nullptr; diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp index 844849a575..f889641849 100644 --- a/src/gpu/GrYUVProvider.cpp +++ b/src/gpu/GrYUVProvider.cpp @@ -98,7 +98,7 @@ GrTexture* GrYUVProvider::refAsTexture(GrContext* ctx, const GrSurfaceDesc& desc bool needsExactTexture = (yuvDesc.fWidth != yuvInfo.fSize[0].fWidth) || (yuvDesc.fHeight != yuvInfo.fSize[0].fHeight); if (needsExactTexture) { - yuvTextures[i].reset(ctx->textureProvider()->createTexture(yuvDesc, true)); + yuvTextures[i].reset(ctx->textureProvider()->createTexture(yuvDesc, SkBudgeted::kYes)); } else { yuvTextures[i].reset(ctx->textureProvider()->createApproxTexture(yuvDesc)); } @@ -112,7 +112,8 @@ GrTexture* GrYUVProvider::refAsTexture(GrContext* ctx, const GrSurfaceDesc& desc GrSurfaceDesc rtDesc = desc; rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag; - SkAutoTUnref result(ctx->textureProvider()->createTexture(rtDesc, true, nullptr, 0)); + SkAutoTUnref result(ctx->textureProvider()->createTexture(rtDesc, SkBudgeted::kYes, + nullptr, 0)); if (!result) { return nullptr; } diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 0b44a4281a..cf613a9cac 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -147,7 +147,7 @@ SkGpuDevice* SkGpuDevice::Create(GrRenderTarget* rt, int width, int height, return new SkGpuDevice(rt, width, height, props, flags); } -SkGpuDevice* SkGpuDevice::Create(GrContext* context, SkSurface::Budgeted budgeted, +SkGpuDevice* SkGpuDevice::Create(GrContext* context, SkBudgeted budgeted, const SkImageInfo& info, int sampleCount, const SkSurfaceProps* props, InitContents init, GrTextureStorageAllocator customAllocator) { @@ -185,7 +185,7 @@ SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height, } GrRenderTarget* SkGpuDevice::CreateRenderTarget( - GrContext* context, SkSurface::Budgeted budgeted, const SkImageInfo& origInfo, + GrContext* context, SkBudgeted budgeted, const SkImageInfo& origInfo, int sampleCount, GrTextureStorageAllocator textureStorageAllocator) { if (kUnknown_SkColorType == origInfo.colorType() || origInfo.width() < 0 || origInfo.height() < 0) { @@ -216,8 +216,7 @@ GrRenderTarget* SkGpuDevice::CreateRenderTarget( desc.fConfig = SkImageInfo2GrPixelConfig(info); desc.fSampleCnt = sampleCount; desc.fTextureStorageAllocator = textureStorageAllocator; - GrTexture* texture = context->textureProvider()->createTexture( - desc, SkToBool(budgeted), nullptr, 0); + GrTexture* texture = context->textureProvider()->createTexture(desc, budgeted, nullptr, 0); if (nullptr == texture) { return nullptr; } @@ -321,9 +320,7 @@ void SkGpuDevice::clearAll() { void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) { ASSERT_SINGLE_OWNER - SkSurface::Budgeted budgeted = - fRenderTarget->resourcePriv().isBudgeted() ? SkSurface::kYes_Budgeted - : SkSurface::kNo_Budgeted; + SkBudgeted budgeted = fRenderTarget->resourcePriv().isBudgeted(); SkAutoTUnref newRT(CreateRenderTarget( this->context(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt, @@ -1784,7 +1781,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint if (kNever_TileUsage == cinfo.fTileUsage) { texture.reset(fContext->textureProvider()->createApproxTexture(desc)); } else { - texture.reset(fContext->textureProvider()->createTexture(desc, true)); + texture.reset(fContext->textureProvider()->createTexture(desc, SkBudgeted::kYes)); } if (texture) { @@ -1802,7 +1799,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) { ASSERT_SINGLE_OWNER // TODO: Change the signature of newSurface to take a budgeted parameter. - static const SkSurface::Budgeted kBudgeted = SkSurface::kNo_Budgeted; + static const SkBudgeted kBudgeted = SkBudgeted::kNo; return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->desc().fSampleCnt, &props); } diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index ec3e158706..8fae408f87 100644 --- a/src/gpu/SkGpuDevice.h +++ b/src/gpu/SkGpuDevice.h @@ -52,7 +52,7 @@ public: * sampleCount. The Budgeted param controls whether the device's backing store counts against * the resource cache budget. On failure, returns nullptr. */ - static SkGpuDevice* Create(GrContext*, SkSurface::Budgeted, const SkImageInfo&, + static SkGpuDevice* Create(GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount, const SkSurfaceProps*, InitContents, GrTextureStorageAllocator = GrTextureStorageAllocator()); @@ -256,7 +256,7 @@ private: bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); - static GrRenderTarget* CreateRenderTarget(GrContext*, SkSurface::Budgeted, const SkImageInfo&, + static GrRenderTarget* CreateRenderTarget(GrContext*, SkBudgeted, const SkImageInfo&, int sampleCount, GrTextureStorageAllocator); friend class GrAtlasTextContext; diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index df65e451fe..85f36d9381 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -212,7 +212,7 @@ static GrTexture* load_etc1_texture(GrContext* ctx, const SkBitmap &bm, GrSurfac return nullptr; } - return ctx->textureProvider()->createTexture(desc, true, startOfTexData, 0); + return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, startOfTexData, 0); } GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bmp) { @@ -233,7 +233,7 @@ GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bmp) { // our compressed data will be trimmed, so pass width() for its // "rowBytes", since they are the same now. - return ctx->textureProvider()->createTexture(desc, true, storage.get(), + return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, storage.get(), bitmap->width()); } else { bmp.copyTo(&tmpBitmap, kN32_SkColorType); @@ -265,7 +265,7 @@ GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bmp) { return nullptr; } - return ctx->textureProvider()->createTexture(desc, true, bitmap->getPixels(), + return ctx->textureProvider()->createTexture(desc, SkBudgeted::kYes, bitmap->getPixels(), bitmap->rowBytes()); } diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp index e48cbf5d15..6b75e6343c 100644 --- a/src/gpu/SkGrPixelRef.cpp +++ b/src/gpu/SkGrPixelRef.cpp @@ -78,7 +78,7 @@ static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorTyp desc.fConfig = SkImageInfo2GrPixelConfig(dstCT, kPremul_SkAlphaType, dstPT); desc.fTextureStorageAllocator = texture->desc().fTextureStorageAllocator; - GrTexture* dst = context->textureProvider()->createTexture(desc, false, nullptr, 0); + GrTexture* dst = context->textureProvider()->createTexture(desc, SkBudgeted::kNo, nullptr, 0); if (nullptr == dst) { return nullptr; } diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index 4e168cd827..2725e5631d 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -176,16 +176,19 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context desc.fHeight = 256; desc.fConfig = kRGBA_8888_GrPixelConfig; - SkAutoTUnref readTex(context->textureProvider()->createTexture(desc, true, nullptr, 0)); + SkAutoTUnref readTex(context->textureProvider()->createTexture( + desc, SkBudgeted::kYes, nullptr, 0)); if (!readTex.get()) { return; } - SkAutoTUnref tempTex(context->textureProvider()->createTexture(desc, true, nullptr, 0)); + SkAutoTUnref tempTex(context->textureProvider()->createTexture( + desc, SkBudgeted::kYes, nullptr, 0)); if (!tempTex.get()) { return; } desc.fFlags = kNone_GrSurfaceFlags; - SkAutoTUnref dataTex(context->textureProvider()->createTexture(desc, true, data, 0)); + SkAutoTUnref dataTex(context->textureProvider()->createTexture( + desc, SkBudgeted::kYes, data, 0)); if (!dataTex.get()) { return; } diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp index 39bc3899b3..01d2679e6f 100644 --- a/src/gpu/effects/GrTextureStripAtlas.cpp +++ b/src/gpu/effects/GrTextureStripAtlas.cpp @@ -203,7 +203,8 @@ void GrTextureStripAtlas::lockTexture() { fTexture = fDesc.fContext->textureProvider()->findAndRefTextureByUniqueKey(key); if (nullptr == fTexture) { - fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, true, nullptr, 0); + fTexture = fDesc.fContext->textureProvider()->createTexture(texDesc, SkBudgeted::kYes, + nullptr, 0); if (!fTexture) { return; } diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 1070f53c5c..8e6fbadc7b 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -2197,7 +2197,7 @@ bool GrGLGpu::readPixelsSupported(GrPixelConfig rtConfig, GrPixelConfig readConf desc.fConfig = rtConfig; desc.fWidth = desc.fHeight = 16; desc.fFlags = kRenderTarget_GrSurfaceFlag; - SkAutoTUnref temp(this->createTexture(desc, false, nullptr, 0)); + SkAutoTUnref temp(this->createTexture(desc, SkBudgeted::kNo, nullptr, 0)); if (!temp) { return false; } -- cgit v1.2.3