Since skia is currently requiring the dst to be opaque for lcd draws this
change is safe to make in terms of correctly. It will also be faster than
the current shader based blending.
Bug: chromium:725879
Change-Id: I0c14b80eb5ab819500afc55030df83d5ddbef94a
Reviewed-on: https://skia-review.googlesource.com/17840
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is similar to copyToAndReset().
Also use this in SkPDF, for minor memory savings:
Single-threaded DM's peak RSS drops from 239MB
to 228MB.
Change-Id: I352a980e6dd54eb05d74cd057bd50e02312753b0
Reviewed-on: https://skia-review.googlesource.com/17714
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This helps make srgb triage easier.
Change-Id: Id9cf0568f28de94d4485ba4ccb6d3235d32373a3
Reviewed-on: https://skia-review.googlesource.com/17839
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Change-Id: I6a8cee08248462e4e17196028758dd8d44093b28
Reviewed-on: https://skia-review.googlesource.com/17831
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Call overhead does appear to be showing up on our profiles.
Change-Id: If3875a8972769f45282e0eb1d4aef6324cd56878
Reviewed-on: https://skia-review.googlesource.com/17833
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
The SKP repository was updated in skbug.com/6666
The CT bots are:
* Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-CT_BENCH_1k_SKPs
* Perf-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-CT_BENCH_1k_SKPs
* Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_100k_SKPs
* Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_IMG_DECODE_100k_SKPs
* Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-CT_DM_1m_SKPs
BUG=skia:6676
Change-Id: I625e6a3947bb6c3f377c19dd0dc55b417842ca5b
Reviewed-on: https://skia-review.googlesource.com/17821
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
In some samples (whose frame time is really really small),
the fps number jumps so fast that I can hardly see even
the first digit of the number. This problem will become
more severe for threaded backend which substantially lowers
the frame time. Taking an average over a long time would
give me a much more stable fps number.
Bug: skia:
Change-Id: Ie6052b4735d9410d5e644331bf025b5bf9f40323
Reviewed-on: https://skia-review.googlesource.com/17823
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Bug: skia:6673
Change-Id: Ia2bae4f6a9039a007a10b6b45bcf2f0854bf6e5c
Reviewed-on: https://skia-review.googlesource.com/17794
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Since we cache the cipd files in isolate to save a lot of speed on RPIs,
it is no longer necessary to stop compressing our cipd packages.
It only saved us a few seconds on extracting anyway, which is now likely
lost because of the extra download times.
(https://skia-review.googlesource.com/c/16490)
Bug: skia:
NOTRY=true
Change-Id: Ib9b1a29088cddc8790a685935995b0fce07d864f
Reviewed-on: https://skia-review.googlesource.com/17799
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Very new versions of Clang (5.0 TOT) call out this problem.
Bug: skia:
Change-Id: If90f658f258ca52ebb21e2352fbf3180c41008bd
Reviewed-on: https://skia-review.googlesource.com/17795
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
We special case N32, but need to also handle f16
Change-Id: I0d6061d55e55c5952c740255e4600366d8d77919
Reviewed-on: https://skia-review.googlesource.com/17786
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This reverts commit a9e795eab5.
Bug: skia:
Change-Id: Ibfc51497ae99f332f8f72a799393a1b2996f7f3f
Reviewed-on: https://skia-review.googlesource.com/17767
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:6655
Change-Id: I1431fb5bcf955dd32c15dad9d24a6a7a7aa626f0
Reviewed-on: https://skia-review.googlesource.com/17788
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This also fixes a bug where CQ keywords were added multiple times because it was
looking for them in the wrong place (new_description_lines instead of the footers).
Bug: skia:6667
Change-Id: I91232297343145884b3fe7c2e923373679cf029e
Reviewed-on: https://skia-review.googlesource.com/17704
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Bug: skia:5526
Change-Id: I12bd44c7dabd72f215a34ce9e733bb7a29d3fc68
Reviewed-on: https://skia-review.googlesource.com/17763
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
We were setting a flag meant for Mesh.fFlags on the Op's fFlags. Switch
the Mesh's flags to be a pair of bools, to avoid this in the future.
Bug: skia:
Change-Id: Ib660f3bc9c54874d088a85251f629758c365c8c6
Reviewed-on: https://skia-review.googlesource.com/17766
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This creates a temporary SkCanvas, which needs to be wrapped in a color
xform canvas to behave appropriately.
bug:725372
Change-Id: I572437770f271b7fb813519c0966cd3177b9eeaf
Reviewed-on: https://skia-review.googlesource.com/17658
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Christopher Cameron <ccameron@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Prior to 557fbbe05b, if there was a
colorXform, we told libwebp to decode to unpremul, since
premultiplication is handled by the colorXform. In that CL, I handled
this in the case where the dst color type was not 8888 or when blending
with the prior frame, but not in the 8888/not blending with the prior
frame case.
Rearrange the code so we always tell libwebp to use BGRA_8888 unpremul
if there is a colorXform.
Change-Id: Ie1121bc65da6520af895e8eb72d53573426b7bd6
Reviewed-on: https://skia-review.googlesource.com/17781
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Bug: skia:
Change-Id: I75804136195fdddffd6498660e8f96e0580f7cd8
Reviewed-on: https://skia-review.googlesource.com/17780
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Same GM diffs as the last attempt in 8888.
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android,Test-Win2k8-MSVC-GCE-CPU-AVX2-x86-Release,Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android
BUG=chromium:720105
Still looking at why readpixels and readpixelspicture are so weird
(lots of black) when drawing into sRGB 8888. Will follow up.
Change-Id: I223e3b74e567aea1acaffa8db6b24fbf22d98c97
Reviewed-on: https://skia-review.googlesource.com/17443
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
This reverts commit 45e5068a6d.
Reason for revert: :'(
Original change's description:
> Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation.
>
> Bug: chromium:656320
>
> Change-Id: I940bfa24540516ab83a2ed52f761b96eb6ad19f1
> Reviewed-on: https://skia-review.googlesource.com/17391
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: chromium:656320
Change-Id: I8a4f71537e45f3c4cf37b10b2dc8ee38fe6959ba
Reviewed-on: https://skia-review.googlesource.com/17765
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 5373609d90.
Reason for revert: doesn't look like we'll need this.
Original change's description:
> add knob to turn off fancy SkJumper features
>
> This is a new public API for testing (layout tests).
>
> Change-Id: I10345231bad373c741b1e9656e546000538121b3
> Reviewed-on: https://skia-review.googlesource.com/17712
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>
Change-Id: Ieed2576d7fc06528384b7476508610e0e29b894f
Reviewed-on: https://skia-review.googlesource.com/17719
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Bug: skia:
Change-Id: I4f7656badf1b2faec6ed02687e8e0ff2b4daf7f4
Reviewed-on: https://skia-review.googlesource.com/17718
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Change-Id: I889a3f508407178c457f675c321880d869caf9ea
Reviewed-on: https://skia-review.googlesource.com/17717
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This avoids a problem where passing a uniform array as a function
array sometimes gets lost.
Instead of passing the uniform array as an argument to the
transfer function evaluation function, create two separate
transfer function evaluation functions that read the uniforms
directly.
BUG=723133
Change-Id: Ib46b99efdbc04ce0201644ebbc1dfd4cb27e9276
Reviewed-on: https://skia-review.googlesource.com/17293
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This lets the compiler generate AVX versions with wider writes.
Change-Id: Ia63825e70c72bdb4d14bef97d8b4ea4be54c9d84
Reviewed-on: https://skia-review.googlesource.com/17715
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This is a new public API for testing (layout tests).
Change-Id: I10345231bad373c741b1e9656e546000538121b3
Reviewed-on: https://skia-review.googlesource.com/17712
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Key work is to correctly convert SkColor corners into linear floats,
then interpolate, then (correctly) convert back to SkColors.
Bug: skia:6659
Change-Id: Iaf0ab842d7a4f8f3481e609903cec83814e5a749
Reviewed-on: https://skia-review.googlesource.com/17533
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
TBR=reed@google.com
(No change to the public API, but changed a header file)
SkWebpCodec:
- Implement onGetFrameCount, onGetFrameInfo, and onGetRepetitionCount
- Respect the alpha reported by libwebp. Although the spec states that
it is only a hint, the libwebp encoder uses it properly. Respecting
allows us to draw opaque images faster and decode them to 565. This
also matches other SkCodecs (and Chromium).
- onGetPixels:
- Decode the frame requested, recursively decoding required frame if
necessary
- When blending with a prior frame, use SkRasterPipeline
SkCodec:
- Move check for negative index to getFrameInfo
- Reset the colorXform if one is not needed
SkCodecAnimation:
- Add new blend enum, for WebP's (and APNG's) non-blending option
SkFrameHolder:
- New base classes for frames and the owner of the frames, allowing
code sharing between SkWebpCodec and SkGifCodec (particularly for
determining whether a frame has alpha and what frame it depends on)
- When moving items from SkGIFFrameContext, use Skia conventions (i.e.
int instead of unsigned)
- Rename "delay time" to "duration", to match e.g. SkFrameInfo::
fDuration
SkGifImageReader:
- Move pieces to SkFrameHolder, and adapt to changes made in the
process
- Make setAlphaAndRequiredFrame (now on the base class SkFrameHolder)
more general to support webp, and add support for frames that do not
blend
- Change SkGIFFrameContext from a struct to a class, to match how we
use the distinction elsewhere (i.e. struct is a small object with
public fields)
- Rework hasTransparentPixel (now hasTransparency, since it returns true
in some cases where there is not a transparent pixel) to better fit
with the modified setAlphaAndRequiredFrame. Also be more consistent
when there is no transparent pixel but no color map.
- Simplify an if condition that was previously simplified in 2d61e717
but accidentally got reverted in a4db9be6
CodecAnimTest:
- Test new animated webp files
- Rearrange the test to more cleanly print alpha type mismatches for
the first frame
resources:
- webp-animated.webp
- animated webp from Chromium
- blendBG.webp
- new webp file using bits of webp-animated-semitransparent4.webp
from Chromium
- tests required frame and alpha when using the non-blending mode
- frames have the following properties:
- Frame 0: no alpha, fills screen
- Frame 1: alpha, fills screen
- Frame 2: no alpha, fills screen
- Frame 3: alpha, fills screen, blendBG
- Frame 4: no alpha, fills screen, blendBG
- Frame 5: alpha, blendBG
- Frame 6: covers 4, has alpha, blendBG
- also used to test decoding to 565 if the new frame data has alpha
but blends onto an opaque frame
DM.cpp:
- Test animated images to non-native 8888 and unpremul
DMSrcSink.cpp:
- Do not test non-native 8888 decodes to f16 dst
- Test unpremul decodes to f16
- Copy a frame of an animated image prior to drawing, since in unpremul
mode, the DM code will premultiply first.
Bug: skia: 3315
Change-Id: I4e55ae2ee5bc095b37a743bdcfac644be603b980
Reviewed-on: https://skia-review.googlesource.com/16707
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Calling out lrintf() is probably kind of extreme...
adding half and truncating should be just fine.
Change-Id: Ifb22c1c1a9b764be153b769aad4671ca44311255
Reviewed-on: https://skia-review.googlesource.com/17708
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Bug: skia:
Change-Id: I79d0b0707b09a3eedeeaee940d6dafbbbdbe2fe2
Reviewed-on: https://skia-review.googlesource.com/17707
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Change-Id: I84b94a19c724e2152d1eac269f425f7f0f2286f5
Reviewed-on: https://skia-review.googlesource.com/17706
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit eefa289a21.
Reason for revert: Causing failures in BitmapFactoryTest. b/38233042
Original change's description:
> sk_fgetsize to not use ftell.
>
> The previous version of sk_fgetsize used ftell and fseek to compute
> the size of a file. There are so many issues with this that it is called
> out by securecoding.cert.org as FIO19-C as a thing not to do. We already
> have correct code for computing the size of a file in the mmap code, so
> use that instead.
>
> Change-Id: I1d771124989d0ec1523f6d858814ee563263213a
> Reviewed-on: https://skia-review.googlesource.com/9860
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
>
TBR=bungeman@google.com,scroggo@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ie9392dde8747ae7c74ebfa00153705e316e841a2
Reviewed-on: https://skia-review.googlesource.com/17705
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
I don't think they do anything anymore after the inclusive/exclusive
refactoring.
Change-Id: I63f2e010a00953b5b6415de002bcb51ec2b73458
Reviewed-on: https://skia-review.googlesource.com/17490
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
These weren't the Valgrind problem.
Change-Id: Ic76df460cf0ce7f7ae8155d549f4e92a7f8de040
Reviewed-on: https://skia-review.googlesource.com/17701
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Bug: skia:
Change-Id: I5626e4e4277255b1c0c10f912829ac2cd2ed1a8c
Reviewed-on: https://skia-review.googlesource.com/17600
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>