diff options
author | Leon Scroggins III <scroggo@google.com> | 2017-08-17 13:42:48 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-17 18:02:31 +0000 |
commit | 1dc8ecbf5fd40ce918dfd958b1eb58b5f640a0d7 (patch) | |
tree | f91c5981468416ac082c319f80cf73633b983026 /dm | |
parent | 8ab8f61c4ebe151460e02edcc2c2d8e5cdfd338e (diff) |
Stop BRD-decoding non-opaque to 565 sink
review.skia.org/34361 accidentally started attempting to decode images
with transparency to a 565 sink. BRD helpfully decodes to N32 instead,
rather than failing. We don't need to test this here, and it draws to a
565 sink, resulting in incorrect images in Gold.
Change-Id: I9585b2c0c4526e5f33667bd8f57003449e735372
Reviewed-on: https://skia-review.googlesource.com/35707
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'dm')
-rw-r--r-- | dm/DMSrcSink.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index a862969e4a..9eee2d2fd0 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -152,6 +152,13 @@ Error BRDSrc::draw(SkCanvas* canvas) const { return Error::Nonfatal(SkStringPrintf("Could not create brd for %s.", fPath.c_str())); } + if (kRGB_565_SkColorType == colorType) { + auto recommendedCT = brd->computeOutputColorType(colorType); + if (recommendedCT != colorType) { + return Error::Nonfatal("Skip decoding non-opaque to 565."); + } + } + const uint32_t width = brd->width(); const uint32_t height = brd->height(); // Visually inspecting very small output images is not necessary. |