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

Unified Diff: samplecode/SampleApp.cpp

Issue 2267773002: Demo slides for color presentation 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
« no previous file with comments | « gm/gamma.cpp ('k') | 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 9e7e651b1c6e91400e78fa1031fdf1f00cb49110..580747eb171d8c3243ffb6a8fdb0585e68fc7c7d 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -53,7 +53,7 @@ const struct {
} gConfig[] = {
{ kN32_SkColorType, false, "L32" },
{ kN32_SkColorType, true, "S32" },
- { kRGBA_F16_SkColorType, true, "F16" },
+// { kRGBA_F16_SkColorType, true, "F16" },
};
static const char* find_config_name(const SkImageInfo& info) {
@@ -857,7 +857,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
int itemID;
itemID = fAppMenu->appendList("ColorType", "ColorType", sinkID, 0,
- gConfig[0].fName, gConfig[1].fName, gConfig[2].fName, nullptr);
+ gConfig[0].fName, gConfig[1].fName, nullptr);
fAppMenu->assignKeyEquivalentToItem(itemID, 'C');
itemID = fAppMenu->appendList("Device Type", "Device Type", sinkID, 0,
@@ -1059,6 +1059,25 @@ void SampleWindow::draw(SkCanvas* canvas) {
}
}
+ {
+ int count = canvas->save();
+ canvas->resetMatrix();
+ SkPaint p;
+ p.setTextSize(36);
+ p.setColor(0xFFFFFFFF);
+ SkPaint p2;
+ p2.setTextSize(36);
+ p2.setColor(0xFF000000);
+ if (SkImageInfoIsGammaCorrect(info())) {
+ canvas->drawText("Gamma Correct: Yes", 18, 50, 900, p);
+ canvas->drawText("Gamma Correct: Yes", 18, 50, 850, p2);
+ } else {
+ canvas->drawText("Gamma Correct: No", 17, 50, 900, p);
+ canvas->drawText("Gamma Correct: No", 17, 50, 850, p2);
+ }
+ canvas->restoreToCount(count);
+ }
+
if (fShowZoomer && !fSaveToPdf) {
showZoomer(canvas);
}
« no previous file with comments | « gm/gamma.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698