diff options
author | brianosman <brianosman@google.com> | 2016-06-16 11:10:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-16 11:10:04 -0700 |
commit | 6a61a875467646f8dbc37cfecf49e12d1f475170 (patch) | |
tree | db9b06850ce0d7f35fb9d21b14a0b1c431edb349 /tools/viewer/Viewer.cpp | |
parent | dea0340cadb759932e53416a657f5ea75fee8b5f (diff) |
Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002
Review-Url: https://codereview.chromium.org/2069173002
Diffstat (limited to 'tools/viewer/Viewer.cpp')
-rw-r--r-- | tools/viewer/Viewer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index 43697f88b8..9aec01f3ec 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -122,8 +122,8 @@ Viewer::Viewer(int argc, char** argv, void* platformData) }); fCommands.addCommand('c', "Modes", "Toggle sRGB color mode", [this]() { DisplayParams params = fWindow->getDisplayParams(); - params.fProfileType = (kLinear_SkColorProfileType == params.fProfileType) - ? kSRGB_SkColorProfileType : kLinear_SkColorProfileType; + params.fColorSpace = (nullptr == params.fColorSpace) + ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : nullptr; fWindow->setDisplayParams(params); this->updateTitle(); fWindow->inval(); @@ -266,7 +266,9 @@ Viewer::~Viewer() { void Viewer::updateTitle() { SkString title("Viewer: "); title.append(fSlides[fCurrentSlide]->getName()); - if (kSRGB_SkColorProfileType == fWindow->getDisplayParams().fProfileType) { + + // TODO: For now, any color-space on the window means sRGB + if (fWindow->getDisplayParams().fColorSpace) { title.append(" sRGB"); } title.append(kBackendTypeStrings[fBackendType]); |