Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2792)

Unified Diff: gm/color4f.cpp

Issue 1985903002: Prepare SkColorSpace to be a public API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | src/core/SkColorSpace.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/color4f.cpp
diff --git a/gm/color4f.cpp b/gm/color4f.cpp
index 829434c2484671cdae765448a7b7c35e0dc83982..ffe9a8742d01f73e8210f93a63347e55ee0bdce0 100644
--- a/gm/color4f.cpp
+++ b/gm/color4f.cpp
@@ -95,6 +95,8 @@ DEF_SIMPLE_GM(color4shader, canvas, 1024, 260) {
// red -> blue, green -> red, blue -> green
mat.set3x3(0, 1, 0, 0, 0, 1, 1, 0, 0);
+ float linearGamma[3] = { 1.0f, 1.0f, 1.0f };
+
const SkColor4f colors[] {
{ 1, 1, 0, 0 },
{ 1, 0, 1, 0 },
@@ -109,8 +111,7 @@ DEF_SIMPLE_GM(color4shader, canvas, 1024, 260) {
sk_sp<SkShader> shaders[] {
SkShader::MakeColorShader(c4, nullptr),
SkShader::MakeColorShader(c4, SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named)),
- SkShader::MakeColorShader(c4, SkColorSpace::NewRGB(SkColorSpace::SkGammas(1, 1, 1),
- mat)),
+ SkShader::MakeColorShader(c4, SkColorSpace::NewRGB(linearGamma, mat)),
};
canvas->save();
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | src/core/SkColorSpace.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698