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

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

Issue 2381553002: Move toXYZD50() to SkColorSpace_Base (Closed)
Patch Set: Rebase 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 | « src/core/SkColorSpace.cpp ('k') | src/core/SkColorSpace_Base.h » ('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 "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkColorSpace_Base.h" 9 #include "SkColorSpace_Base.h"
10 #include "SkColorSpacePriv.h" 10 #include "SkColorSpacePriv.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // Invalid input 348 // Invalid input
349 return nullptr; 349 return nullptr;
350 } 350 }
351 351
352 ColorSpaceMatch csm = kNone_ColorSpaceMatch; 352 ColorSpaceMatch csm = kNone_ColorSpaceMatch;
353 SkMatrix44 srcToDst(SkMatrix44::kUninitialized_Constructor); 353 SkMatrix44 srcToDst(SkMatrix44::kUninitialized_Constructor);
354 if (SkColorSpace::Equals(srcSpace, dstSpace)) { 354 if (SkColorSpace::Equals(srcSpace, dstSpace)) {
355 srcToDst.setIdentity(); 355 srcToDst.setIdentity();
356 csm = kFull_ColorSpaceMatch; 356 csm = kFull_ColorSpaceMatch;
357 } else { 357 } else {
358 srcToDst.setConcat(as_CSB(dstSpace)->fromXYZD50(), srcSpace->toXYZD50()) ; 358 srcToDst.setConcat(as_CSB(dstSpace)->fromXYZD50(), as_CSB(srcSpace)->toX YZD50());
359 359
360 if (is_almost_identity(srcToDst)) { 360 if (is_almost_identity(srcToDst)) {
361 srcToDst.setIdentity(); 361 srcToDst.setIdentity();
362 csm = kGamut_ColorSpaceMatch; 362 csm = kGamut_ColorSpaceMatch;
363 } 363 }
364 } 364 }
365 365
366 switch (csm) { 366 switch (csm) {
367 case kNone_ColorSpaceMatch: 367 case kNone_ColorSpaceMatch:
368 switch (as_CSB(dstSpace)->gammaNamed()) { 368 switch (as_CSB(dstSpace)->gammaNamed()) {
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 } 1431 }
1432 } 1432 }
1433 1433
1434 //////////////////////////////////////////////////////////////////////////////// /////////////////// 1434 //////////////////////////////////////////////////////////////////////////////// ///////////////////
1435 1435
1436 std::unique_ptr<SkColorSpaceXform> SlowIdentityXform(SkColorSpace* space) { 1436 std::unique_ptr<SkColorSpaceXform> SlowIdentityXform(SkColorSpace* space) {
1437 return std::unique_ptr<SkColorSpaceXform>(new SkColorSpaceXform_Base 1437 return std::unique_ptr<SkColorSpaceXform>(new SkColorSpaceXform_Base
1438 <kTable_SrcGamma, kTable_DstGamma, kNone_ColorSpaceMatch> 1438 <kTable_SrcGamma, kTable_DstGamma, kNone_ColorSpaceMatch>
1439 (space, SkMatrix::I(), space)); 1439 (space, SkMatrix::I(), space));
1440 } 1440 }
OLDNEW
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | src/core/SkColorSpace_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698