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

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

Issue 2641973002: Use gfx::ICCProfile type consistently (Closed)
Patch Set: 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
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 0653e51e89c9cb057a1b68d861ae514bc1181e99..65a560a1b30309197b0221919b7667ed94038463 100644
--- a/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
@@ -7,6 +7,7 @@
#include "base/metrics/histogram_macros.h"
#include "platform/graphics/BitmapImageMetrics.h"
#include "third_party/skia/include/core/SkICC.h"
+#include "ui/gfx/icc_profile.h"
#include "wtf/SpinLock.h"
namespace blink {
@@ -21,7 +22,7 @@ SkColorSpace* gTargetColorSpace = nullptr;
// static
void ColorBehavior::setGlobalTargetColorProfile(
- const WebVector<char>& profile) {
+ const gfx::ICCProfile& profile) {
// Take a lock around initializing and accessing the global device color
// profile.
SpinLock::Guard guard(gTargetColorSpaceLock);
@@ -31,10 +32,11 @@ void ColorBehavior::setGlobalTargetColorProfile(
return;
// Attempt to convert the ICC profile to an SkColorSpace.
- if (!profile.isEmpty()) {
+ if (!(profile == gfx::ICCProfile())) {
+ const std::vector<char>& data = profile.GetData();
gTargetColorSpace =
- SkColorSpace::MakeICC(profile.data(), profile.size()).release();
- sk_sp<SkICC> skICC = SkICC::Make(profile.data(), profile.size());
+ SkColorSpace::MakeICC(data.data(), data.size()).release();
+ sk_sp<SkICC> skICC = SkICC::Make(data.data(), data.size());
if (skICC) {
SkMatrix44 toXYZD50;
bool toXYZD50Result = skICC->toXYZD50(&toXYZD50);

Powered by Google App Engine
This is Rietveld 408576698