diff options
author | scroggo <scroggo@google.com> | 2016-02-03 09:42:42 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-03 09:42:42 -0800 |
commit | c5560bef14149f4c945a4536988aeba1a16adedc (patch) | |
tree | d62cecc289bb7c0ad9083258669179a64fd87d59 /src/codec/SkPngCodec.h | |
parent | 8ca88e41aa76bc4da568936de9299ec3f8762d9c (diff) |
Support decoding opaque to *premul
If a client requests unpremul or premul from an opaque SkCodec,
support it. The opaque image can be treated as any of them, though
it will be less efficient to draw than if the client had used
opaque.
Change the filling code (i.e. for incomplete images) to base its color on
the source alpha type. Prior to adding the support to decode opaque to
any, it was fine to use either source or dest (which would have yielded
the same result). If the client requests non-opaque, we do not want this
to switch the fill value from black to transparent. This also allows
simplifying the signatures for getFillValue and onGetFillValue.
In CodexTest, expect the same result when decoding opaque to *premul,
and compare to the opaque version.
BUG=skia:4616
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1641273003
Review URL: https://codereview.chromium.org/1641273003
Diffstat (limited to 'src/codec/SkPngCodec.h')
-rw-r--r-- | src/codec/SkPngCodec.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codec/SkPngCodec.h b/src/codec/SkPngCodec.h index 9a13a12670..95fd613163 100644 --- a/src/codec/SkPngCodec.h +++ b/src/codec/SkPngCodec.h @@ -31,7 +31,7 @@ protected: override; SkEncodedFormat onGetEncodedFormat() const override { return kPNG_SkEncodedFormat; } bool onRewind() override; - uint32_t onGetFillValue(SkColorType colorType, SkAlphaType alphaType) const override; + uint32_t onGetFillValue(SkColorType) const override; // Helper to set up swizzler and color table. Also calls png_read_update_info. Result initializeSwizzler(const SkImageInfo& requestedInfo, const Options&, |