Introduce GrColorSpaceXform, for gamut conversion on textures
authorbrianosman <brianosman@google.com>
Mon, 18 Jul 2016 17:53:52 +0000 (10:53 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 18 Jul 2016 17:53:52 +0000 (10:53 -0700)
commit54f30c13fc0a5d89797fc9be5f0fb1050d96b6f4
tree484d25c1b668126bd51203cd1875d7c47f34a1bf
parentbaaea531c249d3a13b0d04eca59b8bd0ee58d76b
Introduce GrColorSpaceXform, for gamut conversion on textures

GrTextureAccess optionally includes an instance, computed from the src
and dst color spaces. In all common cases (no color space for either src
or dst, or same color space for both), no object is allocated.

This change is orthogonal to my attempts to get color space attached to
render targets - regardless of how we choose to do that, this will give
us the source color space at all points where we are connecting src to
dst.

There are many dangling injection points where I've been inserting
nullptr, but I have a record of all of them. Additionally, there are now
three places (the most common simple paths for bitmap/image rendering)
where things are plumbed enough that I expect to have access to the dst
color space (all marked with XFORMTODO).

In addition to getting the dst color space, I need to inject shader code
and uniform uploading for appendTextureLookup and friends.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2154753003

Review-Url: https://codereview.chromium.org/2154753003
36 files changed:
gm/texdata.cpp
gm/texturedomaineffect.cpp
gyp/gpu.gypi
include/gpu/GrColorSpaceXform.h [new file with mode: 0644]
include/gpu/GrPaint.h
src/core/SkBitmapProcShader.cpp
src/effects/SkBlurMaskFilter.cpp
src/effects/SkGpuBlurUtils.cpp
src/effects/SkLightingImageFilter.cpp
src/effects/SkMagnifierImageFilter.cpp
src/effects/SkXfermodeImageFilter.cpp
src/gpu/GrBlurUtils.cpp
src/gpu/GrClipMaskManager.cpp
src/gpu/GrColorSpaceXform.cpp [new file with mode: 0644]
src/gpu/GrContext.cpp
src/gpu/GrPaint.cpp
src/gpu/GrPipelineBuilder.h
src/gpu/GrSWMaskHelper.cpp
src/gpu/GrTextureParamsAdjuster.cpp
src/gpu/GrTextureToYUVPlanes.cpp
src/gpu/SkGpuDevice.cpp
src/gpu/effects/Gr1DKernelEffect.h
src/gpu/effects/GrBicubicEffect.cpp
src/gpu/effects/GrBicubicEffect.h
src/gpu/effects/GrConfigConversionEffect.cpp
src/gpu/effects/GrMatrixConvolutionEffect.cpp
src/gpu/effects/GrSimpleTextureEffect.cpp
src/gpu/effects/GrSimpleTextureEffect.h
src/gpu/effects/GrSingleTextureEffect.cpp
src/gpu/effects/GrSingleTextureEffect.h
src/gpu/effects/GrTextureDomain.cpp
src/gpu/effects/GrTextureDomain.h
src/gpu/glsl/GrGLSLColorSpaceXformHelper.h [new file with mode: 0644]
src/image/SkImageShader.cpp
tests/SRGBMipMapTest.cpp
tools/gpu/GrTest.cpp