aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* GrTessellator: fix for collinear out-of-range intersections.Gravatar Stephen White2017-08-16
| | | | | | | | | | | | | | | | | | | | | | | | Change 3b5a3fa8b1c11d4bd4499b040311f4c3553ebf8c 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>
* Cache more aggressively in GrSoftwarePathRenderer for AndroidGravatar Stan Iliev2017-08-16
| | | | | | | | | | | | | | 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>
* explicitly vectorize sk_memset{16,32,64}Gravatar Mike Klein2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ought to help clients who don't enable autovectorization. With autovectorization enabled, this new version is like, hyper-vectorized compared to the old autovectorization. Instead of handling 128 bytes max per loop, it now handles up to 512 bytes per loop. Pretty exciting. Locally perf effects are a mix, but we'd expect this to help Chrome unambiguously if they've turned off autovectorization. $ out/ok bench:samples=100 sw filter:match=memset32_\\d\* serial Before: [memset32_100000] 16ms @0 20.1ms @99 20.2ms @100 [memset32_10000] 1.07ms @0 1.26ms @99 1.31ms @100 [memset32_1000] 73.9µs @0 89.4µs @99 90.1µs @100 [memset32_100] 8.59µs @0 9.74µs @99 9.96µs @100 [memset32_10] 7.45µs @0 8.96µs @99 8.99µs @100 [memset32_1] 2.29µs @0 2.81µs @99 2.92µs @100 After: [memset32_100000] 16.2ms @0 17.3ms @99 17.3ms @100 [memset32_10000] 1.06ms @0 1.18ms @99 1.23ms @100 [memset32_1000] 72µs @0 75.6µs @99 84.7µs @100 [memset32_100] 9.14µs @0 10.6µs @99 10.7µs @100 [memset32_10] 5.43µs @0 5.88µs @99 5.99µs @100 [memset32_1] 3.43µs @0 3.65µs @99 3.83µs @100 BUG=chromium:755391 Change-Id: If9059a30ca7a345f1f7c37bd51473c29e8bb8922 Reviewed-on: https://skia-review.googlesource.com/34746 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix bogus math in object allocation.Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | 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>
* Revert "Fix bogus math in object allocation."Gravatar Florin Malita2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0bc4d60fe0a1ceae6dde0103c3fdf78ee1673ffa. 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>
* Fix bogus math in object allocation.Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | 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>
* Skip bilerp for integral-translate-only matrices (!clamp-clamp case)Gravatar Florin Malita2017-08-15
| | | | | | | | | | | | | | | | 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>
* Add an average mode for sigma < 2Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | | 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>
* Don't emit CRLF when generating code on Windows (from SkSL)Gravatar Brian Osman2017-08-15
| | | | | | | | 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>
* Micro optimizations to SkSL parserGravatar Brian Osman2017-08-15
| | | | | | | | | | | | | | 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>
* Revert "Revert "Revert "Add an average mode for sigma < 2"""Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f6975ea5fb178c572cf4c1cd255e5fe623418d45. 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 8e7503195c40492df6a9c072d3303c9df9ec32dc. > > Reason for revert: <INSERT REASONING HERE> > > Original change's description: > > Revert "Add an average mode for sigma < 2" > > > > This reverts commit ba8275148ab8b10393b053e2586b852796c4afc2. > > > > 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>
* Revert "Revert "Add an average mode for sigma < 2""Gravatar Herb Derby2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 8e7503195c40492df6a9c072d3303c9df9ec32dc. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Add an average mode for sigma < 2" > > This reverts commit ba8275148ab8b10393b053e2586b852796c4afc2. > > 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>
* Fix string typing in generated codeGravatar Brian Osman2017-08-15
| | | | | | | | | 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>
* rename confusing lowp guardGravatar Mike Klein2017-08-15
| | | | | | | Change-Id: I346429015e5f902b0a35663e140bb9a025c4220e Reviewed-on: https://skia-review.googlesource.com/34680 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Add an average mode for sigma < 2"Gravatar Mike Klein2017-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ba8275148ab8b10393b053e2586b852796c4afc2. 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>
* Lowp overlay, hardlight stagesGravatar Florin Malita2017-08-14
| | | | | | | | | | | | | | | | | | | | Before: micros bench 7669.09 ? blendmode_rect_HardLight 8888 8707.13 ? blendmode_rect_Overlay 8888 After: micros bench 6679.60 ? blendmode_rect_HardLight 8888 6789.57 ? blendmode_rect_Overlay 8888 Change-Id: I52f389253fa07dafe18e572af550af7387264a16 Reviewed-on: https://skia-review.googlesource.com/34280 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
* Switch SkSL to std::stringGravatar Brian Osman2017-08-14
| | | | | | | | | | | | | | 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>
* Add an average mode for sigma < 2Gravatar Herb Derby2017-08-14
| | | | | | | | | | | | 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>
* Move lang to list in Android font manager.Gravatar Ben Wagner2017-08-14
| | | | | | | Change-Id: Ia4af2769f4761e6b444ed0c232c48199872f3acc Reviewed-on: https://skia-review.googlesource.com/33480 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Use kLow_SkFilterQuality in generateGlyphImageGravatar Robert Phillips2017-08-14
| | | | | | | | | 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>
* we never define BLEND_MODEGravatar Mike Klein2017-08-14
| | | | | | | | | 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>
* reduced number of string copies in SkSL parserGravatar Ethan Nicholas2017-08-14
| | | | | | | | 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>
* Record SkCanvas::flush().Gravatar Mike Klein2017-08-14
| | | | | | | | | | 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>
* Fix tracing macros for framework buildsGravatar Brian Osman2017-08-14
| | | | | | | | Bug: skia: Change-Id: Ia5c27af2c8dafd5d6f2171fa82f435dbfdebd346 Reviewed-on: https://skia-review.googlesource.com/33760 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Simplify difference and exclusion.Gravatar Mike Klein2017-08-14
| | | | | | | | | | | | | | | | | | | | | | | We can fold through some math in these two modes. $ out/ok bench:samples=100 rp filter:search="Difference|Exclusion" serial Before: [blendmode_rect_Exclusion] 4.94ms @0 6.13ms @99 6.25ms @100 [blendmode_mask_Exclusion] 10.9ms @0 12.8ms @99 12.9ms @100 [blendmode_rect_Difference] 5.56ms @0 6.79ms @99 6.8ms @100 [blendmode_mask_Difference] 11.4ms @0 13.8ms @99 14.1ms @100 After: [blendmode_rect_Exclusion] 3.5ms @0 4.12ms @99 4.59ms @100 [blendmode_mask_Exclusion] 9.27ms @0 11.2ms @99 11.6ms @100 [blendmode_rect_Difference] 5.37ms @0 6.58ms @99 6.6ms @100 [blendmode_mask_Difference] 11ms @0 12.1ms @99 12.6ms @100 Change-Id: I03f32368244d4f979cfee83723fd78dfbc7d5fc1 Reviewed-on: https://skia-review.googlesource.com/33980 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* lowp: lighten, difference, exclusionGravatar Florin Malita2017-08-14
| | | | | | | Change-Id: I5773cf831c7e41a932bee1f2c6830085fb7db025 Reviewed-on: https://skia-review.googlesource.com/33764 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
* Guard lowp changesGravatar Florin Malita2017-08-11
| | | | | | | | | | Chromium uses the lowp code, we have to stage the changes. TBR= Change-Id: I45e97a51eca285c9afc71926bbf736a03d0d146c Reviewed-on: https://skia-review.googlesource.com/33765 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Lowp darken stageGravatar Florin Malita2017-08-11
| | | | | | | Change-Id: I4bf618ad8728541fcef3fc1c6aa5b3ca106d50dc Reviewed-on: https://skia-review.googlesource.com/33583 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Guard AA change to wait for rebaselinesGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We use SK_SUPPORT_LEGACY_DELTA_AA to guard the golden image change. Such flag is defined for Android, Chrome, and Google3 so our auto-rollers should all be OK. TBR: bungeman@google.com Bug: skia:6947 Change-Id: Ic2705e82f4f7f15ec08499254dce75b93d41727e Reviewed-on: https://skia-review.googlesource.com/33762 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Avoid converting drawImage/drawImageRect into drawBitmap callsGravatar Derek Sollenberger2017-08-11
| | | | | | | Change-Id: I1ae551afa93222126852bb9e429a565379a93f24 Reviewed-on: https://skia-review.googlesource.com/33661 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Remove CHECK_SHOULD_DRAW from SkGpuDeviceGravatar Brian Salomon2017-08-11
| | | | | | | Change-Id: Ieb3910e2085235c62374d3e30d1ce6b9089de567 Reviewed-on: https://skia-review.googlesource.com/33780 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* SkSafeMath for tracking size_t overflowGravatar Herb Derby2017-08-11
| | | | | | | | | | | | | | Do multiply (mul) and add while tracking that the calculation does not overflow, which can be checked with ok(). The new unit test shows a couple examples. Author: Herb Derby <herb@google.com> Change-Id: I7e67671d2488d67f21d47d9618736a6bae8f23c3 Reviewed-on: https://skia-review.googlesource.com/33721 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Don't store clipped x which could break edge orderGravatar Yuqian Li2017-08-11
| | | | | | | | | | | | | | We only need to clip a temporary x to ensure that we don't blit beyond clip. Storing such clipped x is problematic because it may make our edges unsorted. The added unit test would fail without this fix. Bug: skia:6947 Change-Id: I6c21d7c7c097e50fef18ab151921d6c07c089318 Reviewed-on: https://skia-review.googlesource.com/33420 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* remove mask load() and store()Gravatar Mike Klein2017-08-11
| | | | | | | | | | | | | | | They appear to be slower than the generic load() and store() now. [blendmode_mask_Hue] 14.7ms @0 15.6ms @95 39.6ms @100 [blendmode_rect_Hue] 31.5ms @0 37.6ms @95 39.5ms @100 ~~> [blendmode_mask_Hue] 14.7ms @0 15.2ms @95 39.5ms @100 [blendmode_rect_Hue] 30.5ms @0 32.6ms @95 37.8ms @100 Change-Id: I674b75087b8139debead71f3016631bcb0cb0047 Reviewed-on: https://skia-review.googlesource.com/33800 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Replace log2 with SkNextLog2Gravatar Brian Osman2017-08-11
| | | | | | | | | | | log2 didn't exist on Android until API 18, and it's doing double precision math. I think this integer version is what we want? Bug: skia: Change-Id: I4909153c56a266688355349cda5d553b69f5c942 Reviewed-on: https://skia-review.googlesource.com/33680 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* double pump 8-bit stagesGravatar Mike Klein2017-08-11
| | | | | | | | | | | | | This basically unrolls all loops, handling twice as many pixels in a stride. We now pass around 4 native registers instead of just 2. I've temporarily disabled AVX2 mask loads and stores. It shouldn't be hard to turn them back on, but I'd want to test on AVX2 hardware first. Change-Id: I0907070f086a0650167456c149a479c1d96b8a2d Reviewed-on: https://skia-review.googlesource.com/33361 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Remove subpixel positioning implies no bytecode hinting."Gravatar Ben Wagner2017-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 880768032d7bd1528dc84f5b4408d4fa418bae7d. Reason for revert: Pixel tests, and gfx tests can't handle hinting. Original change's description: > Remove subpixel positioning implies no bytecode hinting. > > SkTypeface_FreeType::onFilterRec currently assumes that if we're asked > to do subpixel positioning, don't do bytecode hinting. The idea was that > both could not be satisfied at the same time, so pick something. This is > no longer true, as with the v40 interpreter it is possible to get > subpixel positioned but bytcode hinted glyphs. > > BUG=skia:6931 > > Change-Id: Ifaeff20c121d6bb4b9287f552e383547eb6d5d49 > Reviewed-on: https://skia-review.googlesource.com/32201 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Ben Wagner <bungeman@google.com> TBR=bungeman@google.com,liyuqian@google.com,reed@google.com Change-Id: Idb1ee50d271846bdf962986914f6b75e3aa817c8 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6931 Reviewed-on: https://skia-review.googlesource.com/33586 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Remove subpixel positioning implies no bytecode hinting.Gravatar Ben Wagner2017-08-11
| | | | | | | | | | | | | | | | SkTypeface_FreeType::onFilterRec currently assumes that if we're asked to do subpixel positioning, don't do bytecode hinting. The idea was that both could not be satisfied at the same time, so pick something. This is no longer true, as with the v40 interpreter it is possible to get subpixel positioned but bytcode hinted glyphs. BUG=skia:6931 Change-Id: Ifaeff20c121d6bb4b9287f552e383547eb6d5d49 Reviewed-on: https://skia-review.googlesource.com/32201 Reviewed-by: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Much lower overhead Skia event tracing in the frameworkGravatar Brian Osman2017-08-11
| | | | | | | | Bug: skia: Change-Id: I0172e9e74898fb615cbb0ac61e46cbf9012ae75b Reviewed-on: https://skia-review.googlesource.com/33262 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make GrFragmentProcessor be non-refcounted and use std::unique_ptr.Gravatar Brian Salomon2017-08-11
| | | | | | | Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008 Reviewed-on: https://skia-review.googlesource.com/32760 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Expose SkPath validation as booleanGravatar Adrienne Walker2017-08-10
| | | | | | | | | | | | | | | | As a part of serializing SkPaths, I want to be able to know (without asserting) whether or not a path is valid so that I can discard potentially malicious deserialized paths. Currently, SkPath(Ref) both just have asserting validation functions which can't be used externally. This patch adds accessors that don't assert. Bug: chromium:752755 skia:6955 Change-Id: I4d0ceb31ec660b87e3fda438392ad2b60a27a0da Reviewed-on: https://skia-review.googlesource.com/31720 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Bypass libandroid dynamic linking for ATrace in framework buildsGravatar Brian Osman2017-08-10
| | | | | | | | | | | | | | | These symbols were resolving, but weren't really connected to systrace on Android. Using the macros/functions allows this to work correctly. This change doesn't actually cause anything to happen in framework builds - that still requires installing an instance of SkATrace, but now doing so will route all of Skia's TRACE_EVENT macros to systrace. Bug: skia: Change-Id: I6d2eafac7ef2531ba92094b92f68e59e0490ef62 Reviewed-on: https://skia-review.googlesource.com/33400 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove fStencilClearValue from Vulkan's CommandBufferInfo structGravatar Robert Phillips2017-08-10
| | | | | | | | | | | Adding this extra field to the CommandBufferInfo may or may not have led to a memory regression. Remove it until it is actually needed. Change-Id: Ibdddbeb7625f91f5199584a575289f07f6e95304 Reviewed-on: https://skia-review.googlesource.com/33280 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Hide GrPaint copy constructor and add GrPaint::Clone and remove MoveOrNew ↵Gravatar Brian Salomon2017-08-10
| | | | | | | | | | | and MoveOrCopy. Also makes paint clones use cloned fragment processors. Change-Id: I60efcfc6a46a4f8430a72f4d1ec79c7d99fbe593 Reviewed-on: https://skia-review.googlesource.com/33084 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Some performance tweaks for DAAGravatar Yuqian Li2017-08-10
| | | | | | | | | | | | | | | | | | | | | | | 1. Always inline (Clang previously ignored inline and got 25% slower) 2. SIMD everywhere other than x86 gcc: non-SIMD is only faster in my desktop with gcc; with Clang on my desktop, SIMD is 50% faster than non-SIMD. 3. Allocate 4x memory instead of 2x when running out of space: on old Android devices with Linux kernel 3.10 (e.g., Nexus 6P, 5X), the alloc/memcpy will triger a major bottleneck in kernel (30% of the running time). Such bottleneck goes away (the kernel is no longer doing stupid things during alloc/memcpy) in Linux kernel 3.18 (e.g., Pixel), and that's why DAA is much faster on Pixel than on Nexus 6P. I think maybe I should adopt SkRasterPipeline for device-specific optimizations. Bug: skia: Change-Id: I0408aa7671a5f1b39aad3bec25f8fc994ff5a1bb Reviewed-on: https://skia-review.googlesource.com/30820 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Revert "Support single line objects and arrays""Gravatar Brian Osman2017-08-10
| | | | | | | | | | This reverts commit a5a69cfb480b99747ddc272149d35c6302abf1bf. Bug: skia: Change-Id: I08475d96255b9df13e5c86e1ef9c7f4739e51459 Reviewed-on: https://skia-review.googlesource.com/33202 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Avoid errors about re-defining __STDC_FORMAT_MACROSGravatar Brian Osman2017-08-10
| | | | | | | | Bug: skia: Change-Id: I880e3d5a668743ac12fb0101baca637443e920b4 Reviewed-on: https://skia-review.googlesource.com/33082 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "GrContext::dump that produces JSON formatted output""Gravatar Brian Osman2017-08-10
| | | | | | | | | | This reverts commit 0f450acd76fd58a2f7464f99869ed6afbfac303c. Bug: skia: Change-Id: I97428fbbc6d82bf8b186ec5fdbf1a939c00e4126 Reviewed-on: https://skia-review.googlesource.com/32726 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Replace interp() with clut_{3,4}D stages.Gravatar Mike Klein2017-08-10
| | | | | | | | | | | | | | | I tried to follow exactly the same strategy as a start. (Though I did fix the off-by-one dimensions.) It does rather look like we only need 3D and 4D now that I've looked at the call sites. Looks like about a 20% speedup. Change-Id: I8b1af64750ad1750716ee1ab0767e64591c7206a Reviewed-on: https://skia-review.googlesource.com/32842 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Move GrAppliedClip into GrPipelineGravatar Brian Salomon2017-08-10
| | | | | | | Change-Id: I522c2fd52bea9813baba7cdb3f11b63e7ab96b50 Reviewed-on: https://skia-review.googlesource.com/28861 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>