aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrColorSpaceInfo.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-06-15 15:06:48 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-15 20:12:35 +0000
commit08a50e02dba37427e7d479d2222b08259d226d50 (patch)
treeea806d959ba170f263c5055ff0c4173c548d86e8 /src/gpu/GrColorSpaceInfo.cpp
parent397ee0e4aa571caeb90817022d8213c82ddc843f (diff)
Include sRGB -> Linear in the cached "from sRGB" xform
This simplifies the handling of paint color conversion, as well as GrDrawVerticesOp and the default geometry processor. We don't need to track "linearize" separate from the color space xform. We only supply an xform if needed. The linearize is now done automatically by the xform, though we aren't converting to destination gamma. https://skia-review.googlesource.com/c/skia/+/132090 will fix that. Change-Id: I0af3f29c123c3dadb818f87c5d295bc78e2ff079 Reviewed-on: https://skia-review.googlesource.com/135141 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrColorSpaceInfo.cpp')
-rw-r--r--src/gpu/GrColorSpaceInfo.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gpu/GrColorSpaceInfo.cpp b/src/gpu/GrColorSpaceInfo.cpp
index 1a49e8622d..73218b26c5 100644
--- a/src/gpu/GrColorSpaceInfo.cpp
+++ b/src/gpu/GrColorSpaceInfo.cpp
@@ -15,10 +15,9 @@ GrColorSpaceInfo::GrColorSpaceInfo(sk_sp<SkColorSpace> colorSpace, GrPixelConfig
GrColorSpaceXform* GrColorSpaceInfo::colorSpaceXformFromSRGB() const {
// TODO: Make this atomic if we start accessing this on multiple threads.
if (!fInitializedColorSpaceXformFromSRGB) {
- // sRGB sources are very common (SkColor, etc...), so we cache that gamut transformation
+ // sRGB sources are very common (SkColor, etc...), so we cache that transformation
auto srgbColorSpace = SkColorSpace::MakeSRGB();
- fColorXformFromSRGB = GrColorSpaceXform::MakeGamutXform(srgbColorSpace.get(),
- fColorSpace.get());
+ fColorXformFromSRGB = GrColorSpaceXform::Make(srgbColorSpace.get(), fColorSpace.get());
fInitializedColorSpaceXformFromSRGB = true;
}
// You can't be color-space aware in legacy mode