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