aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScan_AAAPath.cpp
Commit message (Collapse)AuthorAge
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@google.com>
* Remove legacy guard flagsGravatar Yuqian Li2018-05-03
| | | | | | | | | Bug: skia: Change-Id: I3b526f2caec6766faea72cdc89550f50e17c71d2 Reviewed-on: https://skia-review.googlesource.com/125746 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* use SkLeftShift in case the first arg is negativeGravatar Mike Reed2018-05-02
| | | | | | | | Bug: oss-fuzz:6117 Change-Id: I08521aaf4372a63428a1f663f4da78e72dfdf225 Reviewed-on: https://skia-review.googlesource.com/125344 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove SK_SUPPORT_LEGACY_AAA_SMOOTHGravatar Yuqian Li2018-02-12
| | | | | | | | | TBR: caryclark@google.com Bug: skia:7573 Change-Id: I94a3101bf3f2f4d253b9380d2cf5b450bd252118 Reviewed-on: https://skia-review.googlesource.com/106460 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix the left/right edge swapping in isSmoothEnoughGravatar Yuqian Li2018-02-08
| | | | | | | | Bug: skia:7573 Change-Id: I02d863ac15c04fab39c1d7b0b8970bad484ca12c Reviewed-on: https://skia-review.googlesource.com/104840 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove legacy small rect codeGravatar Yuqian Li2018-02-07
| | | | | | | | Bug: skia: Change-Id: Id7c5ce5e3e9e74c16a10bec3d46f8ce1fcd588c9 Reviewed-on: https://skia-review.googlesource.com/92102 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Remove legacy containedInClip codeGravatar Yuqian Li2018-01-09
| | | | | | | | | | | It seems that we've already rebaselined the golden images TBR: reed@google.com Bug: skia:7271 Change-Id: I841dc4933f0cad015c3c6da7bd08ddfb2a35c5a2 Reviewed-on: https://skia-review.googlesource.com/92060 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Compute more accurate containedInClipGravatar Yuqian Li2017-11-09
| | | | | | | | | | | | | Eventually, we'll remove containedInClip from the function parameters and just compute it using ir and clipBounds. The current approach is for preparing rebaseline. TBR: reed@google.com Bug: skia:7271 Change-Id: Ife60e173d9f4f1c9ec80d13a2f7a88a0433b61e9 Reviewed-on: https://skia-review.googlesource.com/69220 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Correct edges_too_closeGravatar Yuqian Li2017-11-07
| | | | | | | | | | | | | | | | | If the next edge has 0 fDX, we should add a SLACK = 1 so two edges with fX less than 1 pixel apart should be considered close, and noRealBlitter should be true to force the use of AdditiveBlitter and the cumulation of alpha. The changed GM will show bleed through if SLACK is 0. The artifact without the fix can be seen at: https://fiddle.skia.org/c/f6912f1af6c14e054f5b5935a93380ea Bug: skia: Change-Id: I15f9c3aef25a0357cd11d447e7bf0b4fbac0ce67 Reviewed-on: https://skia-review.googlesource.com/67804 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* This is a reland of 67340. This CL fixes the broken layout tests byGravatar Yuqian Li2017-11-07
| | | | | | | | | | | preserving the containedInClip boolean. We will eventually remove it and rebaseline the layout tests. Bug: skia:7271 Change-Id: I20e7220340d561ea2c50d30cd5d6ac6d2b4b3743 Reviewed-on: https://skia-review.googlesource.com/68100 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Simplify fill path call by removing do_fill_path"Gravatar Yuqian Li2017-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 12f322b9d4e98619bd128f39b02d3a6f3b78ba79. Reason for revert: Unexpectedly break Chrome layout tests. Will check why. Original change's description: > Simplify fill path call by removing do_fill_path > > The git diff is not very informative for this CL. > Here's a better diff: > > 1. do_fill_path is removed and its content is copied to AntiFillPath > > 2. Any call to do_fill_path is removed. > > 3. std::function FillPathFunc is removed (and replaced by direct > AAAFillPath, DAAFillPath, and SAAFillPath call). > > 4. The old call chain is: > AntiFillPath -> (AAAFillPath/DAAFillPath/...) > -> do_fill_path > -> specific FillPathFunc > The new call chain is: > AntiFillPath -> AAAFillPath/DAAFillPath/SAAFillPath > > This is made possible by the removal of SK_SUPPORT_LEGACY_AA_CHOICE > which makes sure that AntiFillPath is the only function that makes > the choice of AAA/DAA/SAA. > > In the next CL, I'll improve the structure of SkScan::AntiFillPath > to prepare for Threaded Backend's init-once change. > > Bug: skia: > Change-Id: If6ebbdab207cadb7bfe2cb3fcf33ea3d180c3896 > Reviewed-on: https://skia-review.googlesource.com/67340 > Reviewed-by: Mike Reed <reed@google.com> > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com,caryclark@skia.org Change-Id: I7d9517574265db5bc372a5749e6480df8e938f2e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/67855 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Simplify fill path call by removing do_fill_pathGravatar Yuqian Li2017-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git diff is not very informative for this CL. Here's a better diff: 1. do_fill_path is removed and its content is copied to AntiFillPath 2. Any call to do_fill_path is removed. 3. std::function FillPathFunc is removed (and replaced by direct AAAFillPath, DAAFillPath, and SAAFillPath call). 4. The old call chain is: AntiFillPath -> (AAAFillPath/DAAFillPath/...) -> do_fill_path -> specific FillPathFunc The new call chain is: AntiFillPath -> AAAFillPath/DAAFillPath/SAAFillPath This is made possible by the removal of SK_SUPPORT_LEGACY_AA_CHOICE which makes sure that AntiFillPath is the only function that makes the choice of AAA/DAA/SAA. In the next CL, I'll improve the structure of SkScan::AntiFillPath to prepare for Threaded Backend's init-once change. Bug: skia: Change-Id: If6ebbdab207cadb7bfe2cb3fcf33ea3d180c3896 Reviewed-on: https://skia-review.googlesource.com/67340 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Simplify scan converter's argsGravatar Yuqian Li2017-09-28
| | | | | | | | | | | | | | | All scan converters need an SkIRect clipBounds and a bool containedInClip. However, we previously sent in an SkRegion and a SkIRect*, and convert them into clipBounds and containedInClip all over the places. This CL converts them only once inside do_fill_path and change all args to SkIRect and bool. Bug: skia: Change-Id: I05f1d76322942d8817860fd33991f7f7ce918e7c Reviewed-on: https://skia-review.googlesource.com/52741 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Reland blitFatAntiRect with guard to avoid overhead in MaskAdditiveBlitterGravatar Yuqian Li2017-09-25
| | | | | | | | | | | | | | | This results in ~15% (~700ns vs ~600ns) speedup for path_fill_small_rect bench in 8888 config. Some skps have a lot of stroked horizontal/vertical lines (e.g., bar charts) so this improvement could have a great impact there. For example, cereal converts Microsoft word docx to PNGs on server and the sample docx has a big bar chart. That inspired this improvement. Bug: skia: Change-Id: If191b8beca58c5c08b356b64ffef93d51761fd0a Reviewed-on: https://skia-review.googlesource.com/50043 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Call blitFatAntiRect to avoid overhead in MaskAdditiveBlitter"Gravatar Mike Klein2017-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6d1aaca8276ff4ae2e10870f7e2c3222907cc4aa. Reason for revert: speculative revert for Google3 diff. Original change's description: > Call blitFatAntiRect to avoid overhead in MaskAdditiveBlitter > > This results in 25% (720ns vs 560ns) speedup for > path_fill_small_rect bench in 8888 config. Some skps have a lot of stroked > horizontal/vertical lines (e.g., bar charts) so this improvement could > have a great impact there. For example, cereal converts Microsoft word docx > to PNGs on server and the sample docx has a big bar chart. That inspired > this improvement. > > Bug: skia: > Change-Id: Icf96c966edf87427b3d1f53da09a49930eda2ac1 > Reviewed-on: https://skia-review.googlesource.com/46584 > Commit-Queue: Yuqian Li <liyuqian@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,herb@google.com,liyuqian@google.com,reed@google.com Change-Id: Ia30df0be874749c5f8ee0138f3d7d961d5bc3fcf No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/48220 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Call blitFatAntiRect to avoid overhead in MaskAdditiveBlitterGravatar Yuqian Li2017-09-18
| | | | | | | | | | | | | | | This results in 25% (720ns vs 560ns) speedup for path_fill_small_rect bench in 8888 config. Some skps have a lot of stroked horizontal/vertical lines (e.g., bar charts) so this improvement could have a great impact there. For example, cereal converts Microsoft word docx to PNGs on server and the sample docx has a big bar chart. That inspired this improvement. Bug: skia: Change-Id: Icf96c966edf87427b3d1f53da09a49930eda2ac1 Reviewed-on: https://skia-review.googlesource.com/46584 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Replace SkFAIL with SK_ABORT.Gravatar Ben Wagner2017-08-16
| | | | | | | | | | | | SkFAIL is a legacy macro which is just SK_ABORT. This CL mechanically changes uses of SkFAIL to SK_ABORT in preparation for its removal. The related sk_throw macro will be changed independently, due to needing to actually clean up its users. Change-Id: Id70b5c111a02d2458dc60c8933f444df27d9cebb Reviewed-on: https://skia-review.googlesource.com/35284 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Ben Wagner <bungeman@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>
* 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>
* 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>
* Make update_edge as a member function of SkAnalyticEdgeGravatar Yuqian Li2017-07-21
| | | | | | | | | | | This is to prepare for future SkScan_DAAPath.cpp to use this member function (https://skia-review.googlesource.com/c/19666/). Bug: skia: Change-Id: I5fb90ac67b80f8a69a712e7e697d68dcadba5d14 Reviewed-on: https://skia-review.googlesource.com/24180 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Combine duplicate code in preparing clipRgn for fill_pathGravatar Yuqian Li2017-06-12
| | | | | | | | Bug: skia: Change-Id: I52ed98491457aa426e2bb74a29131f4a20330017 Reviewed-on: https://skia-review.googlesource.com/19341 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* Explicitly check edge count >= 2 in non-debug buildGravatar Yuqian Li2017-05-26
| | | | | | | | | | | We also preserve the check in debug mode that the count should never be 1 when the path is convex. Bug: skia:6684 Change-Id: I4d4c9ad9f9d704e94bbe51f10a96f8b3066afaa1 Reviewed-on: https://skia-review.googlesource.com/17983 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Mark overridden destructors with 'override' and remove 'virtual'Gravatar Brian Salomon2017-03-22
| | | | | | | | | This silences a new warning in clang 5.0 Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8 Reviewed-on: https://skia-review.googlesource.com/10006 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Combine some duplicate code in AA using templateGravatar Yuqian Li2017-03-21
| | | | | | | | | BUG=skia: Change-Id: Id048425e8199167feba0268f89f526bbf5b7242b Reviewed-on: https://skia-review.googlesource.com/9832 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove SK_SUPPORT_LEGACY_AAA flag as chromium now turns it offGravatar Yuqian Li2017-03-08
| | | | | | | | | BUG=skia: Change-Id: I3b385b8aeab08f402f4471637bf641cd456c8c56 Reviewed-on: https://skia-review.googlesource.com/9327 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix performance issue and compute intersections more often.Gravatar Yuqian Li2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | (This CL also turned on Analytic AA for concave paths by removing SK_SUPPORT_LEGACY_AAA flag.) Performance: The SK_ALWAYS_INLINE was restored because it could bring 30%-50% speedup in certain convex cases (e.g., fill_big_triangle). We also have to reduce the number of branchings in the concave code path to enable such speedup. (Although the speedup is for convex cases. The assembly code is so strange...) Intersection: Previously, the criterion is too loose and that caused some bad pixels (mostly unnoticeable by human eyes without magnifying). For example, pixel (198, 222) of https://gold.skia.org/detail?test=parsedpaths&digest=979e81de6f7b3f9e7e8dc810e31cad8d BUG=skia: Change-Id: I5e8191865c3df625f895cd4588c67c283fcbeaec Reviewed-on: https://skia-review.googlesource.com/7318 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Turn on concave analytic AAGravatar Yuqian Li2017-01-18
| | | | | | | | | | | | | | | | | | This will allow Skia trybots to exercise analytic AA. But there's still a guard flag in Chromium that prevents layout tests failure. Additionally, we 1. fixed nagative shift problem 2. relax the ASSERT when slope is too large: If slope is large, the accuracy of the slope is limited due to conversion to SkFDot6 and division. Hence we have to relax the constraint. 3. handle the special case where dx != 0 while slope == 0 because of very large dy and limited precision. BUG=skia: Change-Id: Ice70164f3f396f0db3896bedc7b96fbd613078dc Reviewed-on: https://skia-review.googlesource.com/7120 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Reland https://skia-review.googlesource.com/c/6091/Gravatar Yuqian Li2017-01-13
| | | | | | | | | | | | | | The only difference is that we now also put the guard flag SK_SUPPORT_LEGACY_AAA in SkUserConfig.h. Previously, SkAnalyticEdge.cpp doesn't get that flag from SkScan.h and that caused many problems. BUG=skia: TBR=reed@google.com,caryclark@google.com Change-Id: I134bb76cebd6fffa712f438076668765321bba3b Reviewed-on: https://skia-review.googlesource.com/6992 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Reland https://skia-review.googlesource.com/c/6091/"Gravatar Yuqian Li2017-01-13
| | | | | | | | | | | This reverts commit b46fff60bc82fe6f0c64b2241d854a121f7cb5f9. Reason for revert: possible chromium cc unit tests failure Change-Id: Ie174c55e4d0fc3ae45854b5897ba26b7ad5a9c13 Reviewed-on: https://skia-review.googlesource.com/6981 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Reland https://skia-review.googlesource.com/c/6091/Gravatar Yuqian Li2017-01-12
| | | | | | | | | | | | | | The only difference is that we now put the guard flag SK_SUPPORT_LEGACY_AAA in SkUserConfig.h instead of SkScan.h. Previously, SkAnalyticEdge.cpp doesn't get that flag from SkScan.h and that caused many problems. BUG=skia: TBR=reed@google.com,caryclark@google.com Change-Id: I7b89d3cb64ad71715101d2a5e8e77be3a8a6fa16 Reviewed-on: https://skia-review.googlesource.com/6972 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Implement Analytic AA for General Paths (with Guard against Chrome)"Gravatar Yuqian Li2017-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 89a0e72287e991cfa2f860f92fad545ca59defe1. Reason for revert: <INSERT REASONING HERE> Original change's description: > Implement Analytic AA for General Paths (with Guard against Chrome) > > I've set up a SK_SUPPORT_LEGACY_AAA flag to guard against Chromium layout tests. I also set that flag in this CL so theoretically this CL won't trigger any GM changes. I'll use this to verify my guard, and remove that flag and actually enables concave AAA in a future CL. > > When enabled, for most simple concave paths (e.g., rectangle stroke, rrect stroke, sawtooth, stars...), the Analytic AA achieves 1.3x-2x speedup, and they look much prettier. And they probably are the majority in our use cases by number. But they probably are not the majority by time cost; a single complicated path may cost 10x-100x more time to render than a rectangle stroke... For those complicated paths, we fall back to supersampling by default as we're likely to be 1.1-1.2x slower and the quality improvement is not visually significant. However, one can use gSkForceAnalyticAA to disable that fallback. > > BUG=skia: > > Change-Id: If9549a3acc4a187cfaf7eb51890c148da3083d31 > Reviewed-on: https://skia-review.googlesource.com/6091 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> > TBR=caryclark@google.com,liyuqian@google.com,reed@google.com BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I13c05aaa1bcb14956bd0fe01bb404e41be75af22 Reviewed-on: https://skia-review.googlesource.com/6961 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Implement Analytic AA for General Paths (with Guard against Chrome)Gravatar Yuqian Li2017-01-12
| | | | | | | | | | | | | I've set up a SK_SUPPORT_LEGACY_AAA flag to guard against Chromium layout tests. I also set that flag in this CL so theoretically this CL won't trigger any GM changes. I'll use this to verify my guard, and remove that flag and actually enables concave AAA in a future CL. When enabled, for most simple concave paths (e.g., rectangle stroke, rrect stroke, sawtooth, stars...), the Analytic AA achieves 1.3x-2x speedup, and they look much prettier. And they probably are the majority in our use cases by number. But they probably are not the majority by time cost; a single complicated path may cost 10x-100x more time to render than a rectangle stroke... For those complicated paths, we fall back to supersampling by default as we're likely to be 1.1-1.2x slower and the quality improvement is not visually significant. However, one can use gSkForceAnalyticAA to disable that fallback. BUG=skia: Change-Id: If9549a3acc4a187cfaf7eb51890c148da3083d31 Reviewed-on: https://skia-review.googlesource.com/6091 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'" This reverts commit c456b73fef9589bbdc5eb83eaa83e53c357bb3da. Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab Reviewed-on: https://skia-review.googlesource.com/6886 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"Gravatar Kevin Lubick2017-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a5494f117086d712855e4b6289c58c92d1549bcf. Reason for revert: Broke Google3 Original change's description: > SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h > > * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). > > * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h > > * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" > > Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 > Reviewed-on: https://skia-review.googlesource.com/4543 > Reviewed-by: Ben Wagner <bungeman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> > TBR=halcanary@google.com,bungeman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5 Reviewed-on: https://skia-review.googlesource.com/6884 Commit-Queue: Kevin Lubick <kjlubick@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* SkTypes.h : move SkAutoMalloc into SkAutoMalloc.hGravatar Hal Canary2017-01-11
| | | | | | | | | | | | | | * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr). * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);" Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88 Reviewed-on: https://skia-review.googlesource.com/4543 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Remove SK_ANALYTIC_AA_GUARD flagGravatar Yuqian Li2016-12-02
| | | | | | | | | BUG=skia: Change-Id: I4e10ba7afc76ed41c6c41275f9b6a5dde3a2a4be Reviewed-on: https://skia-review.googlesource.com/5502 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Use AdditiveBlitter for partial rowsGravatar Yuqian Li2016-11-29
| | | | | | | | | | | | Previously, we forgot to use AdditiveBlitter in two places where partial rows are blitterred. That causes SkAAClip to complain as in skia:6003. BUG=skia:6003 Change-Id: I4f4a896072448bdb3f287a2eb61cb64b1256ea78 Reviewed-on: https://skia-review.googlesource.com/5273 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Use SkFixedMul instead of SkFixedMul_lowprecGravatar Yuqian Li2016-11-17
| | | | | | | | | | | | | | | | | | | It seems that SkFixedMul_lowprec doesn't have too much performance gain (maybe 1%). But its precision loss is siginificant. No serious issues have been found in convex cases, but things get much trickier for concave shapes. I'm removing it now to improve the stability and reliability of our algorithm, which may potentially benefit our Chrome landing. (Even if we do not remove SkFixedMul_lowprec now, we eventually will remove it when we land concave AAA code.) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4926 Change-Id: Iae5739a3780bb77ce6237888eee51a502fea5cf2 Reviewed-on: https://skia-review.googlesource.com/4926 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Turn off all SkDebugfs in SkScan_AAAPath.cppGravatar Yuqian Li2016-11-16
| | | | | | | | | | | | | | TBR=mtklein@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4912 Change-Id: Ia69f2932936e34bc487c9c468bba176de0b2b0df Reviewed-on: https://skia-review.googlesource.com/4912 Reviewed-by: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* No SkDebugf for approximate intersectionGravatar Yuqian Li2016-11-16
| | | | | | | | | | | | | | | TBR=mtklein@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4911 Change-Id: I23bc298186f93c1a97a15d00b34f65cd72f964e7 Reviewed-on: https://skia-review.googlesource.com/4911 Reviewed-by: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix mask overflow caused by edge driftGravatar Yuqian Li2016-11-16
| | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4797 Change-Id: Ica1568b67c1e1ce4aae2bdaba2c5b1f2155d1382 Reviewed-on: https://skia-review.googlesource.com/4797 Reviewed-by: Cary Clark <caryclark@google.com>
* Drop forceRLE to simplify aaa_walk_convex_edgesGravatar Yuqian Li2016-11-16
| | | | | | | | | | | | | | | | | | | | | | | The virtual flush function doesn't seem to affect the performance much. Maybe there's a 1% drop in performance in nanobench against fill_big_triangle and fill_big_circle, but that's too small a change for nanobench to reliabily diffrentiate. The smooth jump (ignore fractional y if edges don't change their directions significantly) no longer needs to be guarded against SkAAClip because our recent CL (https://skia-review.googlesource.com/c/4636/) make left/rightBound much tighter. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4899 Change-Id: If323013b810cc1ff5f6dbb868a8981354ee6f9b5 Reviewed-on: https://skia-review.googlesource.com/4899 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Stan Iliev <stani@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com> Commit-Queue: Stan Iliev <stani@google.com>
* Simplify the signature of sk/aaa_fill_pathGravatar Yuqian Li2016-11-16
| | | | | | | | | | | | | | | Previously, the clipRect is either equal to nullptr or clipRgn's bound (after necessary supersampling shift). Hence we drop one of them to make the signature simpler. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4874 Change-Id: Ied8d5313809d6cf90374365b01f2b8d52f2236e2 Reviewed-on: https://skia-review.googlesource.com/4874 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Catch width overflow in ASAN using int64Gravatar Yuqian Li2016-11-14
| | | | | | | | | | | | | | | This is related with our previous CL: https://skia-review.googlesource.com/c/4628/ That previous CL fix won't pass the ASAN test (../../../include/core/SkRect.h:72:39: runtime error: signed integer overflow: 1 - -2147483648 cannot be represented in type 'int') so we use int64 in this CL. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4785 Change-Id: I39f7329c427d49f4be07588f37120722ac9892c2 Reviewed-on: https://skia-review.googlesource.com/4785 Reviewed-by: Mike Reed <reed@google.com>
* Set analytic AA as default.Gravatar liyuqian2016-11-14
| | | | | | | | | | | We'll use https://codereview.chromium.org/2471123002/ to keep Chrome from using analytic AA until we fix all the Chrome tests. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2471133002 Committed: https://skia.googlesource.com/skia/+/dca4f6530013cf43a2557ccb07f5cb4fd916b8e8 Review-Url: https://codereview.chromium.org/2471133002
* Revert of Set analytic AA as default. (patchset #8 id:140001 of ↵Gravatar liyuqian2016-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2471133002/ ) Reason for revert: SkASSERT triggered in some perf tests. Roll back. Original issue's description: > Set analytic AA as default. > > We'll use https://codereview.chromium.org/2471123002/ to keep Chrome from using > analytic AA until we fix all the Chrome tests. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2471133002 > > Committed: https://skia.googlesource.com/skia/+/dca4f6530013cf43a2557ccb07f5cb4fd916b8e8 TBR=fmalita@chromium.org,msarett@google.com,mtklein@google.com,reed@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2499723002
* Set analytic AA as default.Gravatar liyuqian2016-11-11
| | | | | | | | | | We'll use https://codereview.chromium.org/2471123002/ to keep Chrome from using analytic AA until we fix all the Chrome tests. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2471133002 Review-Url: https://codereview.chromium.org/2471133002
* Tighten SkAAClip Bounds by Path BoundsGravatar liyuqian2016-11-11
| | | | | | | | | | | | | This bug chromium:662780 exists after our original fix (https://codereview.chromium.org/2477393002/) because this path (added in unit test) is calling blitAntiRect rather than blitAntiH when the path is drifted across the boundary. (The quadratic edge drifts across the boundary after an update and sets a dX=0 line segment which triggers blitAntiRect.) Note that I didn't assert for the dLeft = dRite = 0 case because the left/right there won't drift after the SkTMin/SkTMax in line 964/966. Theoretically we can revert the relaxation in https://codereview.chromium.org/2477393002/ (that's only a relaxation for analytic AA, not supersampled AA). However, consider that the initial landing of analytic AA is so painful, I decide to revert that relaxation only after our successful landing... BUG=chromium:662780, chromium:662862 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2482193004 Review-Url: https://codereview.chromium.org/2482193004