Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/BitmapImageMetrics.h" | 5 #include "platform/graphics/BitmapImageMetrics.h" |
| 6 | 6 |
| 7 #include "platform/Histogram.h" | 7 #include "platform/Histogram.h" |
| 8 #include "wtf/Threading.h" | 8 #include "wtf/Threading.h" |
| 9 #include "wtf/text/WTFString.h" | 9 #include "wtf/text/WTFString.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, orientationHistogram, new EnumerationHistogram("Blink.DecodedImage.Orientation", ImageOrientationEnumE nd)); | 29 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, orientationHistogram, new EnumerationHistogram("Blink.DecodedImage.Orientation", ImageOrientationEnumE nd)); |
| 30 orientationHistogram.count(orientation); | 30 orientationHistogram.count(orientation); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void BitmapImageMetrics::countGamma(SkColorSpace* colorSpace) | 33 void BitmapImageMetrics::countGamma(SkColorSpace* colorSpace) |
| 34 { | 34 { |
| 35 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, gammaNamedHistogram, n ew EnumerationHistogram("Blink.ColorSpace.Destination", GammaEnd)); | 35 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, gammaNamedHistogram, n ew EnumerationHistogram("Blink.ColorSpace.Destination", GammaEnd)); |
| 36 | 36 |
| 37 if (colorSpace) { | 37 if (colorSpace) { |
| 38 SkColorSpace::GammaNamed skGamma = colorSpace->gammaNamed(); | 38 SkColorSpace::GammaNamed skGamma = colorSpace->gammaNamed(); |
| 39 Gamma gamma = | 39 |
| 40 (SkColorSpace::kLinear_GammaNamed == skGamma) ? GammaLinear : | 40 Gamma gamma; |
| 41 (SkColorSpace::kSRGB_GammaNamed == skGamma) ? GammaSRGB : | 41 if (SkColorSpace::kLinear_GammaNamed == skGamma) { |
|
f(malita)
2016/07/27 20:56:44
Nit: it's a matter a taste (so feel free to ignore
msarett
2016/07/27 21:05:17
Yes agreed! I think that looks better.
| |
| 42 (SkColorSpace::k2Dot2Curve_GammaNamed == skGamma) ? Gamma2Dot2 : | 42 gamma = GammaLinear; |
| 43 (SkColorSpace::kNonStandard_GammaNamed == skGamma) ? GammaNonStandar d : | 43 } else if (SkColorSpace::kSRGB_GammaNamed == skGamma) { |
| 44 GammaFail; | 44 gamma = GammaSRGB; |
| 45 } else if (SkColorSpace::k2Dot2Curve_GammaNamed == skGamma) { | |
| 46 gamma = Gamma2Dot2; | |
| 47 } else if (SkColorSpace::kInvalid_GammaNamed == skGamma) { | |
|
f(malita)
2016/07/27 20:46:42
Does this depend on a Skia CL? I can't find SkColo
| |
| 48 gamma = GammaInvalid; | |
| 49 } else { | |
| 50 if (colorSpace->gammasAreMatching()) { | |
| 51 if (colorSpace->gammasAreValues()) { | |
| 52 gamma = GammaExponent; | |
| 53 } else if (colorSpace->gammasAreParams()) { | |
| 54 gamma = GammaParametric; | |
| 55 } else if (colorSpace->gammasAreTables()) { | |
| 56 gamma = GammaTable; | |
| 57 } else if (colorSpace->gammasAreNamed()) { | |
| 58 gamma = GammaNamed; | |
| 59 } else { | |
| 60 gamma = GammaFail; | |
| 61 } | |
| 62 } else { | |
| 63 gamma = GammaNonStandard; | |
| 64 } | |
| 65 } | |
| 66 | |
| 45 gammaNamedHistogram.count(gamma); | 67 gammaNamedHistogram.count(gamma); |
| 46 } else { | 68 } else { |
| 47 gammaNamedHistogram.count(GammaNull); | 69 gammaNamedHistogram.count(GammaNull); |
| 48 } | 70 } |
| 49 } | 71 } |
| 50 | 72 |
| 51 } // namespace blink | 73 } // namespace blink |
| OLD | NEW |