aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-02-06 12:59:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-07 17:00:58 +0000
commitecaaf6f1c156e5690200322fc2636380c1f63dd8 (patch)
treea08ca843e15f8d9fd14b2d45f8a7916391052940 /src/gpu
parent041f7dfc577822f1e97721a865f86a9a02660cf9 (diff)
SkColorSpace: remove named API, add gamut API
BUG=skia: Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6 Reviewed-on: https://skia-review.googlesource.com/8021 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrRenderTargetContext.cpp2
-rw-r--r--src/gpu/GrTestUtils.cpp10
-rw-r--r--src/gpu/SkGr.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 8e90b04ee5..918d8d41a9 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -89,7 +89,7 @@ GrRenderTargetContext::GrRenderTargetContext(GrContext* context,
, fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) {
if (fColorSpace) {
// sRGB sources are very common (SkColor, etc...), so we cache that gamut transformation
- auto srgbColorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named);
+ auto srgbColorSpace = SkColorSpace::MakeSRGB();
fColorXformFromSRGB = GrColorSpaceXform::Make(srgbColorSpace.get(), fColorSpace.get());
}
SkDEBUGCODE(this->validate();)
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index 35af494c9b..1d3b7756df 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -8,7 +8,7 @@
#include "GrTestUtils.h"
#include "GrProcessorUnitTest.h"
#include "GrStyle.h"
-#include "SkColorSpace.h"
+#include "SkColorSpace_Base.h"
#include "SkDashPathPriv.h"
#include "SkMatrix.h"
#include "SkPath.h"
@@ -299,8 +299,8 @@ sk_sp<SkColorSpace> TestColorSpace(SkRandom* random) {
// No color space (legacy mode)
gColorSpaces[0] = nullptr;
// sRGB or Adobe
- gColorSpaces[1] = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named);
- gColorSpaces[2] = SkColorSpace::MakeNamed(SkColorSpace::kAdobeRGB_Named);
+ gColorSpaces[1] = SkColorSpace::MakeSRGB();
+ gColorSpaces[2] = SkColorSpace_Base::MakeNamed(SkColorSpace_Base::kAdobeRGB_Named);
}
return gColorSpaces[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gColorSpaces)))];
}
@@ -310,8 +310,8 @@ sk_sp<GrColorSpaceXform> TestColorXform(SkRandom* random) {
static bool gOnce;
if (!gOnce) {
gOnce = true;
- sk_sp<SkColorSpace> srgb = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named);
- sk_sp<SkColorSpace> adobe = SkColorSpace::MakeNamed(SkColorSpace::kAdobeRGB_Named);
+ sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
+ sk_sp<SkColorSpace> adobe = SkColorSpace_Base::MakeNamed(SkColorSpace_Base::kAdobeRGB_Named);
// No gamut change
gXforms[0] = nullptr;
// To larger gamut
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index ad43eef76d..0dbe57758b 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -303,7 +303,7 @@ GrColor4f SkColorToPremulGrColor4f(SkColor c, SkColorSpace* dstColorSpace) {
GrColor4f SkColorToUnpremulGrColor4f(SkColor c, SkColorSpace* dstColorSpace) {
if (dstColorSpace) {
- auto srgbColorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named);
+ auto srgbColorSpace = SkColorSpace::MakeSRGB();
auto gamutXform = GrColorSpaceXform::Make(srgbColorSpace.get(), dstColorSpace);
return SkColorToUnpremulGrColor4f(c, true, gamutXform.get());
} else {