BUG=chromium:749147
Change-Id: I07d18e089be1138ad83bfde392c7daf2d01d388c
Reviewed-on: https://skia-review.googlesource.com/34747
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Removes the need for strdup with copied strings, paves the way for
more (and richer) payload, and shrinks the average event way down.
Bug: skia:
Change-Id: I9604fe713c34cfc877dce84563af89c579abd65b
Reviewed-on: https://skia-review.googlesource.com/35166
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Some renames, comments, and override->final
Change-Id: Iebc7aeee9a64021e958f76bf4278ffff56884a56
Reviewed-on: https://skia-review.googlesource.com/35165
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change 3b5a3fa8b1 introduced support
for out-of-range intersections, which is necessary when the top and
bottom vertices of an edge differ by only one ULP in the primary sort
order and can't be split in-order.
However, some out-of-range intersections produce edges which cancel
each other out on splitting, in particular when the intersection is
collinear with the newly-computed edge. This undoes the effect of the
split. The tessellator then rewinds, re-detects the intersection, resplits,
an infinite loop.
The fix is to check for out-of-range intersections which are also
collinear, and ignore them. This is ok, because these are not
the cases we care about it change 3b5a3f above, which are
never collinear.
Bug: 753867
Change-Id: I590231e0e6f19c98f1ccf46cb7acc8a63ba35a9d
Reviewed-on: https://skia-review.googlesource.com/34925
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This reverts commit c667dff58d.
Reason for revert: breaking the Android roll: external/skia/tests/ExceptionTest.cpp:14:9: error: cannot use 'throw' with exceptions disabled
throw 42;
^
external/skia/tests/ExceptionTest.cpp:13:5: error: cannot use 'try' with exceptions disabled
try {
^
Original change's description:
> Turn on exceptions in test tools.
>
> This allows us to test things that, e.g., throw std::bad_alloc.
>
> Change-Id: I6409159b89f1d93d403b1a1f40539cf2531a8b68
> Reviewed-on: https://skia-review.googlesource.com/34982
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
TBR=mtklein@chromium.org,herb@google.com
Change-Id: I3f9143eea694cd18d02223d4766afd34cd95aa81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/35082
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Discard fractional translation from the cache key in
GrSoftwarePathRenderer for Android framework. This improves
cache hit ratio and speeds up draw frame 50th percentile for quick
settings jank test by 0.7ms. This quality trade-off is fine and
it is matching HWUI OpenGL renderer behavior.
Bug: b/64487466
Change-Id: I865169aa2acbca80f1399da8bdd7f624f413295e
Reviewed-on: https://skia-review.googlesource.com/34900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
This reverts commit c667dff58d.
Reason for revert: temporary while I fix Android, Google3.
Original change's description:
> Turn on exceptions in test tools.
>
> This allows us to test things that, e.g., throw std::bad_alloc.
>
> Change-Id: I6409159b89f1d93d403b1a1f40539cf2531a8b68
> Reviewed-on: https://skia-review.googlesource.com/34982
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
TBR=mtklein@chromium.org,herb@google.com
Change-Id: Iafdc34c5f70f99f7df3cd0bbad65eed0828453a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/35081
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
After turning on exceptions in test tools,
iOS builds of ok started saying atoi() was not declared.
I don't even want to know.
Change-Id: I52f354a1f25ec042bf2161a4c5dd9276aa25e46a
Reviewed-on: https://skia-review.googlesource.com/34961
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This allows us to test things that, e.g., throw std::bad_alloc.
Change-Id: I6409159b89f1d93d403b1a1f40539cf2531a8b68
Reviewed-on: https://skia-review.googlesource.com/34982
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
This also required extending the blacklist argument to support
negative matching and wildcards.
Bug: skia:6918
Change-Id: I915e305c75fe23fc3e11c2dd3e91570967da0aaa
Reviewed-on: https://skia-review.googlesource.com/31444
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
The only interesting difference here is that I've just skipped
cd_Documents() on Google3 iOS builds rather than adding a new target to
BUILD. We don't run the binary so it's kind of moot what directory it'd
run in.
Change-Id: I1994e0283d24bcc505fa9b2b7b58307eafa5be92
Reviewed-on: https://skia-review.googlesource.com/34742
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
When a size_t is convert from a very large number to ptrdiff_t, it
becomes negative causing the existing block to be used instead of
allocating a new block.
Remove broken test from last try.
TBR=bungeman@google.com
BUG=chromium:744109
Change-Id: Ifc81bb8f416d64f640730c66bce56a8e4c677173
Reviewed-on: https://skia-review.googlesource.com/35080
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This reverts commit 0bc4d60fe0.
Reason for revert: https://chromium-swarm.appspot.com/task?id=38007b6df51fef10&refresh=10
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Caught signal 6 [Aborted], was running:
8888 image scanline_kNonNative_premul interlaced3.png
unit test ArenaAllocReallyBigAlloc
unit test ClampRange
565 image scaled_codec_premul_0.200 interlaced3.png_0.200
unit test ClipStack
Likely culprit:
unit test ArenaAllocReallyBigAlloc
Stack trace:
/mnt/pd0/s/w/ir/out/Debug/dm(+0x2381c1) [0x567aa1c1]
linux-gate.so.1(__kernel_sigreturn+0) [0xf770cca0]
linux-gate.so.1(__kernel_vsyscall+0x9) [0xf770cc89]
/lib/i386-linux-gnu/libc.so.6(gsignal+0xb0) [0xf7027dc0]
/lib/i386-linux-gnu/libc.so.6(abort+0x157) [0xf7029287]
/usr/lib/i386-linux-gnu/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x16f) [0xf729d2ff]
/usr/lib/i386-linux-gnu/libstdc++.so.6(+0x71ea4) [0xf729aea4]
/usr/lib/i386-linux-gnu/libstdc++.so.6(+0x71f1d) [0xf729af1d]
/usr/lib/i386-linux-gnu/libstdc++.so.6(__cxa_rethrow+0) [0xf729b1d0]
/usr/lib/i386-linux-gnu/libstdc++.so.6(+0x727ff) [0xf729b7ff]
/usr/lib/i386-linux-gnu/libstdc++.so.6(_Znaj+0x18) [0xf729b898]
/mnt/pd0/s/w/ir/out/Debug/dm(_ZN12SkArenaAlloc11ensureSpaceEjj+0xa0) [0x56f113a6]
/mnt/pd0/s/w/ir/out/Debug/dm(+0x3c2462) [0x56934462]
/mnt/pd0/s/w/ir/out/Debug/dm(+0x239acb) [0x567abacb]
/mnt/pd0/s/w/ir/out/Debug/dm(+0x239bdc) [0x567abbdc]
/mnt/pd0/s/w/ir/out/Debug/dm(+0xa6417b) [0x56fd617b]
/mnt/pd0/s/w/ir/out/Debug/dm(_ZNKSt8functionIFvvEEclEv+0x20) [0x56f10504]
/mnt/pd0/s/w/ir/out/Debug/dm(_ZN12SkThreadPool4LoopEPv+0x298) [0x56f10bdb]
/mnt/pd0/s/w/ir/out/Debug/dm(+0xb39700) [0x570ab700]
/lib/i386-linux-gnu/libpthread.so.0(+0x627a) [0xf76df27a]
/lib/i386-linux-gnu/libc.so.6(clone+0x66) [0xf70e3b56]
Aborted
Command exited with code 134
Original change's description:
> Fix bogus math in object allocation.
>
> When a size_t is convert from a very large number to ptrdiff_t, it
> becomes negative causing the existing block to be used instead of
> allocating a new block.
>
> BUG=chromium:744109
>
> Change-Id: I0bf98e3fb924851c162f6eca43d29a3f40dc9eaa
> Reviewed-on: https://skia-review.googlesource.com/34541
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=bungeman@google.com,herb@google.com
Change-Id: I8ce2b45d13178395247dabd7af6853354399721c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:744109
Reviewed-on: https://skia-review.googlesource.com/35000
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Change-Id: Ide445c73a5b14ea2e52decf85f5a2a9af0f2d242
Reviewed-on: https://skia-review.googlesource.com/34940
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
When a size_t is convert from a very large number to ptrdiff_t, it
becomes negative causing the existing block to be used instead of
allocating a new block.
BUG=chromium:744109
Change-Id: I0bf98e3fb924851c162f6eca43d29a3f40dc9eaa
Reviewed-on: https://skia-review.googlesource.com/34541
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
We've landed https://skia-review.googlesource.com/24126 to restore this
optimization, but we check too late: for non-clamp/clamp cases we'd
already adjusted the matrix scale, so the optimization never kicks in.
Relocate the integral translation check before all other matrix
adjustments.
BUG=chromium:744674
Change-Id: I395d327c3ddf74dc6d23bb8aee782ec62a7373f1
Reviewed-on: https://skia-review.googlesource.com/34840
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
That GM has a path with 16k points, arranged in a rectangle. When we try
to draw it in Ganesh, we first check to see if it's a (closed) rectangle.
We eventually decide that it is a rectangle, but not closed, so it gets
passed along. Then we construct a GrShape, which tries to simplify the
shape, again asking if it's a rectangle...
Each isRect query was iterating over the 16k verbs, and for each one,
calling atVerb(i). That, internally, calls verbs(), which calls validate()
in debug builds. So we were walking all 16k points 16k times (to ensure
the bounds were correct). The end result is that the GM took over 11
seconds to draw, and now takes 3 ms.
Bug: skia:
Change-Id: If5f7a067b8c25f049dc64275d94a42ae4a50f6a9
Reviewed-on: https://skia-review.googlesource.com/34723
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The original code had an optimization when sigma < 2 that averaged
pixels instead of Gaussian bluring them. This CL adds that
behavior back to the new implementation.
Add the flag SK_LEGACY_USE_GAUSS_FOR_SMALL_RADII to control the
new behavior.
BUG=chromium:745290
Change-Id: I6e7417ce7f42949f88376b549743a9f047667f09
Reviewed-on: https://skia-review.googlesource.com/34624
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I3f3c5f9df43e48f975b09f0bafadf03a15afec51
Reviewed-on: https://skia-review.googlesource.com/34745
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Some of these are pretty trivial, but a few really moved the needle. In
total, this cut the time in the parser by about 10% in my profiling.
The early returns from peek and checkNext are probably the biggest wins,
everything else is mostly about cutting down on string copying.
Bug: skia:
Change-Id: I3da0a0cfbc557e8cef480cb3a7d301c2b3f8802a
Reviewed-on: https://skia-review.googlesource.com/34720
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit f6975ea5fb.
Reason for revert:
Did not take into account there are layout test problems too. Adding a legacy flag.
Original change's description:
> Revert "Revert "Add an average mode for sigma < 2""
>
> We are going to have the google3 auto roller build the CL,
> and add the fixes to the failing tests to that CL. Because
> these are scuba changes, this should be simpler.
>
> This reverts commit 8e7503195c.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Add an average mode for sigma < 2"
> >
> > This reverts commit ba8275148a.
> >
> > Reason for revert: layout tests, Google3 equivalent failing.
> >
> > Original change's description:
> > > Add an average mode for sigma < 2
> > >
> > > The original code had an optimization when sigma < 2 that averaged
> > > pixels instead of Gaussian bluring them. This CL adds that
> > > behavior back to the new implementat.
> > >
> > > BUG=chromium:745290
> > > Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1
> > > Reviewed-on: https://skia-review.googlesource.com/34180
> > > Commit-Queue: Herb Derby <herb@google.com>
> > > Reviewed-by: Mike Klein <mtklein@chromium.org>
> >
> > TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com
> >
> > Change-Id: Ie8f38b042acec42260913cb7bed5538a2c957e9b
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:745290
> > Reviewed-on: https://skia-review.googlesource.com/34640
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Mike Klein <mtklein@google.com>
>
> TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com
>
> Change-Id: I5f7b706a2f8c8d52b3576c638ecddf12a1652031
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:745290
> Reviewed-on: https://skia-review.googlesource.com/34641
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com
Change-Id: I9064f8494e5a1a4a78dd545697e22f52985c0fa1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:745290
Reviewed-on: https://skia-review.googlesource.com/34623
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
We are going to have the google3 auto roller build the CL,
and add the fixes to the failing tests to that CL. Because
these are scuba changes, this should be simpler.
This reverts commit 8e7503195c.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Add an average mode for sigma < 2"
>
> This reverts commit ba8275148a.
>
> Reason for revert: layout tests, Google3 equivalent failing.
>
> Original change's description:
> > Add an average mode for sigma < 2
> >
> > The original code had an optimization when sigma < 2 that averaged
> > pixels instead of Gaussian bluring them. This CL adds that
> > behavior back to the new implementat.
> >
> > BUG=chromium:745290
> > Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1
> > Reviewed-on: https://skia-review.googlesource.com/34180
> > Commit-Queue: Herb Derby <herb@google.com>
> > Reviewed-by: Mike Klein <mtklein@chromium.org>
>
> TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com
>
> Change-Id: Ie8f38b042acec42260913cb7bed5538a2c957e9b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:745290
> Reviewed-on: https://skia-review.googlesource.com/34640
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com
Change-Id: I5f7b706a2f8c8d52b3576c638ecddf12a1652031
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:745290
Reviewed-on: https://skia-review.googlesource.com/34641
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:
Change-Id: Ifbccc6d6880522177ac7a0ae2183be64a3ebfe50
Reviewed-on: https://skia-review.googlesource.com/34681
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This reverts commit ba8275148a.
Reason for revert: layout tests, Google3 equivalent failing.
Original change's description:
> Add an average mode for sigma < 2
>
> The original code had an optimization when sigma < 2 that averaged
> pixels instead of Gaussian bluring them. This CL adds that
> behavior back to the new implementat.
>
> BUG=chromium:745290
> Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1
> Reviewed-on: https://skia-review.googlesource.com/34180
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com
Change-Id: Ie8f38b042acec42260913cb7bed5538a2c957e9b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:745290
Reviewed-on: https://skia-review.googlesource.com/34640
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I65cd5761bb01e648db706878b902e6b6ed67fab9
Reviewed-on: https://skia-review.googlesource.com/33761
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
On desktop, this saves just over 5% of the time in the SkSL compiler.
As written, the code will now build either way, so it's much easier to
switch back (or even have some platforms use SkString, if that's ever
required).
Bug: skia:
Change-Id: I634f26a4f6fcb404e59bda6a5c6a21a9c6d73c0b
Reviewed-on: https://skia-review.googlesource.com/34381
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The original code had an optimization when sigma < 2 that averaged
pixels instead of Gaussian bluring them. This CL adds that
behavior back to the new implementat.
BUG=chromium:745290
Change-Id: I35b7de2138a859d546439cc2053b4b599a94ebe1
Reviewed-on: https://skia-review.googlesource.com/34180
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
BUG=chromium:745290
Change-Id: I78cabf988115598e14a7ce39faf96e3a697a1a8f
Reviewed-on: https://skia-review.googlesource.com/34382
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This reduces jank when flinging a page of emoji on Android (I have separately shared out a spreadsheet). Arguably, the quality loss should be acceptable since we shouldn't be down-scaling that much (magnitude-wise not frequency-wise). Ideally, we would add a raster mode where we would draw at the correct size w/o generating the mip maps.
Change-Id: Id91d638db1b2457567e54c264ed3fa5d10316976
Reviewed-on: https://skia-review.googlesource.com/33763
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Change-Id: I88f3e56971e9844ab2ff74edb0718e6b6e9c6559
Reviewed-on: https://skia-review.googlesource.com/34260
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Bug: skia:
Change-Id: Iab823b01b6f5f85bbb47c4ac69c6ce396dabf497
Reviewed-on: https://skia-review.googlesource.com/34000
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
We can record multiple frames in an .skp by recording SkCanvas::flush().
This should make SkPictures, SkLiteDL, and .skp files all record flush().
Change-Id: I6cf6e0e4ef993530d9f92fa168a53702ffce7d5e
Reviewed-on: https://skia-review.googlesource.com/34081
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
No-Try: true
Change-Id: I41dfddf21f8ed80582d5dc88150e1fbaf98326e6
Reviewed-on: https://skia-review.googlesource.com/33803
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>