aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkCoverageDelta.h
Commit message (Collapse)AuthorAge
* Let SkCoverageDeltaList store width and use it during blittingGravatar Yuqian Li2018-04-16
| | | | | | | | | | | | Otherwise, out/Debug/viewer -m complexclip_bw_invert may crash using the threaded backend because the clip in the initFn may be wider than the clip in the drawFn. Bug: skia: Change-Id: I3b3ddc9a912fcc155bd30a6bc1f87e24739d1ca6 Reviewed-on: https://skia-review.googlesource.com/121327 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Reland "Remove legacy precision boundary"Gravatar Yuqian Li2018-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dab15f7a02ddaa2a6977a14d5d04955bd39350ab. Reason for revert: the Android roll is broken by something else: b/76126268 Original change's description: > Revert "Remove legacy precision boundary" > > This reverts commit a2513c14c4e143984b2eec07f5263b5cdc6c84bb. > > Reason for revert: This is breaking the Android roll. > > Original change's description: > > Remove legacy precision boundary > > > > Bug: skia:7731 > > Change-Id: I86a87b960541c2bc7b099ca9f609342cb0bbf563 > > Reviewed-on: https://skia-review.googlesource.com/115652 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > TBR=caryclark@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com > > Change-Id: I45b14f5a84e97cc1022b99c414f90126d368f598 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7731 > Reviewed-on: https://skia-review.googlesource.com/115840 > Reviewed-by: Derek Sollenberger <djsollen@google.com> > Commit-Queue: Derek Sollenberger <djsollen@google.com> TBR=djsollen@google.com,caryclark@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com Change-Id: I5d957cb7be9cc578672079e98ab5e131ad249f70 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7731 Reviewed-on: https://skia-review.googlesource.com/115940 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Remove legacy precision boundary"Gravatar Derek Sollenberger2018-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a2513c14c4e143984b2eec07f5263b5cdc6c84bb. Reason for revert: This is breaking the Android roll. Original change's description: > Remove legacy precision boundary > > Bug: skia:7731 > Change-Id: I86a87b960541c2bc7b099ca9f609342cb0bbf563 > Reviewed-on: https://skia-review.googlesource.com/115652 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com Change-Id: I45b14f5a84e97cc1022b99c414f90126d368f598 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7731 Reviewed-on: https://skia-review.googlesource.com/115840 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Remove legacy precision boundaryGravatar Yuqian Li2018-03-21
| | | | | | | | Bug: skia:7731 Change-Id: I86a87b960541c2bc7b099ca9f609342cb0bbf563 Reviewed-on: https://skia-review.googlesource.com/115652 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Reland "Check the boundary while cumulating deltas in a mask"Gravatar Yuqian Li2018-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2ac541e66ce1afe174b31c24705ca47891816078. Reason for revert: try a new fix; the old one doesn't work because the deltas are not sorted. We use masks specifically because we don't want to sort deltas. Original change's description: > Revert "Check the boundary while cumulating deltas in a mask" > > This reverts commit d9779bcf93c2e11699230a54214309732b9161a7. > > Reason for revert: breaks gold > > Original change's description: > > Check the boundary while cumulating deltas in a mask > > > > Without the fix, > > > > ./out/Debug/dm --config t8888 -m complexclip_bw > > > > will trigger the assert. > > > > Note that this boundary check is already in place when deltas are > > cumulated without using a mask. > > > > Bug: skia: > > Change-Id: I68bfe2b7196d440743d3a7535d097bb8ec7689c3 > > Reviewed-on: https://skia-review.googlesource.com/113210 > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > Reviewed-by: Cary Clark <caryclark@skia.org> > > TBR=liyuqian@google.com,reed@google.com,caryclark@skia.org > > Change-Id: Ice0e3618b02ef48b0f2a9f0662a12f76078e984a > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/113170 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=liyuqian@google.com,reed@google.com,caryclark@skia.org Change-Id: Ia7a3608a54bed23827ed014213dcd6248adb271d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7731 Reviewed-on: https://skia-review.googlesource.com/113520 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Do not set record to empty if it's already computedGravatar Yuqian Li2018-03-09
| | | | | | | | | | | | Otherwise, the following test will fail: ./out/Debug/dm --config t8888 -m strokes_round Bug: skia: Change-Id: Ifc618fc42c6f387eae7b6aadd8424001c3e1464e Reviewed-on: https://skia-review.googlesource.com/113440 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Set SkDAARecord to empty type if the scan converter returns earlyGravatar Yuqian Li2018-03-05
| | | | | | | | | | | | | | Otherwise, ./out/Debug/dm --config t8888 -m bug583299 will crash at SkASSERT(record->fType != SkDAARecord::Type::kToBeComputed) Bug: skia: Change-Id: Ie93221bd6ea7ab9bc9f3d79fd7fe02b315e6a089 Reviewed-on: https://skia-review.googlesource.com/111680 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add SkDAARecord to prepare for init-onceGravatar Yuqian Li2018-02-14
| | | | | | | | | | | This is just refactoring our code so we can easily bring DAA to init-once. No GMs are expected to change. Bug: skia: Change-Id: I05dd1bdfb68bb40b5393ee854de51795b55ed426 Reviewed-on: https://skia-review.googlesource.com/106480 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* GOOGLE3 -> SK_BUILD_FOR_GOOGLE3Gravatar Mike Klein2017-12-19
| | | | | | | | | | | | | This is more consistent with our other SK_BUILD_FOR_... macros, and less likely to collide with other preprocessor logic. (Luckily, this was defined in public.bzl, so we can do this all in one CL in the Skia repo.) Change-Id: I5f232888288c9c53fad445545d983d0fb0b4add8 Reviewed-on: https://skia-review.googlesource.com/86940 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Use SkSTArenaAlloc to manage SkCoverageDeltaMask's stack memoryGravatar Yuqian Li2017-09-01
| | | | | | | | | | | | | This way, we could have more stack memory on Google3: if each of the two branche has 12K stack memory, Google3 would believe that it needs 24K stack memory; but using SkSTArenaAlloc, we could use 12K stack memory to handle those two branches. Bug: skia: Change-Id: Ie9234226cd4ba93b5be2ebeb95ab771031354f97 Reviewed-on: https://skia-review.googlesource.com/42101 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Use SkSTArenaAlloc to handle the stack memory of the delta listGravatar Yuqian Li2017-09-01
| | | | | | | | Bug: skia: Change-Id: I5c98220498c71ced4565f492335cef2a372d0765 Reviewed-on: https://skia-review.googlesource.com/41743 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@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>
* Use ifdef instead of ifndefGravatar Yuqian Li2017-07-26
| | | | | | | | Bug: skia: Change-Id: I9f86f71247379713ffaf14e5c704c2ac4c6f9cbd Reviewed-on: https://skia-review.googlesource.com/26861 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Further reduce stack size according to -fstack-usageGravatar Yuqian Li2017-07-26
| | | | | | | | | | | It seems that google3 is using -fstack-usage to determine whether we exceed 16k. Bug: skia: Change-Id: I259ff7fc0e6614dde83eb340f0a17efbc52ebf57 Reviewed-on: https://skia-review.googlesource.com/26940 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Further reduce google3 stack sizeGravatar Yuqian Li2017-07-26
| | | | | | | | | | | It seems that the compiler added the stack size of two "if" branches, rather than get the max of them... Bug: skia: Change-Id: Idf6b47cafd84c9a53a7b8dafb38f815e08094100 Reviewed-on: https://skia-review.googlesource.com/26780 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix flutter and g3 buildGravatar Yuqian Li2017-07-26
| | | | | | | | | | | Replace deprecated function call and reduce stack usage in g3 Bug: skia: Change-Id: Ib49ccecef4711c92ea2e62e772d98c0f5097e30d TBR: reed@google.com, caryclark@google.com Reviewed-on: https://skia-review.googlesource.com/26565 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* New analytic AA scan converter using delta (I call it DAA for now)Gravatar Yuqian Li2017-07-25
DAA is: 1. Much simpler than AAA. SkScan_AAAPath.cpp is about 1700 lines. SkScan_DAAPath.cpp is about 300 lines. The whole DAA CL is only about 800 lines. 2. Much faster than AAA for complicated paths. The speedup applies to GL backend (including ccpr)! Here's the frame time of 'SampleApp --slide Chart' on macbook pro: AAA-raster: 33ms DAA-raster: 21ms AAA-gl: 30ms DAA-gl: 20ms AAA-ccpr: 18ms DAA-ccpr: 12ms My linux desktop doesn't have SSE3 so the speedup is smaller (~25% for Chart). I believe that DAA is so fast that I can enable it for any paths (AAA is not enabled by default for complicated paths because it is slow; hence our older supersampling scan converter is used for stroking on Chart for AAA-xxx config.) 3. The SkCoverageDelta is suitable for threaded backend with out-of-order concurrent scan conversion as commented in the source code. Maybe we can also just send deltas to GPU. 4. Similar to most analytic path renderers, the quality is on the best ground-truth level, unless there are intersections within a pixel. The intersections look good to my eyes although theoretically that could be arbitrary far from the ground truth (see my AAA slides). 5. For simple paths, such as circle, triangle, rrect, etc., DAA is slower than AAA. But DAA is faster than our older supersampling scan converter in most cases. As those simple paths usually don't constitute the bottleneck of a picture (skp or svg), I strongly recommend use DAA. 6. DAA also heavily favors blitMask so it may work quite well with SkRasterPipeline and SkRasterPipelineBlitter. Finally, please check https://skia-review.googlesource.com/c/22420/ which accelerate DAA by specializing blitCoverageDeltas for SkARGB32_Blitter and SkARGB32_Black_Blitter. It brings a little(<5%) speedup. But I couldn't figure out how to reduce the duplicate code so I don't intend to land it. Bug: skia: Change-Id: I3b7ed6a727447922e645b1acb737a506e7c09a4c Reviewed-on: https://skia-review.googlesource.com/19666 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>