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

Unified Diff: samplecode/SampleApp.cpp

Issue 1893313006: Add control of the sRGB global hack flag in SampleApp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698