| 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 12 matching lines...) Expand all Loading... |
| 23 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, decodedImageTypeHistog
ram, new EnumerationHistogram("Blink.DecodedImageType", DecodedImageTypeEnumEnd)
); | 23 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, decodedImageTypeHistog
ram, new EnumerationHistogram("Blink.DecodedImageType", DecodedImageTypeEnumEnd)
); |
| 24 decodedImageTypeHistogram.count(decodedImageType); | 24 decodedImageTypeHistogram.count(decodedImageType); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void BitmapImageMetrics::countImageOrientation(const ImageOrientationEnum orient
ation) | 27 void BitmapImageMetrics::countImageOrientation(const ImageOrientationEnum orient
ation) |
| 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) |
| 34 { |
| 35 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, gammaNamedHistogram, n
ew EnumerationHistogram("Blink.ColorSpace.Destination", GammaEnd)); |
| 36 |
| 37 if (colorSpace) { |
| 38 SkColorSpace::GammaNamed skGamma = colorSpace->gammaNamed(); |
| 39 Gamma gamma = |
| 40 (SkColorSpace::kLinear_GammaNamed == skGamma) ? GammaLinear : |
| 41 (SkColorSpace::kSRGB_GammaNamed == skGamma) ? GammaSRGB : |
| 42 (SkColorSpace::k2Dot2Curve_GammaNamed == skGamma) ? Gamma2Dot2 : |
| 43 (SkColorSpace::kNonStandard_GammaNamed == skGamma) ? GammaNonStandar
d : |
| 44 GammaFail; |
| 45 gammaNamedHistogram.count(gamma); |
| 46 } else { |
| 47 gammaNamedHistogram.count(GammaNull); |
| 48 } |
| 49 } |
| 50 |
| 33 } // namespace blink | 51 } // namespace blink |
| OLD | NEW |