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 17 matching lines...) Expand all Loading... |
28 { | 28 { |
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 // TODO (msarett): Add a check for gammaIsLinear() when that API lands i
n Skia. | |
39 Gamma gamma; | 38 Gamma gamma; |
40 if (colorSpace->gammaCloseToSRGB()) { | 39 if (colorSpace->gammaCloseToSRGB()) { |
41 gamma = GammaSRGB; | 40 gamma = GammaSRGB; |
| 41 } else if (colorSpace->gammaIsLinear()) { |
| 42 gamma = GammaLinear; |
42 } else { | 43 } else { |
43 gamma = GammaNonStandard; | 44 gamma = GammaNonStandard; |
44 } | 45 } |
45 | 46 |
46 gammaNamedHistogram.count(gamma); | 47 gammaNamedHistogram.count(gamma); |
47 } else { | 48 } else { |
48 gammaNamedHistogram.count(GammaNull); | 49 gammaNamedHistogram.count(GammaNull); |
49 } | 50 } |
50 } | 51 } |
51 | 52 |
52 } // namespace blink | 53 } // namespace blink |
OLD | NEW |