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

Unified Diff: samplecode/SampleApp.cpp

Issue 2270823002: Some tests around surface creation and snapshotting with color space (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 4 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
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 9e7e651b1c6e91400e78fa1031fdf1f00cb49110..b6b9cde06ca0d43181f2633b2e7b370f54ef5c34 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1556,9 +1556,12 @@ bool SampleWindow::onEvent(const SkEvent& evt) {
return true;
}
if (SkOSMenu::FindListIndex(evt, "ColorType", &selected)) {
- auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
+ auto colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
+ if (kRGBA_F16_SkColorType == gConfig[selected].fColorType) {
+ colorSpace = colorSpace->makeLinearGamma();
+ }
this->setDeviceColorType(gConfig[selected].fColorType,
- gConfig[selected].fSRGB ? srgbColorSpace : nullptr);
+ gConfig[selected].fSRGB ? colorSpace : nullptr);
return true;
}
if (SkOSMenu::FindSwitchState(evt, "Slide Show", nullptr)) {

Powered by Google App Engine
This is Rietveld 408576698