Index: samplecode/SampleApp.cpp |
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp |
index b7ba6f9580f85745e5b678399cd2eea24264a9b2..9c6b0d90c71192bd2c40eaea17c2ae95e7612438 100644 |
--- a/samplecode/SampleApp.cpp |
+++ b/samplecode/SampleApp.cpp |
@@ -23,6 +23,7 @@ |
#include "SkPaintFilterCanvas.h" |
#include "SkPicture.h" |
#include "SkPictureRecorder.h" |
+#include "SkPM4fPriv.h" |
#include "SkStream.h" |
#include "SkSurface.h" |
#include "SkTemplates.h" |
@@ -935,6 +936,8 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev |
itemID = fAppMenu->appendList("ColorType", "ColorType", sinkID, 0, |
gConfig[0].fName, gConfig[1].fName, gConfig[2].fName, nullptr); |
fAppMenu->assignKeyEquivalentToItem(itemID, 'C'); |
+ itemID = fAppMenu->appendSwitch("sRGB SkColor", "sRGB SkColor", sinkID, gTreatSkColorAsSRGB); |
+ fAppMenu->assignKeyEquivalentToItem(itemID, 'S'); |
itemID = fAppMenu->appendList("Device Type", "Device Type", sinkID, 0, |
"Raster", |
@@ -1650,7 +1653,8 @@ bool SampleWindow::onEvent(const SkEvent& evt) { |
SkOSMenu::FindListIndex(evt, "Hinting", &fHintingState) || |
SkOSMenu::FindSwitchState(evt, "Clip", &fUseClip) || |
SkOSMenu::FindSwitchState(evt, "Zoomer", &fShowZoomer) || |
- SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify)) |
+ SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify) || |
+ SkOSMenu::FindSwitchState(evt, "sRGB SkColor", &gTreatSkColorAsSRGB)) |
{ |
this->inval(nullptr); |
this->updateTitle(); |
@@ -2159,6 +2163,10 @@ void SampleWindow::updateTitle() { |
title.appendf(" %s", find_config_name(this->info())); |
+ if (gTreatSkColorAsSRGB) { |
+ title.append(" sRGB"); |
+ } |
+ |
this->setTitle(title.c_str()); |
} |