aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-01-05 10:41:39 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-05 18:07:55 +0000
commitefcc41805b43347444b83c1705d3d60c8d0caa70 (patch)
tree705426a2eec1856364552d03c3648c319fe9e0bc /tests/ImageTest.cpp
parent08d57e6ae6510a7724119ab548485b4fcbd0a48d (diff)
Explicitly fail read/writePixels in invalid color space scenarios
It's not well defined what to do when moving from a nullptr color space to a tagged destination (drawing, reading, writing, etc...). In these scenarios, at least, we can choose to disallow the operation (rather than produce an unexpected or inconsistent result). BUG=skia: Change-Id: I033b23c6f2bb00664efc8fdab1b3f52053d77695 Reviewed-on: https://skia-review.googlesource.com/6600 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'tests/ImageTest.cpp')
-rw-r--r--tests/ImageTest.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 161dff8853..b2ac36d203 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -45,8 +45,7 @@ static void assert_equal(skiatest::Reporter* reporter, SkImage* a, const SkIRect
// see https://bug.skia.org/3965
//REPORTER_ASSERT(reporter, a->isOpaque() == b->isOpaque());
- // The codecs may have given us back F16, we can't read from F16 raster to N32, only S32.
- SkImageInfo info = SkImageInfo::MakeS32(widthA, heightA, a->alphaType());
+ SkImageInfo info = SkImageInfo::MakeN32(widthA, heightA, a->alphaType());
SkAutoPixmapStorage pmapA, pmapB;
pmapA.alloc(info);
pmapB.alloc(info);