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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 2389983002: Refactored SkColorSpace and added in a Lab PCS GM (Closed)
Patch Set: migrated call from SkColorSpace_Base::makeLinearGamma() to SkColorSpace_XYZ::makeLinearGamma() Created 4 years, 2 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 | « resources/icc_profiles/srgb_lab_pcs.icc ('k') | src/codec/SkJpegCodec.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"
11 #include "Resources.h" 11 #include "Resources.h"
12 #include "SampleCode.h" 12 #include "SampleCode.h"
13 #include "SkAnimTimer.h" 13 #include "SkAnimTimer.h"
14 #include "SkCanvas.h" 14 #include "SkCanvas.h"
15 #include "SkColorSpace_Base.h" 15 #include "SkColorSpace_XYZ.h"
16 #include "SkCommandLineFlags.h" 16 #include "SkCommandLineFlags.h"
17 #include "SkData.h" 17 #include "SkData.h"
18 #include "SkDocument.h" 18 #include "SkDocument.h"
19 #include "SkGammaColorFilter.h" 19 #include "SkGammaColorFilter.h"
20 #include "SkGraphics.h" 20 #include "SkGraphics.h"
21 #include "SkImage_Base.h" 21 #include "SkImage_Base.h"
22 #include "SkImageEncoder.h" 22 #include "SkImageEncoder.h"
23 #include "SkOSFile.h" 23 #include "SkOSFile.h"
24 #include "SkPaint.h" 24 #include "SkPaint.h"
25 #include "SkPaintFilterCanvas.h" 25 #include "SkPaintFilterCanvas.h"
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Name d); 1669 colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Name d);
1670 } 1670 }
1671 break; 1671 break;
1672 case kLegacy_OutputColorSpace: 1672 case kLegacy_OutputColorSpace:
1673 default: 1673 default:
1674 // Do nothing 1674 // Do nothing
1675 break; 1675 break;
1676 } 1676 }
1677 if (kRGBA_F16_SkColorType == gConfig[selected].fColorType) { 1677 if (kRGBA_F16_SkColorType == gConfig[selected].fColorType) {
1678 SkASSERT(colorSpace); 1678 SkASSERT(colorSpace);
1679 colorSpace = as_CSB(colorSpace)->makeLinearGamma(); 1679 SkASSERT(SkColorSpace_Base::Type::kXYZ == as_CSB(colorSpace)->type() );
1680 SkColorSpace_XYZ* csXYZ = static_cast<SkColorSpace_XYZ*>(colorSpace. get());
1681 colorSpace = csXYZ->makeLinearGamma();
1680 } 1682 }
1681 this->setDeviceColorType(gConfig[selected].fColorType, colorSpace); 1683 this->setDeviceColorType(gConfig[selected].fColorType, colorSpace);
1682 return true; 1684 return true;
1683 } 1685 }
1684 if (SkOSMenu::FindSwitchState(evt, "Slide Show", nullptr)) { 1686 if (SkOSMenu::FindSwitchState(evt, "Slide Show", nullptr)) {
1685 this->toggleSlideshow(); 1687 this->toggleSlideshow();
1686 return true; 1688 return true;
1687 } 1689 }
1688 if (SkOSMenu::FindTriState(evt, "AA", &fAAState) || 1690 if (SkOSMenu::FindTriState(evt, "AA", &fAAState) ||
1689 SkOSMenu::FindTriState(evt, "LCD", &fLCDState) || 1691 SkOSMenu::FindTriState(evt, "LCD", &fLCDState) ||
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 #ifdef SK_BUILD_FOR_MAC 2399 #ifdef SK_BUILD_FOR_MAC
2398 setenv("ANDROID_ROOT", "/android/device/data", 0); 2400 setenv("ANDROID_ROOT", "/android/device/data", 0);
2399 #endif 2401 #endif
2400 SkGraphics::Init(); 2402 SkGraphics::Init();
2401 SkEvent::Init(); 2403 SkEvent::Init();
2402 } 2404 }
2403 2405
2404 void application_term() { 2406 void application_term() {
2405 SkEvent::Term(); 2407 SkEvent::Term();
2406 } 2408 }
OLDNEW
« no previous file with comments | « resources/icc_profiles/srgb_lab_pcs.icc ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698