Bug: chromium:897031
Bug: chromium:896776
Prior to this fix, we would treat the output from such a JPEG
as if it were a 16 bit per component RGB PNG. We hit an assert
in debug, but in release mode we do the wrong thing.
Split up SkSwizzler::CreateSwizzler into two public factories
(and a private one) based on whether format conversion is desired.
Without format conversion, we may have already converted (as is
the case with this JPEG), so the SkEncodedInfo::Color is not relevant.
That flavor of the factory just needs to know the bytes per pixel,
so provide that info instead.
Add a test file to Google Storage: apron.jpg, from Chromium's
benchmark files.
Change-Id: If1337d58a508466299f9e4666778727c6cdc879a
Reviewed-on: https://skia-review.googlesource.com/c/164619
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
- Initialize rowsDecoded in SkSampledCodec. Otherwise,
fillIncompleteImage may be called with an uninitialized
value. This change was originally uploaded to AOSP as
https://android-review.googlesource.com/c/platform/external/skia/+/785816
- If SkPngCodec hits an error, still transform from the
interlace buffer (if needed) and set rowsDecoded properly.
- Do not copy uninitialized memory from the interlace buffer.
- Make BRD treat kErrorInInput like kIncompleteInput. The two errors
are different for the purposes of incremental decode. For a direct
decode, they're essentially the same - part was decoded, but then
the decode was interrupted. This allows testing images with
errors on the bots without reporting a failure.
- Add some images to test incomplete pngs
- errorInInput.png: color_wheel.png truncated with extra 0s at the
end to trigger kErrorInInput
- incInterlaced.png: basi3p02.png (from PNGSuite) similarly modified.
This triggers kIncompleteInput. We have several incomplete PNGs that
we are testing on the bots, but this is the first interlaced
- errorInInputInterlaced.png: This is the same as incInterlaced with
more zeroes at the end. The incorrect CRC (all zeroes) results in
kErrorInInput
Change-Id: I25e1ea917e1c1ca212f104cb9d70290265a51b2d
Reviewed-on: https://skia-review.googlesource.com/c/161822
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: b/70203010
From https://github.com/libjpeg-turbo/libjpeg-turbo/commit/c308d434.
This commit fixes a bug in BitmapRegionDecoder, and is the tip of tree.
Rather than using our mirror, just pull in upstream directly. Move our
config files into third_party/libjpeg-turbo, so we can just DEPS to
upstream. These files are unchanged, except jconfig.h, where I added a
comment regarding arithmetic coding.
Add a test image which demonstrates the bug.
Change-Id: I00f8f961f69e407dc31ca6d15c66518aa0acbafd
Reviewed-on: https://skia-review.googlesource.com/81442
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
The old code made the wrong assumptions about premultiplication.
There are three relevant steps here for decoding a webp frame:
1 tell libwebp to decode
2 colorXform the result (sometimes)
3 blend with the prior frame (sometimes)
Rearrange the code to premultiply at the blend step, in a linear space.
If the client wants unpremul, the blend step will unpremul after.
If there is no blending, the colorXform (if any) will premultiply.
If only step 1 is necessary, let libwebp premultiply.
This fixes an animated image that has an opaque frame 0 followed by a
frame with alpha that blends with it.
Add the test image that failed (https://mathiasbynens.be/demo/animated-webp)
The prior fix is in 42bae8faa4. It did
not properly handle the colorXform when there was no blending step.
Change-Id: I2b9d265ba162eaf7e55a106c8f79341826cee0d3
Reviewed-on: https://skia-review.googlesource.com/72281
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This reverts commit 42bae8faa4.
Reason for revert: Breaking GMs. A more extensive fix is needed.
Original change's description:
> Fix webp bug compositing alpha frames on opaque
>
> select_xform_alpha is used to determine how the color transform should
> handle alpha values. In a similar way, we're using it here to determine
> whether to premultiply pixels before blending them. In this case, the
> source is unpremul, so we should be premultiplying them, but since we
> are compositing on an opaque frame, the dst must be opaque and
> select_xform_alpha returns kOpaque. As a result, we do not premultiply
> (and even hint to the transform that the pixels are opaque). Since this
> all applies to the pre-blended pixels, we should not care that the dst
> is opaque. So drop the call to select_xform_alpha and just use the alpha
> type of the source. This matches the comment on the lines above.
>
> Add the test image that failed (https://mathiasbynens.be/demo/animated-webp)
>
> Change-Id: Ibd13c1f067bdf369ce1c882d4f6057aadccfa313
> Reviewed-on: https://skia-review.googlesource.com/71560
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
TBR=mtklein@chromium.org,scroggo@google.com
Change-Id: I6f535ff9b773a93e02a0358b830291594a6e738c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/71720
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
select_xform_alpha is used to determine how the color transform should
handle alpha values. In a similar way, we're using it here to determine
whether to premultiply pixels before blending them. In this case, the
source is unpremul, so we should be premultiplying them, but since we
are compositing on an opaque frame, the dst must be opaque and
select_xform_alpha returns kOpaque. As a result, we do not premultiply
(and even hint to the transform that the pixels are opaque). Since this
all applies to the pre-blended pixels, we should not care that the dst
is opaque. So drop the call to select_xform_alpha and just use the alpha
type of the source. This matches the comment on the lines above.
Add the test image that failed (https://mathiasbynens.be/demo/animated-webp)
Change-Id: Ibd13c1f067bdf369ce1c882d4f6057aadccfa313
Reviewed-on: https://skia-review.googlesource.com/71560
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Bug: b/65290323
If a webp file is truncated such that no rows can be decoded,
WebPIDecGetRGB does not initialize its "last_y" parameter. We use
rowsDecoded (passed as last_y) to determine which remaining rows to
fill.
Check the return value of WebPIDecGetRGB. If it fails (returns null),
or rowsDecoded is <= 0 (matching Chromium's check), return
kInvalidInput, since there is nothing to draw.
Note that this is a change in behavior for Android. Previously we
would decode an empty webp to just a transparent/black rectangle,
whereas now we simply fail. I think this is a change for the better.
Add a test which truncates a file to have 0 rows available and attempts
to decode it. msan verifies that we no longer depend on the
uninitialized value.
Stop attempting to test decoding subsets from an incomplete webp (in
CodecTest.cpp). Unless we have decoded the portion covered by the
subset, this will fail.
Remove test images inc0.webp (from both dm/ and colorspace/) and
inc1.webp. These just decode to transparent rectangles. Replace them
with inc2.webp and inc3.webp, which decode part of the image and then
have to fill with transparent.
Change-Id: I64d40be91c574b45963f9a43d8dd8f4929dd2939
Reviewed-on: https://skia-review.googlesource.com/50303
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: James Zern <jzern@google.com>
Image origin: https://github.com/flutter/flutter/issues/11521
Bug: skia:
Change-Id: I5af8b155a4979c83d3dd9c0bdd15e0052c6d1f88
Reviewed-on: https://skia-review.googlesource.com/32000
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
Bug: 722855
Change-Id: Id3661be1e9747ac0de1e35b60d334ee8187a5be5
Reviewed-on: https://skia-review.googlesource.com/17312
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Bug: b/37433905
Change-Id: Ifcbee1879885c6c235d69f924846e34475804f8c
Reviewed-on: https://skia-review.googlesource.com/13770
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
Using no compression can save up to a minute of overhead on the RPIs, for
a ~10% increase in file size to download, a great tradeoff.
This commit also regenerates svg and skimage to use no compression.
The next time RecreateSKPs is run, it will pick up the no-compression.
BUG=skia:
Change-Id: I7887e0f8152548185fe095c1f05b08696ab055ec
Reviewed-on: https://skia-review.googlesource.com/9630
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
We need the swizzler to convert CMYK->RGB in some
cases where we do have a color xform.
BUG=skia:
Change-Id: Id467ad03df64368fd5a6c3bd5461566582eb492e
Reviewed-on: https://skia-review.googlesource.com/8973
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
This is just the new test images.
I'm relanding this in pieces to try to bisect a
strange MSAN error.
Original CL:
https://skia-review.googlesource.com/c/7085/
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD,Build-Ubuntu-Clang-x86_64-Release-Fast,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN
Change-Id: Iec6b8cf52134992591651bf46bd6cd67d53fad52
Reviewed-on: https://skia-review.googlesource.com/7201
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: If58d201daae97bce2f8efbc453c2ec452e682493
Reviewed-on: https://skia-review.googlesource.com/7085
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reland of Original Change:
https://skia-review.googlesource.com/6260
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I809984dd9af225103bfbe83492a17c19da7c5e40
Reviewed-on: https://skia-review.googlesource.com/6980
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
This reverts commit bb2339da39.
Reason for revert: Breaks MSAN
Original change's description:
> Use RasterPipeline to support full precision on 16-bit RGBA pngs
>
> TODO: Support more precision on 16-bit RGB pngs
>
> BUG=skia:
>
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
>
> Change-Id: I89dfef3b4887b9c4895c17309933883ab90ffa4d
> Reviewed-on: https://skia-review.googlesource.com/6260
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Matt Sarett <msarett@google.com>
>
TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,scroggo@google.com,reed@google.com,reviews@skia.org
BUG=skia:
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I47579c20af033a75883e2b35567cb9c690ce54b0
Reviewed-on: https://skia-review.googlesource.com/6975
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
TODO: Support more precision on 16-bit RGB pngs
BUG=skia:
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I89dfef3b4887b9c4895c17309933883ab90ffa4d
Reviewed-on: https://skia-review.googlesource.com/6260
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
(1) Fix subtle comparison bug so we interpolate the proper tetrahedral.
(2) Add new comments - the clamp is necessary.
(3) SkCSXformPrintf requires an extra friend class to compile.
BUG:668784
Change-Id: Id1a5c561f23ccfe25e141b8490cddee4c2482326
Reviewed-on: https://skia-review.googlesource.com/5238
Reviewed-by: Robert Aftias <raftias@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Implements color space xforms and F16 for SkRawCodec and SkWbmpCodec.
BUG=skia:4895
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4459
Change-Id: I8c72918e46387350b49a9811ce654d26b1ab352a
Reviewed-on: https://skia-review.googlesource.com/4459
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>