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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp

Issue 2503973002: Add image color space histograms (Closed)
Patch Set: Created 4 years, 1 month 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
Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
index 327db4bc499b48345e2c0633a66afe98dcc50e4a..9f3b51f239e362b394ac74771e2071e65234e7c6 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
@@ -174,6 +174,11 @@ ImageFrame* ImageDecoder::frameBufferAtIndex(size_t index) {
PlatformInstrumentation::didDecodeImage();
}
+ if (!m_hasHistogrammedColorSpace) {
+ BitmapImageMetrics::countImageGamma(m_embeddedColorSpace.get());
+ m_hasHistogrammedColorSpace = true;
+ }
+
frame->notifyBitmapIfPixelsChanged();
return frame;
}
@@ -355,7 +360,7 @@ void ImageDecoder::setTargetColorProfile(const WebVector<char>& profile) {
SkColorSpace::MakeICC(profile.data(), profile.size()).release();
// UMA statistics.
- BitmapImageMetrics::countGamma(gTargetColorSpace);
+ BitmapImageMetrics::countOutputGamma(gTargetColorSpace);
}
sk_sp<SkColorSpace> ImageDecoder::colorSpace() const {
@@ -382,6 +387,7 @@ void ImageDecoder::setColorProfileAndComputeTransform(const char* iccData,
void ImageDecoder::setColorSpaceAndComputeTransform(
sk_sp<SkColorSpace> colorSpace) {
DCHECK(!m_ignoreColorSpace);
+ DCHECK(!m_hasHistogrammedColorSpace);
m_embeddedColorSpace = colorSpace;
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698