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

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

Issue 2660393002: Use gfx::ColorSpace instead of SkColorSpace in Blink (Closed)
Patch Set: Rebase (again) 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.h
diff --git a/third_party/WebKit/Source/platform/graphics/ColorBehavior.h b/third_party/WebKit/Source/platform/graphics/ColorBehavior.h
index 993afb6d8a0ee5737ce24d44f4f96708fb3fa057..cc15cb3db888ce521898a4899887ee9bc54742f1 100644
--- a/third_party/WebKit/Source/platform/graphics/ColorBehavior.h
+++ b/third_party/WebKit/Source/platform/graphics/ColorBehavior.h
@@ -7,14 +7,7 @@
#include "platform/PlatformExport.h"
#include "public/platform/WebVector.h"
-#include "third_party/skia/include/core/SkColorSpace.h"
-#include "third_party/skia/include/core/SkRefCnt.h"
-
-class SkColorSpace;
-
-namespace gfx {
-class ICCProfile;
-}
+#include "ui/gfx/color_space.h"
namespace blink {
@@ -23,28 +16,24 @@ class PLATFORM_EXPORT ColorBehavior {
// This specifies to ignore color profiles embedded in images entirely. No
// transformations will be applied to any pixel data, and no SkImages will be
// tagged with an SkColorSpace.
- static inline ColorBehavior ignore() {
- return ColorBehavior(Type::Ignore, nullptr);
- }
+ static inline ColorBehavior ignore() { return ColorBehavior(Type::Ignore); }
bool isIgnore() const { return m_type == Type::Ignore; }
// This specifies that images will not be transformed (to the extent
// possible), but that SkImages will be tagged with the embedded SkColorSpace
// (or sRGB if there was no embedded color profile).
- static inline ColorBehavior tag() {
- return ColorBehavior(Type::Tag, nullptr);
- }
+ static inline ColorBehavior tag() { return ColorBehavior(Type::Tag); }
bool isTag() const { return m_type == Type::Tag; }
// This specifies that images will be transformed to the specified target
// color space, and that SkImages will not be tagged with any SkColorSpace.
- static inline ColorBehavior transformTo(sk_sp<SkColorSpace> target) {
- return ColorBehavior(Type::TransformTo, std::move(target));
+ static inline ColorBehavior transformTo(const gfx::ColorSpace& target) {
+ return ColorBehavior(Type::TransformTo, target);
}
bool isTransformToTargetColorSpace() const {
return m_type == Type::TransformTo;
}
- sk_sp<SkColorSpace> targetColorSpace() const {
+ const gfx::ColorSpace& targetColorSpace() const {
DCHECK(m_type == Type::TransformTo);
return m_target;
}
@@ -53,8 +42,8 @@ class PLATFORM_EXPORT ColorBehavior {
// profiles should be converted. Note that only the first call to this
// function in this process has any effect.
static void setGlobalTargetColorProfile(const gfx::ICCProfile&);
- static void setGlobalTargetColorSpaceForTesting(const sk_sp<SkColorSpace>&);
- static sk_sp<SkColorSpace> globalTargetColorSpace();
+ static void setGlobalTargetColorSpaceForTesting(const gfx::ColorSpace&);
+ static const gfx::ColorSpace& globalTargetColorSpace();
// Return the behavior of transforming to the color space specified above, or
// sRGB, if the above has not yet been called.
@@ -72,10 +61,11 @@ class PLATFORM_EXPORT ColorBehavior {
Tag,
TransformTo,
};
- ColorBehavior(Type type, sk_sp<SkColorSpace> target)
- : m_type(type), m_target(std::move(target)) {}
+ ColorBehavior(Type type) : m_type(type) {}
+ ColorBehavior(Type type, const gfx::ColorSpace& target)
+ : m_type(type), m_target(target) {}
Type m_type;
- sk_sp<SkColorSpace> m_target;
+ gfx::ColorSpace m_target;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698