From 61624f0c716b576706659750d87b6956f4c15722 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 9 Dec 2016 14:51:59 -0500 Subject: 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 Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- include/core/SkShader.h | 7 ++----- include/gpu/GrRenderTargetContext.h | 4 ---- include/gpu/SkGr.h | 6 ++---- 3 files changed, 4 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/core/SkShader.h b/include/core/SkShader.h index cafeedd0d1..6d24c1a73c 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -342,21 +342,18 @@ public: const SkMatrix* viewMatrix, const SkMatrix* localMatrix, SkFilterQuality filterQuality, - SkColorSpace* dstColorSpace, - SkDestinationSurfaceColorMode colorMode) + SkColorSpace* dstColorSpace) : fContext(context) , fViewMatrix(viewMatrix) , fLocalMatrix(localMatrix) , fFilterQuality(filterQuality) - , fDstColorSpace(dstColorSpace) - , fColorMode(colorMode) {} + , fDstColorSpace(dstColorSpace) {} GrContext* fContext; const SkMatrix* fViewMatrix; const SkMatrix* fLocalMatrix; SkFilterQuality fFilterQuality; SkColorSpace* fDstColorSpace; - SkDestinationSurfaceColorMode fColorMode; }; /** diff --git a/include/gpu/GrRenderTargetContext.h b/include/gpu/GrRenderTargetContext.h index 7ef572abce..3468528f57 100644 --- a/include/gpu/GrRenderTargetContext.h +++ b/include/gpu/GrRenderTargetContext.h @@ -344,10 +344,6 @@ public: GrPixelConfig config() const { return fRenderTargetProxy->config(); } int numColorSamples() const { return fRenderTargetProxy->numColorSamples(); } bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); } - SkDestinationSurfaceColorMode colorMode() const { - return this->isGammaCorrect() ? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware - : SkDestinationSurfaceColorMode::kLegacy; - } const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } SkColorSpace* getColorSpace() const { return fColorSpace.get(); } GrColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRGB.get(); } diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h index 0e58e72aca..e59720e82d 100644 --- a/include/gpu/SkGr.h +++ b/include/gpu/SkGr.h @@ -79,11 +79,9 @@ static inline GrColor SkPMColorToGrColor(SkPMColor c) { /** Returns a texture representing the bitmap that is compatible with the GrSamplerParams. The texture is inserted into the cache (unless the bitmap is marked volatile) and can be retrieved again via this function. */ -GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrSamplerParams&, - SkDestinationSurfaceColorMode); +GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrSamplerParams&); -sk_sp GrMakeCachedBitmapTexture(GrContext*, const SkBitmap&, const GrSamplerParams&, - SkDestinationSurfaceColorMode); +sk_sp GrMakeCachedBitmapTexture(GrContext*, const SkBitmap&, const GrSamplerParams&); // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWindow its subclasses). GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, const SkColorSpace*, -- cgit v1.2.3