diff options
author | Matt Sarett <msarett@google.com> | 2017-02-07 21:52:07 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-08 14:49:00 +0000 |
commit | f5759936865d73de3ef715ea228e7dd22eb2dfda (patch) | |
tree | d32aedf5eeea2fab54ee92a17f5957a7140baacd /src/core | |
parent | 696b29346e85307a05af47768d358161eba3f6bd (diff) |
Revert "Revert "Disallow readPixels() conversions from untagged srcs to tagged dsts""
This reverts commit 8461506c8b025522eb89cd754c63fb5dbf0cb7f1.
Reason for revert: Fixed some Chrome code, let's try this again.
Original change's description:
> Revert "Disallow readPixels() conversions from untagged srcs to tagged dsts"
>
> This reverts commit ccfd1083a7b9d546735ddd1037f3240635cce72d.
>
> Reason for revert: Roll is failing.
>
> Original change's description:
> > Disallow readPixels() conversions from untagged srcs to tagged dsts
> >
> > This might break the roll into Chrome. But let's see how.
> >
> > BUG=skia:6021
> >
> > Change-Id: I2698b5d6fe72d01bed0dc64703b592a03d441a80
> > Reviewed-on: https://skia-review.googlesource.com/7127
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Matt Sarett <msarett@google.com>
> >
>
> TBR=msarett@google.com,brianosman@google.com,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:6021
>
> Change-Id: I4b62178fd7c23f43cf69ca69fc14526ecd503956
> Reviewed-on: https://skia-review.googlesource.com/7205
> Commit-Queue: Matt Sarett <msarett@google.com>
> Reviewed-by: Matt Sarett <msarett@google.com>
>
TBR=msarett@google.com,brianosman@google.com,reed@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
BUG=skia:6021
Change-Id: I3f3f33fe6b84fbd5c537b60ed5c8b9201d529a6a
Reviewed-on: https://skia-review.googlesource.com/8156
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkImageInfoPriv.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkImageInfoPriv.h b/src/core/SkImageInfoPriv.h index 7fea296d38..a3e449a3d6 100644 --- a/src/core/SkImageInfoPriv.h +++ b/src/core/SkImageInfoPriv.h @@ -50,6 +50,8 @@ static inline bool SkImageInfoIsValid(const SkImageInfo& info) { * should we use kPremul or kUnpremul color values with the opaque alphas? Or should * we just use whatever the |src| alpha is? In the future, we could choose to clearly * define this, but currently no one is asking for this feature. + * We will not convert to a particular color space if |src| is nullptr. The color space + * conversion is not well-defined. */ static inline bool SkImageInfoValidConversion(const SkImageInfo& dst, const SkImageInfo& src) { if (!SkImageInfoIsValid(dst) || !SkImageInfoIsValid(src)) { @@ -72,5 +74,9 @@ static inline bool SkImageInfoValidConversion(const SkImageInfo& dst, const SkIm return false; } + if (dst.colorSpace() && !src.colorSpace()) { + return false; + } + return true; } |