aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrColorSpaceInfo.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-10-25 15:12:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-25 19:32:20 +0000
commit4cbb6e6d551e8bea2c040b1aa9dce253cffb9af0 (patch)
treea93401716e0f5d45760da36b49c8cf8ea8e1cc21 /src/gpu/GrColorSpaceInfo.cpp
parent291af4f17e0630f78a8c4d22f304243fb28ae42b (diff)
Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.
Also to SkColorTo(Premul|Unpremul)GrColor4f. This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup. Also uses GrColorSpaceInfo to construct GrTextUtils::Paint. Bug: skia: Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d Reviewed-on: https://skia-review.googlesource.com/63660 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrColorSpaceInfo.cpp')
-rw-r--r--src/gpu/GrColorSpaceInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gpu/GrColorSpaceInfo.cpp b/src/gpu/GrColorSpaceInfo.cpp
index 1cb843042d..cd0dc1634d 100644
--- a/src/gpu/GrColorSpaceInfo.cpp
+++ b/src/gpu/GrColorSpaceInfo.cpp
@@ -20,5 +20,7 @@ GrColorSpaceXform* GrColorSpaceInfo::colorSpaceXformFromSRGB() const {
fColorXformFromSRGB = GrColorSpaceXform::Make(srgbColorSpace.get(), fColorSpace.get());
fInitializedColorSpaceXformFromSRGB = true;
}
+ // You can't be color-space aware in legacy mode
+ SkASSERT(fColorSpace || !fColorXformFromSRGB);
return fColorXformFromSRGB.get();
}