diff options
author | Matt Sarett <msarett@google.com> | 2017-02-07 13:56:11 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-07 19:33:37 +0000 |
commit | 77a7a1b57c16c97f056c1e50c03bdc954947778c (patch) | |
tree | 15ffacdee0ba8b0a0c8ac244302ef10ead4f915e /tools/viewer | |
parent | 4f51aa57eaa4187696f7830ee7bdac096bc47ccc (diff) |
SkColorSpace: remove named API, add gamut API
Reland from: https://skia-review.googlesource.com/c/8021/
BUG=skia:
Change-Id: I18985f130587b15fccbc86b76b2bb5c49ba5ba8a
Reviewed-on: https://skia-review.googlesource.com/8136
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'tools/viewer')
-rw-r--r-- | tools/viewer/ImageSlide.cpp | 4 | ||||
-rw-r--r-- | tools/viewer/Viewer.cpp | 2 | ||||
-rw-r--r-- | tools/viewer/sk_app/VulkanWindowContext.cpp | 2 | ||||
-rw-r--r-- | tools/viewer/sk_app/WindowContext.cpp | 4 | ||||
-rw-r--r-- | tools/viewer/sk_app/android/GLWindowContext_android.cpp | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/tools/viewer/ImageSlide.cpp b/tools/viewer/ImageSlide.cpp index 0ffd4ea080..0b52a81ddc 100644 --- a/tools/viewer/ImageSlide.cpp +++ b/tools/viewer/ImageSlide.cpp @@ -10,7 +10,7 @@ #include "SkBitmap.h" #include "SkCodec.h" #include "SkColorSpaceXform.h" -#include "SkColorSpace.h" +#include "SkColorSpace_Base.h" #include "SkCanvas.h" #include "SkData.h" #include "SkImage.h" @@ -46,7 +46,7 @@ void ImageSlide::load(SkScalar, SkScalar) { codec->getPixels(codec->getInfo(), fOriginalBitmap.getPixels(), fOriginalBitmap.rowBytes()); SkImageInfo xformedInfo = codec->getInfo().makeColorSpace( - SkColorSpace::MakeNamed(SkColorSpace::kAdobeRGB_Named)); + SkColorSpace_Base::MakeNamed(SkColorSpace_Base::kAdobeRGB_Named)); fXformedBitmap.allocPixels(xformedInfo); codec->getPixels(xformedInfo, fXformedBitmap.getPixels(), fXformedBitmap.rowBytes()); } diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index 49a331bcf4..0b93afc2b1 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -165,7 +165,7 @@ Viewer::Viewer(int argc, char** argv, void* platformData) fCommands.addCommand('c', "Modes", "Toggle sRGB color mode", [this]() { DisplayParams params = fWindow->getDisplayParams(); params.fColorSpace = (nullptr == params.fColorSpace) - ? SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named) : nullptr; + ? SkColorSpace::MakeSRGB() : nullptr; fWindow->setDisplayParams(params); this->updateTitle(); fWindow->inval(); diff --git a/tools/viewer/sk_app/VulkanWindowContext.cpp b/tools/viewer/sk_app/VulkanWindowContext.cpp index 4802e214b4..898710f109 100644 --- a/tools/viewer/sk_app/VulkanWindowContext.cpp +++ b/tools/viewer/sk_app/VulkanWindowContext.cpp @@ -171,7 +171,7 @@ bool VulkanWindowContext::createSwapchain(int width, int height, // Pick our surface format. For now, just make sure it matches our sRGB request: VkFormat surfaceFormat = VK_FORMAT_UNDEFINED; VkColorSpaceKHR colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; - auto srgbColorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); + auto srgbColorSpace = SkColorSpace::MakeSRGB(); bool wantSRGB = srgbColorSpace == params.fColorSpace; for (uint32_t i = 0; i < surfaceFormatCount; ++i) { GrPixelConfig config; diff --git a/tools/viewer/sk_app/WindowContext.cpp b/tools/viewer/sk_app/WindowContext.cpp index 3da8dd1532..8efe9bd24a 100644 --- a/tools/viewer/sk_app/WindowContext.cpp +++ b/tools/viewer/sk_app/WindowContext.cpp @@ -43,7 +43,7 @@ sk_sp<SkSurface> WindowContext::createSurface( fWidth, fHeight, fDisplayParams.fColorType, kPremul_SkAlphaType, - forceSRGB ? SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named) + forceSRGB ? SkColorSpace::MakeSRGB() : fDisplayParams.fColorSpace ); if (this->isGpuContext()) { @@ -54,7 +54,7 @@ sk_sp<SkSurface> WindowContext::createSurface( } } else { sk_sp<SkColorSpace> colorSpace = GrPixelConfigIsSRGB(rtDesc->fConfig) - ? SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named) : nullptr; + ? SkColorSpace::MakeSRGB() : nullptr; return SkSurface::MakeFromBackendRenderTarget(fContext, *rtDesc, colorSpace, &fSurfaceProps); } diff --git a/tools/viewer/sk_app/android/GLWindowContext_android.cpp b/tools/viewer/sk_app/android/GLWindowContext_android.cpp index 9f683968c6..20a76314fd 100644 --- a/tools/viewer/sk_app/android/GLWindowContext_android.cpp +++ b/tools/viewer/sk_app/android/GLWindowContext_android.cpp @@ -102,7 +102,7 @@ void GLWindowContext_android::onInitializeContext() { EGL_NONE, }; const EGLint* windowAttribs = nullptr; - auto srgbColorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); + auto srgbColorSpace = SkColorSpace::MakeSRGB(); if (srgbColorSpace == fDisplayParams.fColorSpace && majorVersion == 1 && minorVersion >= 2) { windowAttribs = srgbWindowAttribs; } |