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

Side by Side Diff: src/core/SkColorSpace.cpp

Issue 2319293002: Rename SkColorSpace::GammaNamed to SkColorSpace::RenderTargetGamma (Closed)
Patch Set: Keep compatible with Chrome Created 4 years, 3 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 | « src/codec/SkPngCodec.cpp ('k') | tests/ColorSpaceTest.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 2016 Google Inc. 2 * Copyright 2016 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 "SkColorSpace.h" 8 #include "SkColorSpace.h"
9 #include "SkColorSpace_Base.h" 9 #include "SkColorSpace_Base.h"
10 #include "SkColorSpacePriv.h" 10 #include "SkColorSpacePriv.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 case kNonStandard_SkGammaNamed: 114 case kNonStandard_SkGammaNamed:
115 // This is not allowed. 115 // This is not allowed.
116 return nullptr; 116 return nullptr;
117 default: 117 default:
118 break; 118 break;
119 } 119 }
120 120
121 return sk_sp<SkColorSpace>(new SkColorSpace_Base(gammaNamed, toXYZD50)); 121 return sk_sp<SkColorSpace>(new SkColorSpace_Base(gammaNamed, toXYZD50));
122 } 122 }
123 123
124 sk_sp<SkColorSpace> SkColorSpace::NewRGB(GammaNamed gammaNamed, const SkMatrix44 & toXYZD50) { 124 sk_sp<SkColorSpace> SkColorSpace::NewRGB(RenderTargetGamma gamma, const SkMatrix 44& toXYZD50) {
125 switch (gammaNamed) { 125 switch (gamma) {
126 case kLinear_GammaNamed: 126 case kLinear_RenderTargetGamma:
127 return SkColorSpace_Base::NewRGB(kLinear_SkGammaNamed, toXYZD50); 127 return SkColorSpace_Base::NewRGB(kLinear_SkGammaNamed, toXYZD50);
128 case kSRGB_GammaNamed: 128 case kSRGB_RenderTargetGamma:
129 return SkColorSpace_Base::NewRGB(kSRGB_SkGammaNamed, toXYZD50); 129 return SkColorSpace_Base::NewRGB(kSRGB_SkGammaNamed, toXYZD50);
130 default: 130 default:
131 return nullptr; 131 return nullptr;
132 } 132 }
133 } 133 }
134 134
135 static SkColorSpace* gAdobeRGB; 135 static SkColorSpace* gAdobeRGB;
136 static SkColorSpace* gSRGB; 136 static SkColorSpace* gSRGB;
137 137
138 sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) { 138 sk_sp<SkColorSpace> SkColorSpace::NewNamed(Named named) {
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 return false; 421 return false;
422 } 422 }
423 423
424 // It is unlikely that we will reach this case. 424 // It is unlikely that we will reach this case.
425 sk_sp<SkData> srcData = src->serialize(); 425 sk_sp<SkData> srcData = src->serialize();
426 sk_sp<SkData> dstData = dst->serialize(); 426 sk_sp<SkData> dstData = dst->serialize();
427 return srcData->size() == dstData->size() && 427 return srcData->size() == dstData->size() &&
428 0 == memcmp(srcData->data(), dstData->data(), srcData->size() ); 428 0 == memcmp(srcData->data(), dstData->data(), srcData->size() );
429 } 429 }
430 } 430 }
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698