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

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

Issue 2319073002: Add gammaIsLinear() API to SkColorSpace (Closed)
Patch Set: 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 | « include/core/SkColorSpace.h ('k') | no next file » | 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 return false; 400 return false;
401 } 401 }
402 402
403 // It is unlikely that we will reach this case. 403 // It is unlikely that we will reach this case.
404 sk_sp<SkData> srcData = src->serialize(); 404 sk_sp<SkData> srcData = src->serialize();
405 sk_sp<SkData> dstData = dst->serialize(); 405 sk_sp<SkData> dstData = dst->serialize();
406 return srcData->size() == dstData->size() && 406 return srcData->size() == dstData->size() &&
407 0 == memcmp(srcData->data(), dstData->data(), srcData->size() ); 407 0 == memcmp(srcData->data(), dstData->data(), srcData->size() );
408 } 408 }
409 } 409 }
410
411 bool SkColorSpace::gammasAreMatching() const {
412 const SkGammas* gammas = as_CSB(this)->gammas();
413 SkASSERT(gammas);
414 return gammas->fRedType == gammas->fGreenType && gammas->fGreenType == gamma s->fBlueType &&
415 gammas->fRedData == gammas->fGreenData && gammas->fGreenData == gamma s->fBlueData;
416 }
417
418 bool SkColorSpace::gammasAreNamed() const {
419 const SkGammas* gammas = as_CSB(this)->gammas();
420 SkASSERT(gammas);
421 return gammas->fRedType == SkGammas::Type::kNamed_Type &&
422 gammas->fGreenType == SkGammas::Type::kNamed_Type &&
423 gammas->fBlueType == SkGammas::Type::kNamed_Type;
424 }
425
426 bool SkColorSpace::gammasAreValues() const {
427 const SkGammas* gammas = as_CSB(this)->gammas();
428 SkASSERT(gammas);
429 return gammas->fRedType == SkGammas::Type::kValue_Type &&
430 gammas->fGreenType == SkGammas::Type::kValue_Type &&
431 gammas->fBlueType == SkGammas::Type::kValue_Type;
432 }
433
434 bool SkColorSpace::gammasAreTables() const {
435 const SkGammas* gammas = as_CSB(this)->gammas();
436 SkASSERT(gammas);
437 return gammas->fRedType == SkGammas::Type::kTable_Type &&
438 gammas->fGreenType == SkGammas::Type::kTable_Type &&
439 gammas->fBlueType == SkGammas::Type::kTable_Type;
440 }
441
442 bool SkColorSpace::gammasAreParams() const {
443 const SkGammas* gammas = as_CSB(this)->gammas();
444 SkASSERT(gammas);
445 return gammas->fRedType == SkGammas::Type::kParam_Type &&
446 gammas->fGreenType == SkGammas::Type::kParam_Type &&
447 gammas->fBlueType == SkGammas::Type::kParam_Type;
448 }
OLDNEW
« no previous file with comments | « include/core/SkColorSpace.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698