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

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

Issue 2629723006: Add histograms for ICC profile parsing (Closed)
Patch Set: Incorporate review feedback Created 3 years, 11 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp b/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
index 81cb1eefd862696948af0bf9fe7532b0c0b4bfce..0653e51e89c9cb057a1b68d861ae514bc1181e99 100644
--- a/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
@@ -4,7 +4,9 @@
#include "platform/graphics/ColorBehavior.h"
+#include "base/metrics/histogram_macros.h"
#include "platform/graphics/BitmapImageMetrics.h"
+#include "third_party/skia/include/core/SkICC.h"
#include "wtf/SpinLock.h"
namespace blink {
@@ -32,6 +34,18 @@ void ColorBehavior::setGlobalTargetColorProfile(
if (!profile.isEmpty()) {
gTargetColorSpace =
SkColorSpace::MakeICC(profile.data(), profile.size()).release();
+ sk_sp<SkICC> skICC = SkICC::Make(profile.data(), profile.size());
+ if (skICC) {
+ SkMatrix44 toXYZD50;
+ bool toXYZD50Result = skICC->toXYZD50(&toXYZD50);
+ UMA_HISTOGRAM_BOOLEAN("Blink.ColorSpace.Destination.Matrix",
+ toXYZD50Result);
+
+ SkColorSpaceTransferFn fn;
+ bool isNumericalTransferFnResult = skICC->isNumericalTransferFn(&fn);
+ UMA_HISTOGRAM_BOOLEAN("Blink.ColorSpace.Destination.Numerical",
+ isNumericalTransferFnResult);
+ }
}
// If we do not succeed, assume sRGB.
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698