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

Unified Diff: src/core/SkColorSpace.cpp

Issue 2188633003: Expose more gamma info for UMA statistics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Track invalid gamma as well Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkColorSpace.h ('k') | src/core/SkColorSpace_ICC.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpace.cpp
diff --git a/src/core/SkColorSpace.cpp b/src/core/SkColorSpace.cpp
index ba278dfcd69d81bde8235f0e392f96c7c67a14f8..fda9aa901b7293b4047bad3ee432e2242238b297 100644
--- a/src/core/SkColorSpace.cpp
+++ b/src/core/SkColorSpace.cpp
@@ -304,3 +304,41 @@ sk_sp<SkColorSpace> SkColorSpace::Deserialize(const void* data, size_t length) {
return NewICC(data, profileSize);
}
+
+bool SkColorSpace::gammasAreMatching() const {
+ const SkGammas* gammas = as_CSB(this)->gammas();
+ SkASSERT(gammas);
+ return gammas->fRedData == gammas->fGreenData && gammas->fGreenData == gammas->fBlueData;
+}
+
+bool SkColorSpace::gammasAreNamed() const {
+ const SkGammas* gammas = as_CSB(this)->gammas();
+ SkASSERT(gammas);
+ return gammas->fRedType == SkGammas::Type::kNamed_Type &&
+ gammas->fGreenType == SkGammas::Type::kNamed_Type &&
+ gammas->fBlueType == SkGammas::Type::kNamed_Type;
+}
+
+bool SkColorSpace::gammasAreValues() const {
+ const SkGammas* gammas = as_CSB(this)->gammas();
+ SkASSERT(gammas);
+ return gammas->fRedType == SkGammas::Type::kValue_Type &&
+ gammas->fGreenType == SkGammas::Type::kValue_Type &&
+ gammas->fBlueType == SkGammas::Type::kValue_Type;
+}
+
+bool SkColorSpace::gammasAreTables() const {
+ const SkGammas* gammas = as_CSB(this)->gammas();
+ SkASSERT(gammas);
+ return gammas->fRedType == SkGammas::Type::kTable_Type &&
+ gammas->fGreenType == SkGammas::Type::kTable_Type &&
+ gammas->fBlueType == SkGammas::Type::kTable_Type;
+}
+
+bool SkColorSpace::gammasAreParams() const {
+ const SkGammas* gammas = as_CSB(this)->gammas();
+ SkASSERT(gammas);
+ return gammas->fRedType == SkGammas::Type::kParam_Type &&
+ gammas->fGreenType == SkGammas::Type::kParam_Type &&
+ gammas->fBlueType == SkGammas::Type::kParam_Type;
+}
« no previous file with comments | « include/core/SkColorSpace.h ('k') | src/core/SkColorSpace_ICC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698