Plumb dst color space in many places, rather than "mode"
This is less to type in most cases, and gives us more information
(for things like picture-backed images, where we need to know all
about the destination surface).
Additionally, strip out the plumbing entirely for bitmap sources,
where we don't need to know anything.
BUG=skia:
Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da
Reviewed-on: https://skia-review.googlesource.com/5748
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/effects/SkImageSource.cpp b/src/effects/SkImageSource.cpp
index de84941..0f0160d 100644
--- a/src/effects/SkImageSource.cpp
+++ b/src/effects/SkImageSource.cpp
@@ -86,12 +86,8 @@
if (fSrcRect == bounds && dstRect == bounds) {
// No regions cropped out or resized; return entire image.
offset->fX = offset->fY = 0;
- SkDestinationSurfaceColorMode decodeColorMode = ctx.outputProperties().colorSpace()
- ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
- : SkDestinationSurfaceColorMode::kLegacy;
return SkSpecialImage::MakeFromImage(SkIRect::MakeWH(fImage->width(), fImage->height()),
- fImage,
- decodeColorMode,
+ fImage, ctx.outputProperties().colorSpace(),
&source->props());
}
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 3f7f721..dc3d9a6 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -926,10 +926,10 @@
new PaintingData(fTileSize, fSeed, fBaseFrequencyX, fBaseFrequencyY, matrix);
sk_sp<GrTexture> permutationsTexture(
GrRefCachedBitmapTexture(args.fContext, paintingData->getPermutationsBitmap(),
- GrSamplerParams::ClampNoFilter(), args.fColorMode));
+ GrSamplerParams::ClampNoFilter()));
sk_sp<GrTexture> noiseTexture(
GrRefCachedBitmapTexture(args.fContext, paintingData->getNoiseBitmap(),
- GrSamplerParams::ClampNoFilter(), args.fColorMode));
+ GrSamplerParams::ClampNoFilter()));
SkMatrix m = *args.fViewMatrix;
m.setTranslateX(-localMatrix.getTranslateX() + SK_Scalar1);
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index c2683b5..9c74634 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -474,8 +474,7 @@
if (-1 == row) {
atlas = nullptr;
texture.reset(
- GrRefCachedBitmapTexture(context, bitmap, GrSamplerParams::ClampNoFilter(),
- SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
+ GrRefCachedBitmapTexture(context, bitmap, GrSamplerParams::ClampNoFilter()));
} else {
texture.reset(SkRef(atlas->getTexture()));
}
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 507fbe4..df78da9 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1662,9 +1662,7 @@
fCoordTransform.reset(*args.fMatrix, fAtlas->getTexture(), params.filterMode());
fTextureSampler.reset(fAtlas->getTexture(), params);
} else {
- sk_sp<GrTexture> texture(GrRefCachedBitmapTexture(
- args.fContext, bitmap, params,
- SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
+ sk_sp<GrTexture> texture(GrRefCachedBitmapTexture(args.fContext, bitmap, params));
if (!texture) {
return;
}