Chromium Code Reviews| 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); |