OLD | NEW |
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 Loading... |
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 } | |
OLD | NEW |