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

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImageMetrics.cpp

Issue 2315893002: Simplify SkColorSpace DstGamma UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/BitmapImageMetrics.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImageMetrics.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImageMetrics.cpp
index 5c59c10912c4c273fa8af87091622d59a079a01a..9e505f26b5a7631a904b9790dc8c4c717f83b617 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImageMetrics.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImageMetrics.cpp
@@ -35,36 +35,12 @@ void BitmapImageMetrics::countGamma(SkColorSpace* colorSpace)
DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, gammaNamedHistogram, new EnumerationHistogram("Blink.ColorSpace.Destination", GammaEnd));
if (colorSpace) {
- SkColorSpace::GammaNamed skGamma = colorSpace->gammaNamed();
-
+ // TODO (msarett): Add a check for gammaIsLinear() when that API lands in Skia.
Gamma gamma;
- switch (skGamma) {
- case SkColorSpace::kLinear_GammaNamed:
- gamma = GammaLinear;
- break;
- case SkColorSpace::kSRGB_GammaNamed:
+ if (colorSpace->gammaCloseToSRGB()) {
gamma = GammaSRGB;
- break;
- case SkColorSpace::k2Dot2Curve_GammaNamed:
- gamma = Gamma2Dot2;
- break;
- default:
- if (colorSpace->gammasAreMatching()) {
- if (colorSpace->gammasAreValues()) {
- gamma = GammaExponent;
- } else if (colorSpace->gammasAreParams()) {
- gamma = GammaParametric;
- } else if (colorSpace->gammasAreTables()) {
- gamma = GammaTable;
- } else if (colorSpace->gammasAreNamed()) {
- gamma = GammaNamed;
- } else {
- gamma = GammaFail;
- }
- } else {
- gamma = GammaNonStandard;
- }
- break;
+ } else {
+ gamma = GammaNonStandard;
}
gammaNamedHistogram.count(gamma);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698