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

Unified Diff: ui/gfx/color_space.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
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp ('k') | ui/gfx/color_space.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_space.h
diff --git a/ui/gfx/color_space.h b/ui/gfx/color_space.h
index 1f12b0a810e7c847ababf144d8e3d47bd83a8aad..c7792cbbf85f41ce52103d9d538d0152082149fd 100644
--- a/ui/gfx/color_space.h
+++ b/ui/gfx/color_space.h
@@ -50,6 +50,7 @@ class GFX_EXPORT ColorSpace {
// Chrome-specific values start at 1000.
UNKNOWN = 1000,
XYZ_D50,
+ ADOBE_RGB,
CUSTOM,
LAST = CUSTOM
};
@@ -139,6 +140,7 @@ class GFX_EXPORT ColorSpace {
};
ColorSpace();
+ ColorSpace(PrimaryID primaries, TransferID transfer);
ColorSpace(PrimaryID primaries,
TransferID transfer,
MatrixID matrix,
@@ -151,6 +153,9 @@ class GFX_EXPORT ColorSpace {
static TransferID TransferIDFromInt(int transfer_id);
static MatrixID MatrixIDFromInt(int matrix_id);
+ // Returns true if this is not the default-constructor object.
+ bool IsValid() const;
+
static ColorSpace CreateSRGB();
static ColorSpace CreateCustom(const SkMatrix44& to_XYZD50,
const SkColorSpaceTransferFn& fn);
@@ -170,9 +175,9 @@ class GFX_EXPORT ColorSpace {
bool IsHDR() const;
- // Note that this may return nullptr.
+ // This will return nullptr for non-RGB spaces, spaces with non-FULL
+ // range, and unspecified spaces.
sk_sp<SkColorSpace> ToSkColorSpace() const;
- static ColorSpace FromSkColorSpace(const sk_sp<SkColorSpace>& sk_color_space);
void GetPrimaryMatrix(SkMatrix44* to_XYZD50) const;
bool GetTransferFunction(SkColorSpaceTransferFn* fn) const;
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp ('k') | ui/gfx/color_space.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698