Un-plumb dstColorSpace through GrTextureProducer
All unused.
Bug: skia:
Change-Id: I35b32874b0865ff7a33560f9a7b80df603eac6f4
Reviewed-on: https://skia-review.googlesource.com/c/163885
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 4e36ece..d06a107 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -266,8 +266,7 @@
static void draw_as_tex(SkCanvas* canvas, SkImage* image, SkScalar x, SkScalar y) {
sk_sp<SkColorSpace> texColorSpace;
sk_sp<GrTextureProxy> proxy(as_IB(image)->asTextureProxyRef(
- canvas->getGrContext(), GrSamplerState::ClampBilerp(),
- canvas->imageInfo().colorSpace(), &texColorSpace, nullptr));
+ canvas->getGrContext(), GrSamplerState::ClampBilerp(), &texColorSpace, nullptr));
if (!proxy) {
// show placeholder if we have no texture
SkPaint paint;
diff --git a/src/gpu/GrBitmapTextureMaker.cpp b/src/gpu/GrBitmapTextureMaker.cpp
index 19ba702..8b70e81 100644
--- a/src/gpu/GrBitmapTextureMaker.cpp
+++ b/src/gpu/GrBitmapTextureMaker.cpp
@@ -31,7 +31,6 @@
}
sk_sp<GrTextureProxy> GrBitmapTextureMaker::refOriginalTextureProxy(bool willBeMipped,
- SkColorSpace* dstColorSpace,
AllowedTexGenType onlyIfFast) {
if (AllowedTexGenType::kCheap == onlyIfFast) {
return nullptr;
@@ -114,7 +113,6 @@
return fBitmap.alphaType();
}
-sk_sp<SkColorSpace> GrBitmapTextureMaker::getColorSpace(SkColorSpace* dstColorSpace) {
- // Color space doesn't depend on destination color space - it's just whatever is in the bitmap
+sk_sp<SkColorSpace> GrBitmapTextureMaker::getColorSpace() {
return fBitmap.refColorSpace();
}
diff --git a/src/gpu/GrBitmapTextureMaker.h b/src/gpu/GrBitmapTextureMaker.h
index 867d1f2..b73a7b4 100644
--- a/src/gpu/GrBitmapTextureMaker.h
+++ b/src/gpu/GrBitmapTextureMaker.h
@@ -20,14 +20,13 @@
protected:
sk_sp<GrTextureProxy> refOriginalTextureProxy(bool willBeMipped,
- SkColorSpace* dstColorSpace,
AllowedTexGenType onlyIfFast) override;
void makeCopyKey(const CopyParams& copyParams, GrUniqueKey* copyKey) override;
void didCacheCopy(const GrUniqueKey& copyKey, uint32_t contextUniqueID) override;
SkAlphaType alphaType() const override;
- sk_sp<SkColorSpace> getColorSpace(SkColorSpace* dstColorSpace) override;
+ sk_sp<SkColorSpace> getColorSpace() override;
private:
const SkBitmap fBitmap;
diff --git a/src/gpu/GrImageTextureMaker.cpp b/src/gpu/GrImageTextureMaker.cpp
index 0de2573..4764167 100644
--- a/src/gpu/GrImageTextureMaker.cpp
+++ b/src/gpu/GrImageTextureMaker.cpp
@@ -20,10 +20,9 @@
}
sk_sp<GrTextureProxy> GrImageTextureMaker::refOriginalTextureProxy(bool willBeMipped,
- SkColorSpace* dstColorSpace,
AllowedTexGenType onlyIfFast) {
return fImage->lockTextureProxy(this->context(), fOriginalKey, fCachingHint,
- willBeMipped, dstColorSpace, onlyIfFast);
+ willBeMipped, onlyIfFast);
}
void GrImageTextureMaker::makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) {
@@ -37,6 +36,6 @@
SkAlphaType GrImageTextureMaker::alphaType() const {
return fImage->alphaType();
}
-sk_sp<SkColorSpace> GrImageTextureMaker::getColorSpace(SkColorSpace* dstColorSpace) {
+sk_sp<SkColorSpace> GrImageTextureMaker::getColorSpace() {
return fImage->refColorSpace();
}
diff --git a/src/gpu/GrImageTextureMaker.h b/src/gpu/GrImageTextureMaker.h
index bb3e830..660cc3f 100644
--- a/src/gpu/GrImageTextureMaker.h
+++ b/src/gpu/GrImageTextureMaker.h
@@ -24,14 +24,13 @@
// able to efficiently produce a "stretched" texture natively (e.g. picture-backed)
// GrTexture* generateTextureForParams(const CopyParams&) override;
sk_sp<GrTextureProxy> refOriginalTextureProxy(bool willBeMipped,
- SkColorSpace* dstColorSpace,
AllowedTexGenType onlyIfFast) override;
void makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) override;
void didCacheCopy(const GrUniqueKey& copyKey, uint32_t contextUniqueID) override {}
SkAlphaType alphaType() const override;
- sk_sp<SkColorSpace> getColorSpace(SkColorSpace* dstColorSpace) override;
+ sk_sp<SkColorSpace> getColorSpace() override;
private:
const SkImage_Lazy* fImage;
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp
index aa478aa..d30a1a4 100644
--- a/src/gpu/GrTextureAdjuster.cpp
+++ b/src/gpu/GrTextureAdjuster.cpp
@@ -73,7 +73,6 @@
sk_sp<GrTextureProxy> GrTextureAdjuster::onRefTextureProxyForParams(
const GrSamplerState& params,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* texColorSpace,
bool willBeMipped,
SkScalar scaleAdjust[2]) {
@@ -130,7 +129,7 @@
}
SkScalar scaleAdjust[2] = { 1.0f, 1.0f };
sk_sp<GrTextureProxy> proxy(
- this->refTextureProxyForParams(samplerState, nullptr, nullptr, scaleAdjust));
+ this->refTextureProxyForParams(samplerState, nullptr, scaleAdjust));
if (!proxy) {
return nullptr;
}
diff --git a/src/gpu/GrTextureAdjuster.h b/src/gpu/GrTextureAdjuster.h
index f9c9ca3..708869d 100644
--- a/src/gpu/GrTextureAdjuster.h
+++ b/src/gpu/GrTextureAdjuster.h
@@ -43,7 +43,6 @@
private:
sk_sp<GrTextureProxy> onRefTextureProxyForParams(const GrSamplerState&,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace,
bool willBeMipped,
SkScalar scaleAdjust[2]) override;
diff --git a/src/gpu/GrTextureMaker.cpp b/src/gpu/GrTextureMaker.cpp
index cb383d4..213a1a8 100644
--- a/src/gpu/GrTextureMaker.cpp
+++ b/src/gpu/GrTextureMaker.cpp
@@ -14,7 +14,6 @@
#include "GrProxyProvider.h"
sk_sp<GrTextureProxy> GrTextureMaker::onRefTextureProxyForParams(const GrSamplerState& params,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* texColorSpace,
bool willBeMipped,
SkScalar scaleAdjust[2]) {
@@ -26,10 +25,10 @@
CopyParams copyParams;
if (texColorSpace) {
- *texColorSpace = this->getColorSpace(dstColorSpace);
+ *texColorSpace = this->getColorSpace();
}
- sk_sp<GrTextureProxy> original(this->refOriginalTextureProxy(willBeMipped, dstColorSpace,
+ sk_sp<GrTextureProxy> original(this->refOriginalTextureProxy(willBeMipped,
AllowedTexGenType::kCheap));
bool needsCopyForMipsOnly = false;
if (original) {
@@ -49,8 +48,7 @@
!GrGpu::IsACopyNeededForRepeatWrapMode(fContext->contextPriv().caps(), nullptr,
this->width(), this->height(),
params.filter(), ©Params, scaleAdjust)) {
- return this->refOriginalTextureProxy(willBeMipped, dstColorSpace,
- AllowedTexGenType::kAny);
+ return this->refOriginalTextureProxy(willBeMipped, AllowedTexGenType::kAny);
}
}
@@ -74,8 +72,7 @@
source = cachedProxy;
} else {
// Since we will be copying this texture there is no reason to make it mipped
- source = this->refOriginalTextureProxy(false, dstColorSpace,
- AllowedTexGenType::kAny);
+ source = this->refOriginalTextureProxy(false, AllowedTexGenType::kAny);
}
if (!source) {
@@ -138,8 +135,8 @@
}
sk_sp<SkColorSpace> texColorSpace;
SkScalar scaleAdjust[2] = { 1.0f, 1.0f };
- sk_sp<GrTextureProxy> proxy(this->refTextureProxyForParams(samplerState, dstColorSpace,
- &texColorSpace, scaleAdjust));
+ sk_sp<GrTextureProxy> proxy(this->refTextureProxyForParams(samplerState, &texColorSpace,
+ scaleAdjust));
if (!proxy) {
return nullptr;
}
diff --git a/src/gpu/GrTextureMaker.h b/src/gpu/GrTextureMaker.h
index e2dd3c8..481fee7 100644
--- a/src/gpu/GrTextureMaker.h
+++ b/src/gpu/GrTextureMaker.h
@@ -38,20 +38,17 @@
* by drawing into a render target).
*/
virtual sk_sp<GrTextureProxy> refOriginalTextureProxy(bool willBeMipped,
- SkColorSpace* dstColorSpace,
AllowedTexGenType genType) = 0;
/**
- * Returns the color space of the maker's "original" texture, assuming it was retrieved with
- * the same destination color space.
+ * Returns the color space of the maker's "original" texture.
*/
- virtual sk_sp<SkColorSpace> getColorSpace(SkColorSpace* dstColorSpace) = 0;
+ virtual sk_sp<SkColorSpace> getColorSpace() = 0;
GrContext* context() const { return fContext; }
private:
sk_sp<GrTextureProxy> onRefTextureProxyForParams(const GrSamplerState&,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace,
bool willBeMipped,
SkScalar scaleAdjust[2]) override;
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index 8d3549d..7e6fecc 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -217,7 +217,6 @@
sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxyForParams(
const GrSamplerState& sampler,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace,
SkScalar scaleAdjust[2]) {
// Check that the caller pre-initialized scaleAdjust
@@ -232,9 +231,8 @@
bool willBeMipped = GrSamplerState::Filter::kMipMap == sampler.filter() && mipCount &&
fContext->contextPriv().caps()->mipMapSupport();
- auto result =
- this->onRefTextureProxyForParams(sampler, dstColorSpace, proxyColorSpace, willBeMipped,
- scaleAdjust);
+ auto result = this->onRefTextureProxyForParams(sampler, proxyColorSpace, willBeMipped,
+ scaleAdjust);
// Check to make sure that if we say the texture willBeMipped that the returned texture has mip
// maps, unless the config is not copyable.
@@ -249,7 +247,6 @@
}
sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxy(GrMipMapped willNeedMips,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace) {
GrSamplerState::Filter filter =
GrMipMapped::kNo == willNeedMips ? GrSamplerState::Filter::kNearest
@@ -260,9 +257,7 @@
bool willBeMipped = GrSamplerState::Filter::kMipMap == sampler.filter() && mipCount &&
fContext->contextPriv().caps()->mipMapSupport();
- auto result =
- this->onRefTextureProxyForParams(sampler, dstColorSpace, proxyColorSpace,
- willBeMipped, nullptr);
+ auto result = this->onRefTextureProxyForParams(sampler, proxyColorSpace, willBeMipped, nullptr);
// Check to make sure that if we say the texture willBeMipped that the returned texture has mip
// maps, unless the config is not copyable.
diff --git a/src/gpu/GrTextureProducer.h b/src/gpu/GrTextureProducer.h
index c41912d..d647639 100644
--- a/src/gpu/GrTextureProducer.h
+++ b/src/gpu/GrTextureProducer.h
@@ -86,23 +86,21 @@
* Places the color space of the texture in (*proxyColorSpace).
*/
sk_sp<GrTextureProxy> refTextureProxyForParams(const GrSamplerState&,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace,
SkScalar scaleAdjust[2]);
sk_sp<GrTextureProxy> refTextureProxyForParams(GrSamplerState::Filter filter,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace,
SkScalar scaleAdjust[2]) {
return this->refTextureProxyForParams(
- GrSamplerState(GrSamplerState::WrapMode::kClamp, filter), dstColorSpace,
+ GrSamplerState(GrSamplerState::WrapMode::kClamp, filter),
proxyColorSpace, scaleAdjust);
}
/**
- * Returns a texture that is safe for use with the dstColorSpace. If willNeedMips is true then
- * the returned texture is guaranteed to have allocated mip map levels. This can be a
- * performance win if future draws with the texture require mip maps.
+ * Returns a texture. If willNeedMips is true then the returned texture is guaranteed to have
+ * allocated mip map levels. This can be a performance win if future draws with the texture
+ * require mip maps.
*
* Places the color space of the texture in (*proxyColorSpace).
*/
@@ -111,7 +109,6 @@
// refTextureProxyForParams, however the current public API that uses this call does not expose
// that array.
sk_sp<GrTextureProxy> refTextureProxy(GrMipMapped willNeedMips,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace);
virtual ~GrTextureProducer() {}
@@ -189,7 +186,6 @@
private:
virtual sk_sp<GrTextureProxy> onRefTextureProxyForParams(const GrSamplerState&,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* proxyColorSpace,
bool willBeMipped,
SkScalar scaleAdjust[2]) = 0;
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 47f6a1a..c5e6daa 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1400,7 +1400,7 @@
const GrSamplerState::Filter filter = compute_lattice_filter_mode(*paint);
sk_sp<SkColorSpace> proxyColorSpace;
auto proxy =
- producer->refTextureProxyForParams(filter, dstColorSpace, &proxyColorSpace, nullptr);
+ producer->refTextureProxyForParams(filter, &proxyColorSpace, nullptr);
if (!proxy) {
return;
}
@@ -1482,7 +1482,7 @@
textures[i].fProxy =
as_IB(set[i].fImage.get())
->asTextureProxyRef(fContext.get(), GrSamplerState::ClampBilerp(), nullptr,
- nullptr, nullptr);
+ nullptr);
textures[i].fSrcRect = set[i].fSrcRect;
textures[i].fDstRect = set[i].fDstRect;
textures[i].fAAFlags = SkToGrQuadAAFlags(set[i].fAAFlags);
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index f85b7d9..70ebf0f 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -168,9 +168,7 @@
sk_sp<SkColorSpace> cs;
// We've done enough checks above to allow us to pass ClampNearest() and not check for
// scaling adjustments.
- auto proxy = maker->refTextureProxyForParams(
- GrSamplerState::ClampNearest(), fRenderTargetContext->colorSpaceInfo().colorSpace(),
- &cs, nullptr);
+ auto proxy = maker->refTextureProxyForParams(GrSamplerState::ClampNearest(), &cs, nullptr);
if (!proxy) {
return;
}
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 0406aa3..b8e2e88 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -180,8 +180,7 @@
const GrSamplerState& params,
SkScalar scaleAdjust[2]) {
// Caller doesn't care about the texture's color space (they can always get it from the bitmap)
- return GrBitmapTextureMaker(ctx, bitmap).refTextureProxyForParams(params, nullptr,
- nullptr, scaleAdjust);
+ return GrBitmapTextureMaker(ctx, bitmap).refTextureProxyForParams(params, nullptr, scaleAdjust);
}
sk_sp<GrTextureProxy> GrMakeCachedBitmapProxy(GrProxyProvider* proxyProvider,
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index c0de6f5..d40c1c1 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -54,7 +54,7 @@
virtual GrTextureProxy* peekProxy() const { return nullptr; }
virtual sk_sp<GrTextureProxy> asTextureProxyRef() const { return nullptr; }
virtual sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*, const GrSamplerState&,
- SkColorSpace*, sk_sp<SkColorSpace>*,
+ sk_sp<SkColorSpace>*,
SkScalar scaleAdjust[2]) const = 0;
virtual sk_sp<GrTextureProxy> refPinnedTextureProxy(uint32_t* uniqueID) const {
return nullptr;
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 33a0a2c..5212457 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -344,11 +344,9 @@
static sk_sp<SkImage> create_image_from_producer(GrContext* context, GrTextureProducer* producer,
SkAlphaType at, uint32_t id,
- SkColorSpace* dstColorSpace,
GrMipMapped mipMapped) {
sk_sp<SkColorSpace> texColorSpace;
- sk_sp<GrTextureProxy> proxy(producer->refTextureProxy(mipMapped, dstColorSpace,
- &texColorSpace));
+ sk_sp<GrTextureProxy> proxy(producer->refTextureProxy(mipMapped, &texColorSpace));
if (!proxy) {
return nullptr;
}
@@ -373,19 +371,19 @@
GrTextureAdjuster adjuster(context, std::move(proxy), this->alphaType(),
this->uniqueID(), this->colorSpace());
return create_image_from_producer(context, &adjuster, this->alphaType(),
- this->uniqueID(), dstColorSpace, mipMapped);
+ this->uniqueID(), mipMapped);
}
if (this->isLazyGenerated()) {
GrImageTextureMaker maker(context, this, kDisallow_CachingHint);
return create_image_from_producer(context, &maker, this->alphaType(),
- this->uniqueID(), dstColorSpace, mipMapped);
+ this->uniqueID(), mipMapped);
}
if (const SkBitmap* bmp = as_IB(this)->onPeekBitmap()) {
GrBitmapTextureMaker maker(context, *bmp);
return create_image_from_producer(context, &maker, this->alphaType(),
- this->uniqueID(), dstColorSpace, mipMapped);
+ this->uniqueID(), mipMapped);
}
return nullptr;
}
@@ -665,7 +663,7 @@
GrSamplerState::WrapMode::kClamp,
buildMips ? GrSamplerState::Filter::kMipMap : GrSamplerState::Filter::kBilerp);
sk_sp<GrTextureProxy> proxy(
- maker.refTextureProxyForParams(samplerState, dstColorSpace, &texColorSpace, nullptr));
+ maker.refTextureProxyForParams(samplerState, &texColorSpace, nullptr));
if (!proxy) {
return codecImage;
}
diff --git a/src/image/SkImage_GpuBase.cpp b/src/image/SkImage_GpuBase.cpp
index ff07a51..50d07ac 100644
--- a/src/image/SkImage_GpuBase.cpp
+++ b/src/image/SkImage_GpuBase.cpp
@@ -187,7 +187,6 @@
sk_sp<GrTextureProxy> SkImage_GpuBase::asTextureProxyRef(GrContext* context,
const GrSamplerState& params,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* texColorSpace,
SkScalar scaleAdjust[2]) const {
if (context->uniqueID() != fContext->uniqueID()) {
@@ -197,7 +196,7 @@
GrTextureAdjuster adjuster(fContext.get(), this->asTextureProxyRef(), fAlphaType,
this->uniqueID(), fColorSpace.get());
- return adjuster.refTextureProxyForParams(params, dstColorSpace, texColorSpace, scaleAdjust);
+ return adjuster.refTextureProxyForParams(params, texColorSpace, scaleAdjust);
}
GrBackendTexture SkImage_GpuBase::onGetBackendTexture(bool flushPendingGrContextIO,
diff --git a/src/image/SkImage_GpuBase.h b/src/image/SkImage_GpuBase.h
index 3e8ab2d..3c3de1e 100644
--- a/src/image/SkImage_GpuBase.h
+++ b/src/image/SkImage_GpuBase.h
@@ -34,8 +34,7 @@
SkASSERT(false);
return this->INHERITED::asTextureProxyRef();
}
- sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*, const GrSamplerState&, SkColorSpace*,
- sk_sp<SkColorSpace>*,
+ sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*, const GrSamplerState&, sk_sp<SkColorSpace>*,
SkScalar scaleAdjust[2]) const final;
sk_sp<GrTextureProxy> refPinnedTextureProxy(uint32_t* uniqueID) const final {
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index 04b8510..80dfdfa 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -288,7 +288,6 @@
#if SK_SUPPORT_GPU
sk_sp<GrTextureProxy> SkImage_Lazy::asTextureProxyRef(GrContext* context,
const GrSamplerState& params,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* texColorSpace,
SkScalar scaleAdjust[2]) const {
if (!context) {
@@ -296,7 +295,7 @@
}
GrImageTextureMaker textureMaker(context, this, kAllow_CachingHint);
- return textureMaker.refTextureProxyForParams(params, dstColorSpace, texColorSpace, scaleAdjust);
+ return textureMaker.refTextureProxyForParams(params, texColorSpace, scaleAdjust);
}
#endif
@@ -415,7 +414,6 @@
const GrUniqueKey& origKey,
SkImage::CachingHint chint,
bool willBeMipped,
- SkColorSpace* dstColorSpace,
GrTextureMaker::AllowedTexGenType genType) const {
// Values representing the various texture lock paths we can take. Used for logging the path
// taken to a histogram.
@@ -435,7 +433,6 @@
// not include that in the key. Since SkImages are meant to be immutable, a given SkImage will
// always have an associated proxy that is always one origin or the other. It never can change
// origins. Thus we don't need to include that info in the key iteself.
- // TODO: This needs to include the dstColorSpace.
GrUniqueKey key;
this->makeCacheKeyFromOrigKey(origKey, &key);
diff --git a/src/image/SkImage_Lazy.h b/src/image/SkImage_Lazy.h
index 739b5b5..332133c 100644
--- a/src/image/SkImage_Lazy.h
+++ b/src/image/SkImage_Lazy.h
@@ -46,7 +46,7 @@
CachingHint) const override;
#if SK_SUPPORT_GPU
sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*,
- const GrSamplerState&, SkColorSpace*,
+ const GrSamplerState&,
sk_sp<SkColorSpace>*,
SkScalar scaleAdjust[2]) const override;
sk_sp<SkCachedData> getPlanes(SkYUVSizeInfo*, SkYUVAIndex[4],
@@ -74,7 +74,6 @@
const GrUniqueKey& key,
SkImage::CachingHint,
bool willBeMipped,
- SkColorSpace* dstColorSpace,
GrTextureMaker::AllowedTexGenType genType) const;
// TODO: Need to pass in dstColorSpace to fold into key here?
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index db67d3e..af99dde 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -82,8 +82,7 @@
const SkBitmap* onPeekBitmap() const override { return &fBitmap; }
#if SK_SUPPORT_GPU
- sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*, const GrSamplerState&, SkColorSpace*,
- sk_sp<SkColorSpace>*,
+ sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*, const GrSamplerState&, sk_sp<SkColorSpace>*,
SkScalar scaleAdjust[2]) const override;
#endif
@@ -173,7 +172,6 @@
#if SK_SUPPORT_GPU
sk_sp<GrTextureProxy> SkImage_Raster::asTextureProxyRef(GrContext* context,
const GrSamplerState& params,
- SkColorSpace* dstColorSpace,
sk_sp<SkColorSpace>* texColorSpace,
SkScalar scaleAdjust[2]) const {
if (!context) {
@@ -185,7 +183,7 @@
if (tex) {
GrTextureAdjuster adjuster(context, fPinnedProxy, fBitmap.alphaType(), fPinnedUniqueID,
fBitmap.colorSpace());
- return adjuster.refTextureProxyForParams(params, dstColorSpace, texColorSpace, scaleAdjust);
+ return adjuster.refTextureProxyForParams(params, texColorSpace, scaleAdjust);
}
if (texColorSpace) {
diff --git a/src/shaders/SkImageShader.cpp b/src/shaders/SkImageShader.cpp
index 140a758..95a8ca0 100644
--- a/src/shaders/SkImageShader.cpp
+++ b/src/shaders/SkImageShader.cpp
@@ -202,9 +202,8 @@
GrSamplerState samplerState(wrapModes, textureFilterMode);
sk_sp<SkColorSpace> texColorSpace;
SkScalar scaleAdjust[2] = { 1.0f, 1.0f };
- sk_sp<GrTextureProxy> proxy(as_IB(fImage)->asTextureProxyRef(
- args.fContext, samplerState, args.fDstColorSpaceInfo->colorSpace(), &texColorSpace,
- scaleAdjust));
+ sk_sp<GrTextureProxy> proxy(as_IB(fImage)->asTextureProxyRef(args.fContext, samplerState,
+ &texColorSpace, scaleAdjust));
if (!proxy) {
return nullptr;
}
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 7942169..561cef2 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -986,19 +986,19 @@
// Any context should be able to borrow the texture at this point
sk_sp<SkColorSpace> texColorSpace;
sk_sp<GrTextureProxy> proxy = as_IB(refImg)->asTextureProxyRef(
- ctx, GrSamplerState::ClampNearest(), nullptr, &texColorSpace, nullptr);
+ ctx, GrSamplerState::ClampNearest(), &texColorSpace, nullptr);
REPORTER_ASSERT(reporter, proxy);
// But once it's borrowed, no other context should be able to borrow
otherTestContext->makeCurrent();
sk_sp<GrTextureProxy> otherProxy = as_IB(refImg)->asTextureProxyRef(
- otherCtx, GrSamplerState::ClampNearest(), nullptr, &texColorSpace, nullptr);
+ otherCtx, GrSamplerState::ClampNearest(), &texColorSpace, nullptr);
REPORTER_ASSERT(reporter, !otherProxy);
// Original context (that's already borrowing) should be okay
testContext->makeCurrent();
sk_sp<GrTextureProxy> proxySecondRef = as_IB(refImg)->asTextureProxyRef(
- ctx, GrSamplerState::ClampNearest(), nullptr, &texColorSpace, nullptr);
+ ctx, GrSamplerState::ClampNearest(), &texColorSpace, nullptr);
REPORTER_ASSERT(reporter, proxySecondRef);
// Release first ref from the original context
@@ -1008,7 +1008,7 @@
// a new context is still not able to borrow the texture.
otherTestContext->makeCurrent();
otherProxy = as_IB(refImg)->asTextureProxyRef(otherCtx, GrSamplerState::ClampNearest(),
- nullptr, &texColorSpace, nullptr);
+ &texColorSpace, nullptr);
REPORTER_ASSERT(reporter, !otherProxy);
// Release second ref from the original context
@@ -1018,7 +1018,7 @@
// Now we should be able to borrow the texture from the other context
otherTestContext->makeCurrent();
otherProxy = as_IB(refImg)->asTextureProxyRef(otherCtx, GrSamplerState::ClampNearest(),
- nullptr, &texColorSpace, nullptr);
+ &texColorSpace, nullptr);
REPORTER_ASSERT(reporter, otherProxy);
// Release everything
@@ -1069,7 +1069,7 @@
sk_sp<SkColorSpace> texColorSpace;
sk_sp<GrTextureProxy> proxy = as_IB(image)->asTextureProxyRef(
- ctx, GrSamplerState::ClampNearest(), nullptr, &texColorSpace, nullptr);
+ ctx, GrSamplerState::ClampNearest(), &texColorSpace, nullptr);
REPORTER_ASSERT(reporter, proxy);
bool expectAlpha = kAlpha_8_SkColorType == ct;