diff options
author | Mike Klein <mtklein@chromium.org> | 2017-05-02 21:04:34 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-03 01:40:35 +0000 |
commit | 16a6144dfdbaf0f56586a7baf28d36af7f4946b4 (patch) | |
tree | ef25d2ab39fc0f883ccfde37d00623459593b411 /tools | |
parent | ad15264f9ad2aa62e1da1ab3105887503ddeb4e9 (diff) |
ok, add sRGB support
Change-Id: Ic375a593bcf67aad0d7bd0847ea6bcd0b9ac4ab6
Reviewed-on: https://skia-review.googlesource.com/15160
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ok_dsts.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/ok_dsts.cpp b/tools/ok_dsts.cpp index 20b66d5bcf..d03c95009d 100644 --- a/tools/ok_dsts.cpp +++ b/tools/ok_dsts.cpp @@ -17,6 +17,12 @@ struct SWDst : Dst { if (options("ct") == "565") { info = info.makeColorType(kRGB_565_SkColorType); } if (options("ct") == "f16") { info = info.makeColorType(kRGBA_F16_SkColorType); } + if (options("cs") == "srgb") { + auto cs = info.colorType() == kRGBA_F16_SkColorType ? SkColorSpace::MakeSRGBLinear() + : SkColorSpace::MakeSRGB(); + info = info.makeColorSpace(std::move(cs)); + } + SWDst dst; dst.info = info; return move_unique(dst); @@ -38,3 +44,14 @@ static Register _565{"565", "alias for sw:ct=565", [](Options options) { options["ct"] = "565"; return SWDst::Create(options); }}; + +static Register srgb{"srgb", "alias for sw:cs=srgb", [](Options options) { + options["cs"] = "srgb"; + return SWDst::Create(options); +}}; + +static Register f16{"f16", "alias for sw:ct=f16,cs=srgb", [](Options options) { + options["ct"] = "f16"; + options["cs"] = "srgb"; + return SWDst::Create(options); +}}; |