aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar raftias <raftias@google.com>2016-10-18 10:02:51 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-18 10:02:52 -0700
commit9488833428e83c93a7e6002f4d056084fb57112f (patch)
tree725cd5f30d3b685b3e7d18eb68a551d9b76ad5df /src/effects/gradients
parentb9eb887f8baa3dcf89b0106a799aff03b5c1cbba (diff)
Refactored SkColorSpace and added in a Lab PCS GM
The refactoring breaks off A2B0 tag support into a separate subclass of SkColorSpace_Base, while keeping the current (besides CLUT) functionality in a XYZTRC subclass. ICC profile loading is now aware of this and creates the A2B0 subclass when SkColorSpace::NewICC() is called on a profile in need of the A2B0 functionality. The LabPCSDemo GM loads a .icc profile containing a LAB PCS and then runs a Lab->XYZ conversion on an image using it so we can display it and test out the A2B0 SkColorSpace functionality, sans a/b/m-curves, as well as the Lab->XYZ conversion code. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2389983002 Review-Url: https://codereview.chromium.org/2389983002
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 03f03b20b1..6c99b37ad7 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -6,7 +6,7 @@
*/
#include "Sk4fLinearGradient.h"
-#include "SkColorSpace_Base.h"
+#include "SkColorSpace_XYZ.h"
#include "SkGradientShaderPriv.h"
#include "SkHalf.h"
#include "SkLinearGradient.h"
@@ -1747,7 +1747,8 @@ GrGradientEffect::RandomGradientParams::RandomGradientParams(SkRandom* random) {
if (fUseColors4f) {
fColorSpace = GrTest::TestColorSpace(random);
if (fColorSpace) {
- fColorSpace = as_CSB(fColorSpace)->makeLinearGamma();
+ SkASSERT(SkColorSpace_Base::Type::kXYZ == as_CSB(fColorSpace)->type());
+ fColorSpace = static_cast<SkColorSpace_XYZ*>(fColorSpace.get())->makeLinearGamma();
}
}