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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 2097003003: remove experimental treat-skcolor-as-srgb flag (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix toSkColor Created 4 years, 6 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 | « no previous file | src/core/SkColor.cpp » ('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 2011 Google Inc. 2 * Copyright 2011 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 "SampleApp.h" 8 #include "SampleApp.h"
9 9
10 #include "OverView.h" 10 #include "OverView.h"
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 fSaveToSKP = false; 827 fSaveToSKP = false;
828 828
829 int sinkID = this->getSinkID(); 829 int sinkID = this->getSinkID();
830 fAppMenu = new SkOSMenu; 830 fAppMenu = new SkOSMenu;
831 fAppMenu->setTitle("Global Settings"); 831 fAppMenu->setTitle("Global Settings");
832 int itemID; 832 int itemID;
833 833
834 itemID = fAppMenu->appendList("ColorType", "ColorType", sinkID, 0, 834 itemID = fAppMenu->appendList("ColorType", "ColorType", sinkID, 0,
835 gConfig[0].fName, gConfig[1].fName, gConfig[2] .fName, nullptr); 835 gConfig[0].fName, gConfig[1].fName, gConfig[2] .fName, nullptr);
836 fAppMenu->assignKeyEquivalentToItem(itemID, 'C'); 836 fAppMenu->assignKeyEquivalentToItem(itemID, 'C');
837 itemID = fAppMenu->appendSwitch("sRGB SkColor", "sRGB SkColor", sinkID, gTre atSkColorAsSRGB);
838 fAppMenu->assignKeyEquivalentToItem(itemID, 'S');
839 837
840 itemID = fAppMenu->appendList("Device Type", "Device Type", sinkID, 0, 838 itemID = fAppMenu->appendList("Device Type", "Device Type", sinkID, 0,
841 "Raster", 839 "Raster",
842 "OpenGL", 840 "OpenGL",
843 #if SK_ANGLE 841 #if SK_ANGLE
844 "ANGLE", 842 "ANGLE",
845 #endif 843 #endif
846 nullptr); 844 nullptr);
847 fAppMenu->assignKeyEquivalentToItem(itemID, 'd'); 845 fAppMenu->assignKeyEquivalentToItem(itemID, 'd');
848 itemID = fAppMenu->appendTriState("AA", "AA", sinkID, fAAState); 846 itemID = fAppMenu->appendTriState("AA", "AA", sinkID, fAAState);
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 this->toggleSlideshow(); 1540 this->toggleSlideshow();
1543 return true; 1541 return true;
1544 } 1542 }
1545 if (SkOSMenu::FindTriState(evt, "AA", &fAAState) || 1543 if (SkOSMenu::FindTriState(evt, "AA", &fAAState) ||
1546 SkOSMenu::FindTriState(evt, "LCD", &fLCDState) || 1544 SkOSMenu::FindTriState(evt, "LCD", &fLCDState) ||
1547 SkOSMenu::FindListIndex(evt, "FilterQuality", &fFilterQualityIndex) || 1545 SkOSMenu::FindListIndex(evt, "FilterQuality", &fFilterQualityIndex) ||
1548 SkOSMenu::FindTriState(evt, "Subpixel", &fSubpixelState) || 1546 SkOSMenu::FindTriState(evt, "Subpixel", &fSubpixelState) ||
1549 SkOSMenu::FindListIndex(evt, "Hinting", &fHintingState) || 1547 SkOSMenu::FindListIndex(evt, "Hinting", &fHintingState) ||
1550 SkOSMenu::FindSwitchState(evt, "Clip", &fUseClip) || 1548 SkOSMenu::FindSwitchState(evt, "Clip", &fUseClip) ||
1551 SkOSMenu::FindSwitchState(evt, "Zoomer", &fShowZoomer) || 1549 SkOSMenu::FindSwitchState(evt, "Zoomer", &fShowZoomer) ||
1552 SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify) || 1550 SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify))
1553 SkOSMenu::FindSwitchState(evt, "sRGB SkColor", &gTreatSkColorAsSRGB))
1554 { 1551 {
1555 this->inval(nullptr); 1552 this->inval(nullptr);
1556 this->updateTitle(); 1553 this->updateTitle();
1557 return true; 1554 return true;
1558 } 1555 }
1559 if (SkOSMenu::FindListIndex(evt, "Pixel Geometry", &fPixelGeometryIndex)) { 1556 if (SkOSMenu::FindListIndex(evt, "Pixel Geometry", &fPixelGeometryIndex)) {
1560 this->setPixelGeometry(fPixelGeometryIndex); 1557 this->setPixelGeometry(fPixelGeometryIndex);
1561 return true; 1558 return true;
1562 } 1559 }
1563 if (SkOSMenu::FindListIndex(evt, "Tiling", &fTilingMode)) { 1560 if (SkOSMenu::FindListIndex(evt, "Tiling", &fTilingMode)) {
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 fDevManager->getGrRenderTarget()->numColorSamples()); 2050 fDevManager->getGrRenderTarget()->numColorSamples());
2054 } 2051 }
2055 #endif 2052 #endif
2056 2053
2057 title.appendf(" %s", find_config_name(this->info())); 2054 title.appendf(" %s", find_config_name(this->info()));
2058 2055
2059 if (fDevManager && fDevManager->getColorBits() > 24) { 2056 if (fDevManager && fDevManager->getColorBits() > 24) {
2060 title.appendf(" %d bpc", fDevManager->getColorBits()); 2057 title.appendf(" %d bpc", fDevManager->getColorBits());
2061 } 2058 }
2062 2059
2063 if (gTreatSkColorAsSRGB) {
2064 title.append(" sRGB");
2065 }
2066
2067 this->setTitle(title.c_str()); 2060 this->setTitle(title.c_str());
2068 } 2061 }
2069 2062
2070 void SampleWindow::onSizeChange() { 2063 void SampleWindow::onSizeChange() {
2071 this->INHERITED::onSizeChange(); 2064 this->INHERITED::onSizeChange();
2072 2065
2073 SkView::F2BIter iter(this); 2066 SkView::F2BIter iter(this);
2074 SkView* view = iter.next(); 2067 SkView* view = iter.next();
2075 view->setSize(this->width(), this->height()); 2068 view->setSize(this->width(), this->height());
2076 2069
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 #ifdef SK_BUILD_FOR_MAC 2238 #ifdef SK_BUILD_FOR_MAC
2246 setenv("ANDROID_ROOT", "/android/device/data", 0); 2239 setenv("ANDROID_ROOT", "/android/device/data", 0);
2247 #endif 2240 #endif
2248 SkGraphics::Init(); 2241 SkGraphics::Init();
2249 SkEvent::Init(); 2242 SkEvent::Init();
2250 } 2243 }
2251 2244
2252 void application_term() { 2245 void application_term() {
2253 SkEvent::Term(); 2246 SkEvent::Term();
2254 } 2247 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698