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

Side by Side Diff: gm/gamut.cpp

Issue 2319293002: Rename SkColorSpace::GammaNamed to SkColorSpace::RenderTargetGamma (Closed)
Patch Set: Keep compatible with Chrome Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « gm/color4f.cpp ('k') | include/core/SkColorSpace.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "SkSurface.h" 10 #include "SkSurface.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 0.1009296f, 0.7249378f, 0.0517813f, // * G 110 0.1009296f, 0.7249378f, 0.0517813f, // * G
111 0.1471858f, 0.0168748f, 0.7734287f, // * B 111 0.1471858f, 0.0168748f, 0.7734287f, // * B
112 }; 112 };
113 113
114 SkMatrix44 wideGamutRGB_toXYZD50(SkMatrix44::kUninitialized_Constructor); 114 SkMatrix44 wideGamutRGB_toXYZD50(SkMatrix44::kUninitialized_Constructor);
115 wideGamutRGB_toXYZD50.set3x3RowMajorf(gWideGamutRGB_toXYZD50); 115 wideGamutRGB_toXYZD50.set3x3RowMajorf(gWideGamutRGB_toXYZD50);
116 116
117 // Use the original canvas' color type, but account for gamma requirements 117 // Use the original canvas' color type, but account for gamma requirements
118 SkImageInfo origInfo = canvas->imageInfo(); 118 SkImageInfo origInfo = canvas->imageInfo();
119 auto srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 119 auto srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
120 auto wideCS = SkColorSpace::NewRGB(SkColorSpace::kSRGB_GammaNamed, wideGamut RGB_toXYZD50); 120 auto wideCS = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
121 wideGamutRGB_toXYZD50);
121 switch (origInfo.colorType()) { 122 switch (origInfo.colorType()) {
122 case kRGBA_8888_SkColorType: 123 case kRGBA_8888_SkColorType:
123 case kBGRA_8888_SkColorType: 124 case kBGRA_8888_SkColorType:
124 break; 125 break;
125 case kRGBA_F16_SkColorType: 126 case kRGBA_F16_SkColorType:
126 srgbCS = srgbCS->makeLinearGamma(); 127 srgbCS = srgbCS->makeLinearGamma();
127 wideCS = wideCS->makeLinearGamma(); 128 wideCS = wideCS->makeLinearGamma();
128 break; 129 break;
129 default: 130 default:
130 return; 131 return;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 renderers.push_back(new GradientCellRenderer(SK_ColorRED, SK_ColorGREEN)); 201 renderers.push_back(new GradientCellRenderer(SK_ColorRED, SK_ColorGREEN));
201 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorBLACK)); 202 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorBLACK));
202 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorWHITE)); 203 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorWHITE));
203 204
204 // Vertex colors 205 // Vertex colors
205 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorRED)); 206 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorRED));
206 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorGREEN)); 207 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorGREEN));
207 208
208 draw_gamut_grid(canvas, renderers); 209 draw_gamut_grid(canvas, renderers);
209 } 210 }
OLDNEW
« no previous file with comments | « gm/color4f.cpp ('k') | include/core/SkColorSpace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698