aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
Commit message (Collapse)AuthorAge
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* No chop at y extrema for cubicsGravatar Yuqian Li2017-08-09
| | | | | | | | | | | | | | | | | | The new Delta AA scan converter does not need the edge to be updated with monotonic Y so chopping at y extrema is not necessary. Removing such chopping brings ~10% performance increase to chalkboard.svg which has tons of small cubics (the same is true for many svgs I saw). We didn't remove the chopping for quads because that does not bring a significant speedup. Moreover, dropping those y extremas would make our strokecircle animation look a little more wobbly (because we would have fewer divisions for the quads at the top and bottom of the circle). Bug: skia: Change-Id: I3984d2619f9f77269ed24e8cbfa9f1429ebca4a8 Reviewed-on: https://skia-review.googlesource.com/31940 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove SkColorLookUpTable::interp3D().Gravatar Mike Klein2017-08-09
| | | | | | | | | | It looks like our recursive approach is faster than interp3D(), and we'd prefer trilinear interpolation over tetrahedral for quality. Change-Id: I1019254b9ecf24b2f4feff17ed8ae1b48fcc281e Reviewed-on: https://skia-review.googlesource.com/32800 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Move gFDot6INVERSE definition to cpp fileGravatar Yuqian Li2017-08-09
| | | | | | | | Bug: skia:6946 Change-Id: Iee029a73ae899b0f73910b45c7cf83bd37dc07c3 Reviewed-on: https://skia-review.googlesource.com/32840 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* add gamma stageGravatar Mike Klein2017-08-09
| | | | | | | | | | | | | | | | Until now we've been using 3 separate parametric stages to apply gamma to r,g,b. That works fine, but is kind of unnecessarily slow, and again less clear in a stack trace than seeing "gamma". The new bench runs in about 60% of the time the old one does on my Trashcan. BUG=skia:6939 Change-Id: I079698d3009b081f1c23a2e27fc26e373b439610 Reviewed-on: https://skia-review.googlesource.com/32721 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* use rasterpipeline for images if matrix is >= scale+translateGravatar Mike Reed2017-08-08
| | | | | | | | | Bug: skia: Change-Id: I36112fe54c6f2d0965d0b88f0291d7ffe0902715 Reviewed-on: https://skia-review.googlesource.com/30480 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* rewrite SkColorLookUpTable::interpDimension()Gravatar Mike Klein2017-08-08
| | | | | | | | | | | | - Avoid calling floor() and ceil(), which are real external calls on most platforms. - Interpolate all output channels in parallel. - Simplify recursion, allow the compiler to unroll. Change-Id: I9ef814e91b18c5775292ca20e9ec01222b6a89cf Reviewed-on: https://skia-review.googlesource.com/32182 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove last uses of SkTypeface::style() in Skia.Gravatar Ben Wagner2017-08-08
| | | | | | | | | | | The Lua typeface.getStyle now returns SkFontStyle. Dumping a glyph cache entry is now more accurate. SkTypeface::MakeFromTypeface now does a more accurate check. Change-Id: I6150636c8c674353bd0eed4d95aa0794d3919c39 Reviewed-on: https://skia-review.googlesource.com/32200 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* add an invert stage for inverse CMYK -> CMYKGravatar Mike Klein2017-08-08
| | | | | | | | | | | | | | | | | This will be faster, but maybe more importantly it helps make debugging a stack trace clearer. It's confusing to see a "parametric transfer function" stages followed by a table transfer function stages... This leads to a little bit of cleanup in SkColorSpaceXform_A2B. I am uncertain whether we still need parametric_a. I need to do some more tracing through the code before I'd say it's impossible to reach in addTransferFn(). Change-Id: I52e85019f92d012a3086fc94cf64ae6c9307ea94 Reviewed-on: https://skia-review.googlesource.com/32040 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Don't compare against uninit edge in SkPath::conservativelyContainsRectGravatar Brian Salomon2017-08-08
| | | | | | | | | Bug: chromium:752478 Change-Id: Ic281f06b300329ea9823b3eb76cc56b7a43fd2a5 Reviewed-on: https://skia-review.googlesource.com/31520 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* simplify shaderbase -- remove shaderproc -- no measurable speed diffGravatar Mike Reed2017-08-07
| | | | | | | | Bug: skia: Change-Id: Id355e3e480847fe78f904735e59353c4eb3ba2bb Reviewed-on: https://skia-review.googlesource.com/31560 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Remove SK_NO_ANALYTIC_AAGravatar Yuqian Li2017-08-07
| | | | | | | | | | Google3 now has that guard flag removed. Bug: skia: Change-Id: I6dede8c815e9f55bd769daef3982fd2fa8a7d6be Reviewed-on: https://skia-review.googlesource.com/31201 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Flush threaded device when reaching max queue sizeGravatar Yuqian Li2017-08-07
| | | | | | | | | | | Our SkThreadedBMPDevice is very experimental so I didn't handle this edge case earlier. Maybe it's now a good time to fix it. Bug: skia: Change-Id: Ie3938475449c1341d34200ff3afe4589836950fc Reviewed-on: https://skia-review.googlesource.com/31203 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove SkLightingShader and associated classesGravatar Robert Phillips2017-08-07
| | | | | | | | Change-Id: I8050414c30dfdb5df23ca79955adc5ba3a29d3f5 Reviewed-on: https://skia-review.googlesource.com/31140 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Update SkClipStack's bound computationGravatar Robert Phillips2017-08-04
| | | | | | | | | I believe this was originally added to make Raster & GPU rendering more similar. I think we've moved on from there. Change-Id: Ic980f3308fbd427e5857b720488c91383a32a149 Reviewed-on: https://skia-review.googlesource.com/30761 Reviewed-by: Stan Iliev <stani@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Disable Delta AA for MSVC for nowGravatar Yuqian Li2017-08-03
| | | | | | | | | | | | | Perf showed that DAA is slow with MSVC. Disable it until I find out why. Bug: skia: Change-Id: If30c24e97fa42e3a7ce143a1b1d06e4a3f278d13 TBR: mtklein@google.com Reviewed-on: https://skia-review.googlesource.com/30584 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add support for object creation/snapshot/deletion eventsGravatar Brian Osman2017-08-03
| | | | | | | | | | | | | - Bring back some previously deleted macros and helper types. - Automatically inject base_type information into snapshot events, to allow simpler tracking of polymorphic object types. - Fix JSON formatting of pointer values (they were serializing as bool). Bug: skia: Change-Id: Iac7803f72ce5396ffd2fbcb5a36d76745c5e3f3e Reviewed-on: https://skia-review.googlesource.com/28220 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Store float and byte constant colors.Gravatar Mike Klein2017-08-03
| | | | | | | | | This makes loading them much simpler in 8-bit mode. Change-Id: I35ff34ebd0b93425c4e39e055bf4ade8cf8561e1 Reviewed-on: https://skia-review.googlesource.com/30621 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* funnel all constant colors through append_constant_color()Gravatar Mike Klein2017-08-03
| | | | | | | | | | | | | | | | My next step is to change the uniform_color context to struct { float r,g,b,a; uint32_t rgba; }; so that it's trivial to load in both float and 8-bit pipelines. Change-Id: If9bdde353ced3bf9eb0c63204b4770ed614ad16b Reviewed-on: https://skia-review.googlesource.com/30481 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Rename append_uniform_color() to append_constant_color().Gravatar Mike Klein2017-08-03
| | | | | | | | | | | | | | | | | The color appended here is both uniform and constant, and it's the constantness that makes this custom append method useful over just append(SkRasterPipeline::uniform_color, ...). Uniform colors that are not constant have to be loaded from the pointer each time (the caller might have changed the color out-of-band), but constant uniform colors can be analyzed once and implemented with specalizations like black_color and white_color. Change-Id: I3cfc00ccc578dd915367bca7113010557181224c Reviewed-on: https://skia-review.googlesource.com/30560 Commit-Queue: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Add a private API for writing the clip to the stencilGravatar Stan Iliev2017-08-02
| | | | | | | | | | | Add a private API used by Android framework, which writes the clip into a stencil buffer. This is used by HWUI to clip the WebView. Bug: 31489986 Change-Id: I94515f1539acd9d069c8aceb3300577feed9c94f Reviewed-on: https://skia-review.googlesource.com/29521 Commit-Queue: Stan Iliev <stani@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* Revert "remove another SkConvertPixels "fast path""Gravatar Mike Klein2017-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 706a076879359207b1da292e5ee7750083e50152. Reason for revert: this looks less a "fast path" and more "completely essential path" according to Chrome roll tests and some layout tests (most are small diffs, but some are radical). Original change's description: > remove another SkConvertPixels "fast path" > > SkColorSpaceXform now uses the same mechanism as our default path, > SkRasterPipeline. There's no real reason to jump out to it as a > special case any more. > > Change-Id: I19490de5b331267209cf117534942fb175c624c9 > Reviewed-on: https://skia-review.googlesource.com/29900 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,brianosman@google.com Change-Id: I92b17fe0d44e609d8c06e8fa2933f1f572a98094 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/30160 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Reduce SORT_THRESHOLD to 256Gravatar Yuqian Li2017-08-02
| | | | | | | | | | | | | perf.skia.org showed that reducing the threshold would only harm path_fill_small_sawtooth, but will benefit many many skps and svgs playback. Bug: skia: Change-Id: I38904548206521d78a7c9c5804c0d989b23dc405 TBR: caryclark@google.com, reed@google.com Reviewed-on: https://skia-review.googlesource.com/29882 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* remove another SkConvertPixels "fast path"Gravatar Mike Klein2017-08-02
| | | | | | | | | | | SkColorSpaceXform now uses the same mechanism as our default path, SkRasterPipeline. There's no real reason to jump out to it as a special case any more. Change-Id: I19490de5b331267209cf117534942fb175c624c9 Reviewed-on: https://skia-review.googlesource.com/29900 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Tiling support for SkSweepGradientGravatar Florin Malita2017-08-01
| | | | | | | | | | | | | | | | | | Expand the sweep gradient definition to include a color stop angular range ([0, 360] by default). Color stop positions in [0,1] are mapped to this range, and drawing outside is controlled by a tile mode param. This is closer to the CSS gradients spec and allows us to use fewer color stops in Blink conic gradients. Impl-wise, the remapping is effected after t calculation, and before tiling. Change-Id: I5d71be01d134404d6eb9d7e2a904ec636b39f855 Reviewed-on: https://skia-review.googlesource.com/27704 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Assert text passed to canvas is initialized.Gravatar Ben Wagner2017-08-01
| | | | | | | | | | | | | | | | A new fuzzer appears to be complaining about using uninitialized glyph ids. These uninitilized glyph ids appear to be comming from far up the stack, but they don't actually get used until much later. If Skia is passed uninitialized memory in a draw call it will of course eventually need to use it and be blamed when it does. This change will make it obvious if the issue is up stack from Skia. BUG=chromium:750070,chromium:750071,chromium:750072 Change-Id: Ic6ca2f6af3620ad4a31cb017570f42550360891a Reviewed-on: https://skia-review.googlesource.com/29421 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
* Remove unused code for index 8Gravatar Brian Osman2017-08-01
| | | | | | | | Bug: skia: Change-Id: I0d421874e7ab71a39e2708575314f5b3615882e4 Reviewed-on: https://skia-review.googlesource.com/29221 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Require clone() be implemented by GrFragmentProcessor subclassesGravatar Brian Salomon2017-07-31
| | | | | | | Change-Id: I66ba0978e5748806d563ff4f26000e4e0095ed24 Reviewed-on: https://skia-review.googlesource.com/29042 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Fix premul state in from_srgb in convert_with_pipelineGravatar Christopher Cameron2017-07-31
| | | | | | | | | | | | | | Without this patch, the pipeline 1. converts to unpremultiplied 2. applies the sRGB transfer assuming the pixel is premultiplied In step 2, we should assume the pixel is unpremultiplied. Bug:738517 Change-Id: Ic11fcf64faa423577ccb1cfc0cfe96feb57db09a Reviewed-on: https://skia-review.googlesource.com/28404 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Remove union from SkFontStyle.Gravatar Ben Wagner2017-07-31
| | | | | | | | | | | | | | | This is prompted by a bug in vc++ reported at https://developercommunity.visualstudio.com/content/problem/86829/constexpr-initializing-struct-in-union-only-zero-i.html Visual C++ will not properly constexpr initialize a struct inside a union. Removing this construct also allows us to avoid writing and reading from different members of a union. Change-Id: I76e069ecce77ef21b7ad3821bf9c29e1b0843618 Reviewed-on: https://skia-review.googlesource.com/28300 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Add asserts to SkBlurImageFilter flatten & CreateProcGravatar Robert Phillips2017-07-31
| | | | | | | | | | | It seems rather implausible that this could be occuring but the Chrome bug seems to say otherwise. Bug: 748155 Change-Id: I8e14f1562c71da4ae80d626e4dba053d7ee13d97 Reviewed-on: https://skia-review.googlesource.com/28863 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>