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: include/core/SkImageInfo.h

Issue 2000713003: Add SkColorSpace to SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@public
Patch Set: Created 4 years, 7 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 | « include/core/SkColorSpace.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageInfo.h
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index 4b308c05d88ca736d69451f3b970c1bd71b30b12..5200734b5b249370aa54d5addfe8afb6d55caf85 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -8,6 +8,7 @@
#ifndef SkImageInfo_DEFINED
#define SkImageInfo_DEFINED
+#include "SkColorSpace.h"
#include "SkMath.h"
#include "SkRect.h"
#include "SkSize.h"
@@ -194,6 +195,11 @@ public:
return SkImageInfo(width, height, ct, at, pt);
}
+ static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at,
+ sk_sp<SkColorSpace> cs) {
+ return SkImageInfo(width, height, ct, at, kLinear_SkColorProfileType, cs);
+ }
+
/**
* Sets colortype to the native ARGB32 type.
*/
@@ -237,6 +243,7 @@ public:
SkColorType colorType() const { return fColorType; }
SkAlphaType alphaType() const { return fAlphaType; }
SkColorProfileType profileType() const { return fProfileType; }
+ sk_sp<SkColorSpace> colorSpace() const { return fColorSpace; }
herb_g 2016/05/20 21:19:13 Can we avoid including this call until we have to.
msarett 2016/05/23 18:29:36 Yes I think that's a good idea! I've added checks
bool isEmpty() const { return fWidth <= 0 || fHeight <= 0; }
@@ -322,13 +329,16 @@ private:
SkColorType fColorType;
SkAlphaType fAlphaType;
SkColorProfileType fProfileType;
+ sk_sp<SkColorSpace> fColorSpace;
- SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, SkColorProfileType pt)
+ SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, SkColorProfileType pt,
+ sk_sp<SkColorSpace> cs = nullptr)
: fWidth(width)
, fHeight(height)
, fColorType(ct)
, fAlphaType(at)
, fProfileType(pt)
+ , fColorSpace(cs)
{}
};
« no previous file with comments | « include/core/SkColorSpace.h ('k') | src/codec/SkCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698