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

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

Issue 2605743002: Use consistent types for ICC profiles (Closed)
Patch Set: No export for static lib Created 4 years 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/graphics/ColorBehavior.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp b/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
index 67635875686d8640ce9b87e9d641c11c609650ef..2e61629145bddeb2feadc0ddfe0283c5a132fe8c 100644
--- a/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
@@ -18,9 +18,9 @@ SkColorSpace* gTargetColorSpace = nullptr;
} // namespace
// static
-void ColorBehavior::setGlobalTargetColorProfile(
- const WebVector<char>& profile) {
- if (profile.isEmpty())
+void ColorBehavior::setGlobalTargetColorSpace(
+ const sk_sp<SkColorSpace>& colorSpace) {
+ if (!colorSpace)
return;
// Take a lock around initializing and accessing the global device color
@@ -31,8 +31,9 @@ void ColorBehavior::setGlobalTargetColorProfile(
if (gTargetColorSpace)
return;
- gTargetColorSpace =
- SkColorSpace::MakeICC(profile.data(), profile.size()).release();
+ // Ensure that the color space object be leaked.
jbroman 2016/12/28 17:08:20 nit: "is leaked"?
ccameron 2016/12/28 21:52:56 It was intended to be the subjunctive ... but I'm
jbroman 2016/12/29 00:09:28 Indicative sounds better to me, but after searchin
+ gTargetColorSpace = colorSpace.get();
+ SkSafeRef(gTargetColorSpace);
// UMA statistics.
BitmapImageMetrics::countOutputGammaAndGamut(gTargetColorSpace);

Powered by Google App Engine
This is Rietveld 408576698