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/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,