aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-06-16 11:10:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-16 11:10:04 -0700
commit6a61a875467646f8dbc37cfecf49e12d1f475170 (patch)
treedb9b06850ce0d7f35fb9d21b14a0b1c431edb349 /include/core
parentdea0340cadb759932e53416a657f5ea75fee8b5f (diff)
Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002 Review-Url: https://codereview.chromium.org/2069173002
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkBitmap.h1
-rw-r--r--include/core/SkImageInfo.h8
-rw-r--r--include/core/SkPixelRef.h2
3 files changed, 7 insertions, 4 deletions
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h
index 664686619f..b28eca817e 100644
--- a/include/core/SkBitmap.h
+++ b/include/core/SkBitmap.h
@@ -85,6 +85,7 @@ public:
int height() const { return fInfo.height(); }
SkColorType colorType() const { return fInfo.colorType(); }
SkAlphaType alphaType() const { return fInfo.alphaType(); }
+ SkColorSpace* colorSpace() const { return fInfo.colorSpace(); }
SkColorProfileType profileType() const { return fInfo.profileType(); }
/**
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index c0e0be13f9..f7a619f9ea 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -379,12 +379,14 @@ private:
///////////////////////////////////////////////////////////////////////////////
-static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfileType pt) {
- return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct;
+static inline bool SkColorAndColorSpaceAreGammaCorrect(SkColorType ct, SkColorSpace* cs) {
+ // Anything with a color-space attached is gamma-correct, as is F16.
+ // To get legacy behavior, you need to ask for non-F16, with a nullptr color space.
+ return (cs != nullptr) || kRGBA_F16_SkColorType == ct;
}
static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) {
- return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType());
+ return SkColorAndColorSpaceAreGammaCorrect(info.colorType(), info.colorSpace());
}
#endif
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 90e0de540d..da85863bdb 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -248,7 +248,7 @@ public:
* not be created with the given config), or this PixelRef does not support deep
* copies.
*/
- virtual SkPixelRef* deepCopy(SkColorType, SkColorProfileType, const SkIRect* /*subset*/) {
+ virtual SkPixelRef* deepCopy(SkColorType, SkColorSpace*, const SkIRect* /*subset*/) {
return NULL;
}