diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmapCache.cpp | 23 | ||||
-rw-r--r-- | src/core/SkBitmapCache.h | 4 | ||||
-rw-r--r-- | src/core/SkBitmapController.cpp | 25 | ||||
-rw-r--r-- | src/core/SkBitmapController.h | 4 | ||||
-rw-r--r-- | src/core/SkBitmapProcShader.cpp | 6 | ||||
-rw-r--r-- | src/core/SkBitmapProcState.cpp | 10 | ||||
-rw-r--r-- | src/core/SkBitmapProcState.h | 32 | ||||
-rw-r--r-- | src/core/SkImageCacherator.cpp | 11 | ||||
-rw-r--r-- | src/core/SkImageCacherator.h | 4 | ||||
-rw-r--r-- | src/core/SkLocalMatrixShader.cpp | 2 | ||||
-rw-r--r-- | src/core/SkMipMap.cpp | 8 | ||||
-rw-r--r-- | src/core/SkMipMap.h | 15 | ||||
-rw-r--r-- | src/core/SkPictureShader.cpp | 2 | ||||
-rw-r--r-- | src/core/SkShadowShader.cpp | 2 | ||||
-rw-r--r-- | src/core/SkSpecialImage.cpp | 22 |
15 files changed, 85 insertions, 85 deletions
diff --git a/src/core/SkBitmapCache.cpp b/src/core/SkBitmapCache.cpp index e6a664bf80..0751089083 100644 --- a/src/core/SkBitmapCache.cpp +++ b/src/core/SkBitmapCache.cpp @@ -208,21 +208,21 @@ static unsigned gMipMapKeyNamespaceLabel; struct MipMapKey : public SkResourceCache::Key { public: - MipMapKey(uint32_t genID, SkSourceGammaTreatment treatment, const SkIRect& bounds) - : fGenID(genID), fSrcGammaTreatment(static_cast<uint32_t>(treatment)), fBounds(bounds) + MipMapKey(uint32_t genID, SkDestinationSurfaceColorMode colorMode, const SkIRect& bounds) + : fGenID(genID), fColorMode(static_cast<uint32_t>(colorMode)), fBounds(bounds) { this->init(&gMipMapKeyNamespaceLabel, SkMakeResourceCacheSharedIDForBitmap(genID), - sizeof(fGenID) + sizeof(fSrcGammaTreatment) + sizeof(fBounds)); + sizeof(fGenID) + sizeof(fColorMode) + sizeof(fBounds)); } uint32_t fGenID; - uint32_t fSrcGammaTreatment; + uint32_t fColorMode; SkIRect fBounds; }; struct MipMapRec : public SkResourceCache::Rec { - MipMapRec(const SkBitmap& src, SkSourceGammaTreatment treatment, const SkMipMap* result) - : fKey(src.getGenerationID(), treatment, get_bounds_from_bitmap(src)) + MipMapRec(const SkBitmap& src, SkDestinationSurfaceColorMode colorMode, const SkMipMap* result) + : fKey(src.getGenerationID(), colorMode, get_bounds_from_bitmap(src)) , fMipMap(result) { fMipMap->attachToCacheAndRef(); @@ -260,10 +260,10 @@ private: } const SkMipMap* SkMipMapCache::FindAndRef(const SkBitmapCacheDesc& desc, - SkSourceGammaTreatment treatment, + SkDestinationSurfaceColorMode colorMode, SkResourceCache* localCache) { // Note: we ignore width/height from desc, just need id and bounds - MipMapKey key(desc.fImageID, treatment, desc.fBounds); + MipMapKey key(desc.fImageID, colorMode, desc.fBounds); const SkMipMap* result; if (!CHECK_LOCAL(localCache, find, Find, key, MipMapRec::Finder, &result)) { @@ -277,11 +277,12 @@ static SkResourceCache::DiscardableFactory get_fact(SkResourceCache* localCache) : SkResourceCache::GetDiscardableFactory(); } -const SkMipMap* SkMipMapCache::AddAndRef(const SkBitmap& src, SkSourceGammaTreatment treatment, +const SkMipMap* SkMipMapCache::AddAndRef(const SkBitmap& src, + SkDestinationSurfaceColorMode colorMode, SkResourceCache* localCache) { - SkMipMap* mipmap = SkMipMap::Build(src, treatment, get_fact(localCache)); + SkMipMap* mipmap = SkMipMap::Build(src, colorMode, get_fact(localCache)); if (mipmap) { - MipMapRec* rec = new MipMapRec(src, treatment, mipmap); + MipMapRec* rec = new MipMapRec(src, colorMode, mipmap); CHECK_LOCAL(localCache, add, Add, rec); src.pixelRef()->notifyAddedToCache(); } diff --git a/src/core/SkBitmapCache.h b/src/core/SkBitmapCache.h index 76bcef06cf..522c93ee45 100644 --- a/src/core/SkBitmapCache.h +++ b/src/core/SkBitmapCache.h @@ -72,9 +72,9 @@ public: class SkMipMapCache { public: - static const SkMipMap* FindAndRef(const SkBitmapCacheDesc&, SkSourceGammaTreatment, + static const SkMipMap* FindAndRef(const SkBitmapCacheDesc&, SkDestinationSurfaceColorMode, SkResourceCache* localCache = nullptr); - static const SkMipMap* AddAndRef(const SkBitmap& src, SkSourceGammaTreatment, + static const SkMipMap* AddAndRef(const SkBitmap& src, SkDestinationSurfaceColorMode, SkResourceCache* localCache = nullptr); }; diff --git a/src/core/SkBitmapController.cpp b/src/core/SkBitmapController.cpp index ffeb10c8af..435940b84c 100644 --- a/src/core/SkBitmapController.cpp +++ b/src/core/SkBitmapController.cpp @@ -45,12 +45,12 @@ SkBitmapController::State* SkBitmapController::requestBitmap(const SkBitmapProvi class SkDefaultBitmapControllerState : public SkBitmapController::State { public: SkDefaultBitmapControllerState(const SkBitmapProvider&, const SkMatrix& inv, SkFilterQuality, - SkSourceGammaTreatment); + SkDestinationSurfaceColorMode); private: - SkBitmap fResultBitmap; - SkSourceGammaTreatment fSrcGammaTreatment; - sk_sp<const SkMipMap> fCurrMip; + SkBitmap fResultBitmap; + SkDestinationSurfaceColorMode fColorMode; + sk_sp<const SkMipMap> fCurrMip; bool processHQRequest(const SkBitmapProvider&); bool processMediumRequest(const SkBitmapProvider&); @@ -166,13 +166,13 @@ bool SkDefaultBitmapControllerState::processMediumRequest(const SkBitmapProvider } if (invScaleSize.width() > SK_Scalar1 || invScaleSize.height() > SK_Scalar1) { - fCurrMip.reset(SkMipMapCache::FindAndRef(provider.makeCacheDesc(), fSrcGammaTreatment)); + fCurrMip.reset(SkMipMapCache::FindAndRef(provider.makeCacheDesc(), fColorMode)); if (nullptr == fCurrMip.get()) { SkBitmap orig; if (!provider.asBitmap(&orig)) { return false; } - fCurrMip.reset(SkMipMapCache::AddAndRef(orig, fSrcGammaTreatment)); + fCurrMip.reset(SkMipMapCache::AddAndRef(orig, fColorMode)); if (nullptr == fCurrMip.get()) { return false; } @@ -200,13 +200,14 @@ bool SkDefaultBitmapControllerState::processMediumRequest(const SkBitmapProvider return false; } -SkDefaultBitmapControllerState::SkDefaultBitmapControllerState(const SkBitmapProvider& provider, - const SkMatrix& inv, - SkFilterQuality qual, - SkSourceGammaTreatment treatment) { +SkDefaultBitmapControllerState::SkDefaultBitmapControllerState( + const SkBitmapProvider& provider, + const SkMatrix& inv, + SkFilterQuality qual, + SkDestinationSurfaceColorMode colorMode) { fInvMatrix = inv; fQuality = qual; - fSrcGammaTreatment = treatment; + fColorMode = colorMode; if (this->processHQRequest(provider) || this->processMediumRequest(provider)) { SkASSERT(fResultBitmap.getPixels()); @@ -228,5 +229,5 @@ SkBitmapController::State* SkDefaultBitmapController::onRequestBitmap(const SkBi SkFilterQuality quality, void* storage, size_t size) { return SkInPlaceNewCheck<SkDefaultBitmapControllerState>(storage, size, bm, inverse, quality, - fSrcGammaTreatment); + fColorMode); } diff --git a/src/core/SkBitmapController.h b/src/core/SkBitmapController.h index f31c8eef55..2e7a9f3895 100644 --- a/src/core/SkBitmapController.h +++ b/src/core/SkBitmapController.h @@ -57,14 +57,14 @@ protected: class SkDefaultBitmapController : public SkBitmapController { public: - SkDefaultBitmapController(SkSourceGammaTreatment treatment) : fSrcGammaTreatment(treatment) {} + SkDefaultBitmapController(SkDestinationSurfaceColorMode colorMode) : fColorMode(colorMode) {} protected: State* onRequestBitmap(const SkBitmapProvider&, const SkMatrix& inverse, SkFilterQuality, void* storage, size_t storageSize) override; private: - const SkSourceGammaTreatment fSrcGammaTreatment; + const SkDestinationSurfaceColorMode fColorMode; }; #endif diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index e4309b67f4..06ad04b1e4 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -219,11 +219,11 @@ SkShader::Context* SkBitmapProcLegacyShader::MakeContext(const SkShader& shader, // Decide if we can/want to use the new linear pipeline bool useLinearPipeline = choose_linear_pipeline(rec, provider.info()); - SkSourceGammaTreatment treatment = SkMipMap::DeduceTreatment(rec); + SkDestinationSurfaceColorMode colorMode = SkMipMap::DeduceColorMode(rec); if (useLinearPipeline) { void* infoStorage = (char*)storage + sizeof(LinearPipelineContext); - SkBitmapProcInfo* info = new (infoStorage) SkBitmapProcInfo(provider, tmx, tmy, treatment); + SkBitmapProcInfo* info = new (infoStorage) SkBitmapProcInfo(provider, tmx, tmy, colorMode); if (!info->init(totalInverse, *rec.fPaint)) { info->~SkBitmapProcInfo(); return nullptr; @@ -233,7 +233,7 @@ SkShader::Context* SkBitmapProcLegacyShader::MakeContext(const SkShader& shader, } else { void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext); SkBitmapProcState* state = new (stateStorage) SkBitmapProcState(provider, tmx, tmy, - treatment); + colorMode); if (!state->setup(totalInverse, *rec.fPaint)) { state->~SkBitmapProcState(); return nullptr; diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp index 26ee82e28f..7b88ab644a 100644 --- a/src/core/SkBitmapProcState.cpp +++ b/src/core/SkBitmapProcState.cpp @@ -38,21 +38,21 @@ extern void Clamp_S32_opaque_D32_nofilter_DX_shaderproc(const void*, int, int, u SkBitmapProcInfo::SkBitmapProcInfo(const SkBitmapProvider& provider, SkShader::TileMode tmx, SkShader::TileMode tmy, - SkSourceGammaTreatment treatment) + SkDestinationSurfaceColorMode colorMode) : fProvider(provider) , fTileModeX(tmx) , fTileModeY(tmy) - , fSrcGammaTreatment(treatment) + , fColorMode(colorMode) , fBMState(nullptr) {} SkBitmapProcInfo::SkBitmapProcInfo(const SkBitmap& bm, SkShader::TileMode tmx, SkShader::TileMode tmy, - SkSourceGammaTreatment treatment) + SkDestinationSurfaceColorMode colorMode) : fProvider(SkBitmapProvider(bm)) , fTileModeX(tmx) , fTileModeY(tmy) - , fSrcGammaTreatment(treatment) + ,fColorMode(colorMode) , fBMState(nullptr) {} @@ -121,7 +121,7 @@ bool SkBitmapProcInfo::init(const SkMatrix& inv, const SkPaint& paint) { allow_ignore_fractional_translate = false; } - SkDefaultBitmapController controller(fSrcGammaTreatment); + SkDefaultBitmapController controller(fColorMode); fBMState = controller.requestBitmap(fProvider, inv, paint.getFilterQuality(), fBMStateStorage.get(), fBMStateStorage.size()); // Note : we allow the controller to return an empty (zero-dimension) result. Should we? diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h index e2e4f96951..1818406f61 100644 --- a/src/core/SkBitmapProcState.h +++ b/src/core/SkBitmapProcState.h @@ -29,23 +29,23 @@ class SkPaint; struct SkBitmapProcInfo { SkBitmapProcInfo(const SkBitmapProvider&, SkShader::TileMode tmx, SkShader::TileMode tmy, - SkSourceGammaTreatment); + SkDestinationSurfaceColorMode); SkBitmapProcInfo(const SkBitmap&, SkShader::TileMode tmx, SkShader::TileMode tmy, - SkSourceGammaTreatment); + SkDestinationSurfaceColorMode); ~SkBitmapProcInfo(); - const SkBitmapProvider fProvider; + const SkBitmapProvider fProvider; - SkPixmap fPixmap; - SkMatrix fInvMatrix; // This changes based on tile mode. + SkPixmap fPixmap; + SkMatrix fInvMatrix; // This changes based on tile mode. // TODO: combine fInvMatrix and fRealInvMatrix. - SkMatrix fRealInvMatrix; // The actual inverse matrix. - SkColor fPaintColor; - SkShader::TileMode fTileModeX; - SkShader::TileMode fTileModeY; - SkFilterQuality fFilterQuality; - SkMatrix::TypeMask fInvType; - SkSourceGammaTreatment fSrcGammaTreatment; + SkMatrix fRealInvMatrix; // The actual inverse matrix. + SkColor fPaintColor; + SkShader::TileMode fTileModeX; + SkShader::TileMode fTileModeY; + SkFilterQuality fFilterQuality; + SkMatrix::TypeMask fInvType; + SkDestinationSurfaceColorMode fColorMode; bool init(const SkMatrix& inverse, const SkPaint&); @@ -59,11 +59,11 @@ private: struct SkBitmapProcState : public SkBitmapProcInfo { SkBitmapProcState(const SkBitmapProvider& prov, SkShader::TileMode tmx, SkShader::TileMode tmy, - SkSourceGammaTreatment treatment) - : SkBitmapProcInfo(prov, tmx, tmy, treatment) {} + SkDestinationSurfaceColorMode colorMode) + : SkBitmapProcInfo(prov, tmx, tmy, colorMode) {} SkBitmapProcState(const SkBitmap& bitmap, SkShader::TileMode tmx, SkShader::TileMode tmy, - SkSourceGammaTreatment treatment) - : SkBitmapProcInfo(bitmap, tmx, tmy, treatment) {} + SkDestinationSurfaceColorMode colorMode) + : SkBitmapProcInfo(bitmap, tmx, tmy, colorMode) {} bool setup(const SkMatrix& inv, const SkPaint& paint) { return this->init(inv, paint) && this->chooseProcs(); diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp index 9401b35c9f..54045d5821 100644 --- a/src/core/SkImageCacherator.cpp +++ b/src/core/SkImageCacherator.cpp @@ -280,7 +280,7 @@ static GrTexture* set_key_and_return(GrTexture* tex, const GrUniqueKey& key) { GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key, const SkImage* client, SkImage::CachingHint chint, bool willBeMipped, - SkSourceGammaTreatment gammaTreatment) { + SkDestinationSurfaceColorMode colorMode) { // Values representing the various texture lock paths we can take. Used for logging the path // taken to a histogram. enum LockTexturePath { @@ -346,7 +346,7 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key if (this->tryLockAsBitmap(&bitmap, client, chint)) { GrTexture* tex = nullptr; if (willBeMipped) { - tex = GrGenerateMipMapsAndUploadToTexture(ctx, bitmap, gammaTreatment); + tex = GrGenerateMipMapsAndUploadToTexture(ctx, bitmap, colorMode); } if (!tex) { tex = GrUploadBitmapToTexture(ctx, bitmap); @@ -365,20 +365,19 @@ GrTexture* SkImageCacherator::lockTexture(GrContext* ctx, const GrUniqueKey& key /////////////////////////////////////////////////////////////////////////////////////////////////// GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams& params, - SkSourceGammaTreatment gammaTreatment, + SkDestinationSurfaceColorMode colorMode, const SkImage* client, SkImage::CachingHint chint) { if (!ctx) { return nullptr; } - return GrImageTextureMaker(ctx, this, client, chint).refTextureForParams(params, - gammaTreatment); + return GrImageTextureMaker(ctx, this, client, chint).refTextureForParams(params, colorMode); } #else GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams&, - SkSourceGammaTreatment gammaTreatment, + SkDestinationSurfaceColorMode colorMode, const SkImage* client, SkImage::CachingHint) { return nullptr; } diff --git a/src/core/SkImageCacherator.h b/src/core/SkImageCacherator.h index 8bf335bf51..a8a05a1f90 100644 --- a/src/core/SkImageCacherator.h +++ b/src/core/SkImageCacherator.h @@ -51,7 +51,7 @@ public: * The caller is responsible for calling texture->unref() when they are done. */ GrTexture* lockAsTexture(GrContext*, const GrTextureParams&, - SkSourceGammaTreatment gammaTreatment, const SkImage* client, + SkDestinationSurfaceColorMode colorMode, const SkImage* client, SkImage::CachingHint = SkImage::kAllow_CachingHint); /** @@ -108,7 +108,7 @@ private: // Returns the texture. If the cacherator is generating the texture and wants to cache it, // it should use the passed in key (if the key is valid). GrTexture* lockTexture(GrContext*, const GrUniqueKey& key, const SkImage* client, - SkImage::CachingHint, bool willBeMipped, SkSourceGammaTreatment); + SkImage::CachingHint, bool willBeMipped, SkDestinationSurfaceColorMode); #endif sk_sp<SharedGenerator> fSharedGenerator; diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp index 506fd3e71a..fb436d8759 100644 --- a/src/core/SkLocalMatrixShader.cpp +++ b/src/core/SkLocalMatrixShader.cpp @@ -19,7 +19,7 @@ sk_sp<GrFragmentProcessor> SkLocalMatrixShader::asFragmentProcessor(const AsFPAr } return fProxyShader->asFragmentProcessor(AsFPArgs( args.fContext, args.fViewMatrix, &tmp, args.fFilterQuality, args.fDstColorSpace, - args.fGammaTreatment)); + args.fColorMode)); } #endif diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp index c5bd3ac3b7..ba3cb18749 100644 --- a/src/core/SkMipMap.cpp +++ b/src/core/SkMipMap.cpp @@ -306,7 +306,7 @@ size_t SkMipMap::AllocLevelsSize(int levelCount, size_t pixelSize) { return sk_64_asS32(size); } -SkMipMap* SkMipMap::Build(const SkPixmap& src, SkSourceGammaTreatment treatment, +SkMipMap* SkMipMap::Build(const SkPixmap& src, SkDestinationSurfaceColorMode colorMode, SkDiscardableFactoryProc fact) { typedef void FilterProc(void*, const void* srcPtr, size_t srcRB, int count); @@ -321,7 +321,7 @@ SkMipMap* SkMipMap::Build(const SkPixmap& src, SkSourceGammaTreatment treatment, const SkColorType ct = src.colorType(); const SkAlphaType at = src.alphaType(); - const bool srgbGamma = (SkSourceGammaTreatment::kRespect == treatment) + const bool srgbGamma = (SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware == colorMode) && src.info().gammaCloseToSRGB(); switch (ct) { @@ -601,7 +601,7 @@ bool SkMipMap::extractLevel(const SkSize& scaleSize, Level* levelPtr) const { // Helper which extracts a pixmap from the src bitmap // -SkMipMap* SkMipMap::Build(const SkBitmap& src, SkSourceGammaTreatment treatment, +SkMipMap* SkMipMap::Build(const SkBitmap& src, SkDestinationSurfaceColorMode colorMode, SkDiscardableFactoryProc fact) { SkAutoPixmapUnlock srcUnlocker; if (!src.requestLock(&srcUnlocker)) { @@ -612,7 +612,7 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src, SkSourceGammaTreatment treatment, if (nullptr == srcPixmap.addr()) { sk_throw(); } - return Build(srcPixmap, treatment, fact); + return Build(srcPixmap, colorMode, fact); } int SkMipMap::countLevels() const { diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h index 0f31a9f703..f3425cbeaa 100644 --- a/src/core/SkMipMap.h +++ b/src/core/SkMipMap.h @@ -28,12 +28,15 @@ typedef SkDiscardableMemory* (*SkDiscardableFactoryProc)(size_t bytes); */ class SkMipMap : public SkCachedData { public: - static SkMipMap* Build(const SkPixmap& src, SkSourceGammaTreatment, SkDiscardableFactoryProc); - static SkMipMap* Build(const SkBitmap& src, SkSourceGammaTreatment, SkDiscardableFactoryProc); - - static SkSourceGammaTreatment DeduceTreatment(const SkShader::ContextRec& rec) { - return (SkShader::ContextRec::kPMColor_DstType == rec.fPreferredDstType) ? - SkSourceGammaTreatment::kIgnore : SkSourceGammaTreatment::kRespect; + static SkMipMap* Build(const SkPixmap& src, SkDestinationSurfaceColorMode, + SkDiscardableFactoryProc); + static SkMipMap* Build(const SkBitmap& src, SkDestinationSurfaceColorMode, + SkDiscardableFactoryProc); + + static SkDestinationSurfaceColorMode DeduceColorMode(const SkShader::ContextRec& rec) { + return (SkShader::ContextRec::kPMColor_DstType == rec.fPreferredDstType) + ? SkDestinationSurfaceColorMode::kLegacy + : SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware; } // Determines how many levels a SkMipMap will have without creating that mipmap. diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp index ad954d29df..74cce6815c 100644 --- a/src/core/SkPictureShader.cpp +++ b/src/core/SkPictureShader.cpp @@ -329,6 +329,6 @@ sk_sp<GrFragmentProcessor> SkPictureShader::asFragmentProcessor(const AsFPArgs& } return bitmapShader->asFragmentProcessor(SkShader::AsFPArgs( args.fContext, args.fViewMatrix, nullptr, args.fFilterQuality, args.fDstColorSpace, - args.fGammaTreatment)); + args.fColorMode)); } #endif diff --git a/src/core/SkShadowShader.cpp b/src/core/SkShadowShader.cpp index c3ede8081e..8737b32cac 100644 --- a/src/core/SkShadowShader.cpp +++ b/src/core/SkShadowShader.cpp @@ -139,7 +139,7 @@ public: // gets deleted when the ShadowFP is destroyed, and frees the GrTexture* fTexture[fNumNonAmbLights] = sk_sp<GrTexture>(shadowMap->asTextureRef(context, GrTextureParams::ClampNoFilter(), - SkSourceGammaTreatment::kIgnore)); + SkDestinationSurfaceColorMode::kLegacy)); fDepthMapAccess[fNumNonAmbLights].reset(fTexture[fNumNonAmbLights].get()); this->addTextureAccess(&fDepthMapAccess[fNumNonAmbLights]); diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp index e750571ff3..239d9a90da 100644 --- a/src/core/SkSpecialImage.cpp +++ b/src/core/SkSpecialImage.cpp @@ -101,10 +101,9 @@ sk_sp<SkSpecialImage> SkSpecialImage::makeTextureImage(GrContext* context) { return SkSpecialImage::MakeFromRaster(SkIRect::MakeEmpty(), bmp, &this->props()); } - sk_sp<GrTexture> resultTex(GrRefCachedBitmapTexture(context, - bmp, - GrTextureParams::ClampNoFilter(), - SkSourceGammaTreatment::kRespect)); + sk_sp<GrTexture> resultTex( + GrRefCachedBitmapTexture(context, bmp, GrTextureParams::ClampNoFilter(), + SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware)); if (!resultTex) { return nullptr; } @@ -241,10 +240,9 @@ public: #if SK_SUPPORT_GPU sk_sp<GrTexture> onAsTextureRef(GrContext* context) const override { if (context) { - return sk_ref_sp(GrRefCachedBitmapTexture(context, - fBitmap, - GrTextureParams::ClampNoFilter(), - SkSourceGammaTreatment::kRespect)); + return sk_ref_sp( + GrRefCachedBitmapTexture(context, fBitmap, GrTextureParams::ClampNoFilter(), + SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware)); } return nullptr; @@ -252,11 +250,9 @@ public: sk_sp<GrTextureProxy> onAsTextureProxy(GrContext* context) const override { if (context) { - sk_sp<GrTexture> tex(sk_ref_sp(GrRefCachedBitmapTexture( - context, - fBitmap, - GrTextureParams::ClampNoFilter(), - SkSourceGammaTreatment::kRespect))); + sk_sp<GrTexture> tex(sk_ref_sp( + GrRefCachedBitmapTexture(context, fBitmap, GrTextureParams::ClampNoFilter(), + SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware))); return GrTextureProxy::Make(tex); } |