aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBlitter.cpp
Commit message (Collapse)AuthorAge
* Check negative width before blitAntiRectGravatar Yuqian Li2018-04-26
| | | | | | | | | | | Since we decrease the width when clipped, it might be negative. Bug: skia:7858 Change-Id: I348bd07d917905a55bec1a4b4e0915c6528fe6b1 Reviewed-on: https://skia-review.googlesource.com/123927 Auto-Submit: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix variable name collisionGravatar Yuqian Li2018-04-23
| | | | | | | | | | Bug: skia: Change-Id: I0b62ae9dac14d75e94d2c29d335703d41fee77ed Reviewed-on: https://skia-review.googlesource.com/123280 Commit-Queue: Yuqian Li <liyuqian@google.com> Commit-Queue: Stan Iliev <stani@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com> Reviewed-by: Stan Iliev <stani@google.com>
* Clip the SkAntiRect because of possible tilingsGravatar Yuqian Li2018-04-23
| | | | | | | | | | | | Otherwise, the AndroidShadow will crash or draw incorrectly for the threaded backend with # tiles >= 3. Bug: skia: Change-Id: If3c3b41f3576b1c44178d6343626e99be64e766b Reviewed-on: https://skia-review.googlesource.com/122953 Commit-Queue: Yuqian Li <liyuqian@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* Reland "Fix the fat rect bug in the threaded backend"Gravatar Yuqian Li2018-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1b637615144604a2d50cf983ac9aa5aab71cf73b. Reason for revert: add guard flag Original change's description: > Revert "Fix the fat rect bug in the threaded backend" > > This reverts commit c41569a29fde10c6fec43cc4593334e9a4b34b76. > > Reason for revert: maybe break the Chrome layout tests > > Original change's description: > > Fix the fat rect bug in the threaded backend > > > > Bug: skia:7813 > > Change-Id: I954232be1dccc63ce412ccde92c4f0e4617317b9 > > Reviewed-on: https://skia-review.googlesource.com/121641 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > TBR=caryclark@google.com,liyuqian@google.com,reed@google.com > > Change-Id: If35617a9774b3367561981e39a2fa89a972684b9 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7813 > Reviewed-on: https://skia-review.googlesource.com/121820 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7813 Change-Id: I8b17be4251b5efc20142295cca787474f32e3a86 Reviewed-on: https://skia-review.googlesource.com/122100 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Revert "Fix the fat rect bug in the threaded backend"Gravatar Yuqian Li2018-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c41569a29fde10c6fec43cc4593334e9a4b34b76. Reason for revert: maybe break the Chrome layout tests Original change's description: > Fix the fat rect bug in the threaded backend > > Bug: skia:7813 > Change-Id: I954232be1dccc63ce412ccde92c4f0e4617317b9 > Reviewed-on: https://skia-review.googlesource.com/121641 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com Change-Id: If35617a9774b3367561981e39a2fa89a972684b9 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7813 Reviewed-on: https://skia-review.googlesource.com/121820 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix the fat rect bug in the threaded backendGravatar Yuqian Li2018-04-17
| | | | | | | | Bug: skia:7813 Change-Id: I954232be1dccc63ce412ccde92c4f0e4617317b9 Reviewed-on: https://skia-review.googlesource.com/121641 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* 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>
* SkBlitter is not thread safe; make one for each thread.Gravatar Yuqian Li2018-04-16
| | | | | | | | | | | | | | | Otherwise, GM fancy_gradients would be drawn incorrectly and TSAN will issue alerts as SkARGB32_Shader_Blitter has its own memory that may be written during blitting. As we make one blitter for each thread, we also don't need to send in a thread-alloc for blitCoverageDeltas Bug: skia: Change-Id: Ie4ee0886b88c797ab57c65674b0b7527501b164f Reviewed-on: https://skia-review.googlesource.com/120641 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Reland "Cumulate deltas even if they're out of the clip"Gravatar Yuqian Li2018-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ffbe93296838c3a93a87261cae7f7229b56f1f8a. Reason for revert: guard flag is now in Original change's description: > Revert "Cumulate deltas even if they're out of the clip" > > This reverts commit 520e578b9987ea99b8ee62b485e941b3d5d96e0f. > > Reason for revert: guard flag isn't in yet > > Original change's description: > > Cumulate deltas even if they're out of the clip > > > > Otherwise, GM complexclip_aa_inverse will be drawn incorrectly > > in t8888 mode. > > > > Bug: skia: > > Change-Id: I2fe9dd94f3219e3883f713ca95ea3c3d8a49c7ba > > Reviewed-on: https://skia-review.googlesource.com/121261 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > TBR=caryclark@google.com,liyuqian@google.com,reed@google.com > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: skia: > Change-Id: If7fa2a8bd1ff3e9b55c3900cbba82a3e2562f502 > Reviewed-on: https://skia-review.googlesource.com/121424 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com Change-Id: I4ec1fec53782a106407d1398c43cab748fd5f259 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/121600 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Cumulate deltas even if they're out of the clip"Gravatar Yuqian Li2018-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 520e578b9987ea99b8ee62b485e941b3d5d96e0f. Reason for revert: guard flag isn't in yet Original change's description: > Cumulate deltas even if they're out of the clip > > Otherwise, GM complexclip_aa_inverse will be drawn incorrectly > in t8888 mode. > > Bug: skia: > Change-Id: I2fe9dd94f3219e3883f713ca95ea3c3d8a49c7ba > Reviewed-on: https://skia-review.googlesource.com/121261 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: If7fa2a8bd1ff3e9b55c3900cbba82a3e2562f502 Reviewed-on: https://skia-review.googlesource.com/121424 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Cumulate deltas even if they're out of the clipGravatar Yuqian Li2018-04-14
| | | | | | | | | | | Otherwise, GM complexclip_aa_inverse will be drawn incorrectly in t8888 mode. Bug: skia: Change-Id: I2fe9dd94f3219e3883f713ca95ea3c3d8a49c7ba Reviewed-on: https://skia-review.googlesource.com/121261 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* use commonPaint for all raster pipelineGravatar Mike Klein2018-04-09
| | | | | | | | | | Looks like a typo? Change-Id: Ie5a1ab546d4d658a864e3362319883f2bf46c111 Reviewed-on: https://skia-review.googlesource.com/119942 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* remove SK_IGNORE_TO_STRINGGravatar Cary Clark2018-04-05
| | | | | | | | | | | | | | | | | | | SK_IGNORE_TO_STRING is not defined anywhere. The same effect can be had by using a modern linker. Removing it simplifies bookmaker and makes our includes easier to understand. R=robertphillips@google.com TBR=reed@google.com Bug: skia:6898 Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f Reviewed-on: https://skia-review.googlesource.com/118963 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* Banish SkShaderBase::isRasterPipelineOnly()Gravatar Florin Malita2018-04-04
| | | | | | | | | | | | | | | | | Keeping related heuristics in sync with actual shader capabilities is somewhat tricky, and overall fragile. So how about this: instead of an explicit opt-in mechanism, try to instantiate a legacy shader context and fall back to raster pipeline on failure (null Context => implicit opt-in for raster pipeline). Shaders can still choose not to draw by returning both a null Context and failing appendStages(). BUG=skia:7772 Change-Id: I2e76f51af7064853a6cb851b4c30c82eba3ee828 Reviewed-on: https://skia-review.googlesource.com/118383 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@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>
* Revert "Check the boundary while cumulating deltas in a mask"Gravatar Yuqian Li2018-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Check the boundary while cumulating deltas in a maskGravatar Yuqian Li2018-03-09
| | | | | | | | | | | | | | | | | 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>
* fix crasher in path-->regionGravatar Mike Reed2018-02-27
| | | | | | | | | Bug: skia:7491 Change-Id: I7e8b9fbe43098094d5935331107c3f40fb6971ec Reviewed-on: https://skia-review.googlesource.com/110721 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Enable DAA in the init-once phase of threaded backendsGravatar Yuqian Li2018-02-21
| | | | | | | | Bug: skia: Change-Id: Idb856fe12f0f9fa1014e7d15ef40bd7b456634d6 Reviewed-on: https://skia-review.googlesource.com/107540 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add init-once to threaded backendGravatar Yuqian Li2018-02-12
| | | | | | | | | | | | For the simplicity of this CL, I haven't enabled DAA for init-once yet. The current init-once is only enabled for draw path, and it simply generates the dev path in the init-once phase. Bug: skia: Change-Id: Ie9a9ef9fc453acbdeb48b06b93d578c626961e3f Reviewed-on: https://skia-review.googlesource.com/87784 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Herb Derby <herb@google.com>
* move the guts of SkMaskFilter.h into SkMaskFilterBase.hGravatar Mike Reed2018-01-23
| | | | | | | | | Bug: skia: Change-Id: I29ad0960156562867429542d3cfbf3d639529cab Reviewed-on: https://skia-review.googlesource.com/98802 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Revert "Snap alpha for small rects""""Gravatar Yuqian Li2018-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ea560af463c2a791c7c320a81828e5f407360c84. Reason for revert: the guard flag is now in Google3 Original change's description: > Revert "Revert "Revert "Snap alpha for small rects""" > > This reverts commit 15150a60ebea7b268493d0595cec7db9a5465fac. > > Reason for revert: we suspect this is behind the roll failures > > Original change's description: > > Revert "Revert "Snap alpha for small rects"" > > > > This reverts commit 131c8ea4b7ffad7ebf6c49cf9337602f1249806d. > > > > Reason for revert: the CL does not seem to have caused any failures > > > > Original change's description: > > > Revert "Snap alpha for small rects" > > > > > > This reverts commit 52f8e71a45ead72f257317f82775eb3459b71eae. > > > > > > Reason for revert: possibly causing Google3 roll failure? > > > > > > Original change's description: > > > > Snap alpha for small rects > > > > > > > > This is more similar to our alpha snapping in AAA. More critically, we > > > > may have a tiny alpha difference after some 90 degree rotations and that > > > > breaks the Chromium svg layout tests (where the expected reference is a > > > > rotated svg...) > > > > > > > > TBR: fmalita@google.com > > > > Bug: skia: > > > > Change-Id: I59b750153488083f65b731643e0baca823cb78e4 > > > > Reviewed-on: https://skia-review.googlesource.com/92940 > > > > Reviewed-by: Yuqian Li <liyuqian@google.com> > > > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > > > > > TBR=mtklein@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com > > > > > > Change-Id: I2ca0b9375caa473dc2f407655b17603b68337c1f > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia: > > > Reviewed-on: https://skia-review.googlesource.com/93323 > > > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > > > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > > > > TBR=mtklein@google.com,ethannicholas@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com > > > > Change-Id: I0cb343fa5448ecf0e6a2073bb4e3603275d6984c > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/93680 > > Reviewed-by: Yuqian Li <liyuqian@google.com> > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > TBR=mtklein@google.com,ethannicholas@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com > > Change-Id: If00c7c8cb6b44c489615444b9aca5a2f25b2d5fe > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/93860 > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> TBR=mtklein@google.com,ethannicholas@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: I68d6b968460f0541d658a8641ca5e147405292d0 Reviewed-on: https://skia-review.googlesource.com/94540 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Revert "Revert "Snap alpha for small rects"""Gravatar Ethan Nicholas2018-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 15150a60ebea7b268493d0595cec7db9a5465fac. Reason for revert: we suspect this is behind the roll failures Original change's description: > Revert "Revert "Snap alpha for small rects"" > > This reverts commit 131c8ea4b7ffad7ebf6c49cf9337602f1249806d. > > Reason for revert: the CL does not seem to have caused any failures > > Original change's description: > > Revert "Snap alpha for small rects" > > > > This reverts commit 52f8e71a45ead72f257317f82775eb3459b71eae. > > > > Reason for revert: possibly causing Google3 roll failure? > > > > Original change's description: > > > Snap alpha for small rects > > > > > > This is more similar to our alpha snapping in AAA. More critically, we > > > may have a tiny alpha difference after some 90 degree rotations and that > > > breaks the Chromium svg layout tests (where the expected reference is a > > > rotated svg...) > > > > > > TBR: fmalita@google.com > > > Bug: skia: > > > Change-Id: I59b750153488083f65b731643e0baca823cb78e4 > > > Reviewed-on: https://skia-review.googlesource.com/92940 > > > Reviewed-by: Yuqian Li <liyuqian@google.com> > > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > > > TBR=mtklein@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com > > > > Change-Id: I2ca0b9375caa473dc2f407655b17603b68337c1f > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/93323 > > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > > TBR=mtklein@google.com,ethannicholas@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com > > Change-Id: I0cb343fa5448ecf0e6a2073bb4e3603275d6984c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/93680 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=mtklein@google.com,ethannicholas@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com Change-Id: If00c7c8cb6b44c489615444b9aca5a2f25b2d5fe No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/93860 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
* Revert "Revert "Snap alpha for small rects""Gravatar Yuqian Li2018-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 131c8ea4b7ffad7ebf6c49cf9337602f1249806d. Reason for revert: the CL does not seem to have caused any failures Original change's description: > Revert "Snap alpha for small rects" > > This reverts commit 52f8e71a45ead72f257317f82775eb3459b71eae. > > Reason for revert: possibly causing Google3 roll failure? > > Original change's description: > > Snap alpha for small rects > > > > This is more similar to our alpha snapping in AAA. More critically, we > > may have a tiny alpha difference after some 90 degree rotations and that > > breaks the Chromium svg layout tests (where the expected reference is a > > rotated svg...) > > > > TBR: fmalita@google.com > > Bug: skia: > > Change-Id: I59b750153488083f65b731643e0baca823cb78e4 > > Reviewed-on: https://skia-review.googlesource.com/92940 > > Reviewed-by: Yuqian Li <liyuqian@google.com> > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > TBR=mtklein@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com > > Change-Id: I2ca0b9375caa473dc2f407655b17603b68337c1f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/93323 > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> TBR=mtklein@google.com,ethannicholas@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com Change-Id: I0cb343fa5448ecf0e6a2073bb4e3603275d6984c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/93680 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Snap alpha for small rects"Gravatar Ethan Nicholas2018-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 52f8e71a45ead72f257317f82775eb3459b71eae. Reason for revert: possibly causing Google3 roll failure? Original change's description: > Snap alpha for small rects > > This is more similar to our alpha snapping in AAA. More critically, we > may have a tiny alpha difference after some 90 degree rotations and that > breaks the Chromium svg layout tests (where the expected reference is a > rotated svg...) > > TBR: fmalita@google.com > Bug: skia: > Change-Id: I59b750153488083f65b731643e0baca823cb78e4 > Reviewed-on: https://skia-review.googlesource.com/92940 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=mtklein@google.com,fmalita@chromium.org,liyuqian@google.com,reed@google.com Change-Id: I2ca0b9375caa473dc2f407655b17603b68337c1f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/93323 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
* Snap alpha for small rectsGravatar Yuqian Li2018-01-10
| | | | | | | | | | | | | | This is more similar to our alpha snapping in AAA. More critically, we may have a tiny alpha difference after some 90 degree rotations and that breaks the Chromium svg layout tests (where the expected reference is a rotated svg...) TBR: fmalita@google.com Bug: skia: Change-Id: I59b750153488083f65b731643e0baca823cb78e4 Reviewed-on: https://skia-review.googlesource.com/92940 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Avoid double-destruction of Sk3DShaderContext-wrapped objectsGravatar Florin Malita2017-11-29
| | | | | | | | | | | | | | | Sk3DShaderContext creates its nested shader context on a SkArenaAlloc, which handles destruction when going out of scope. Hence, the explicit context dtor call in ~Sk3DShaderContext() is incorrect (likely left over from before SkArenaAlloc). BUG=chromium:787712 Change-Id: I176222e449151dcce532a839ef9587d06f61d297 Reviewed-on: https://skia-review.googlesource.com/77203 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com>
* experiments to speed up drawing 32bit images into 565Gravatar Mike Reed2017-10-05
| | | | | | | | | | | | New (legacy style) blitters only coded for shaders (and very restricted blendmodes) Bug: skia: See https://buganizer.corp.google.com/issues/64884885 Change-Id: Ie2546093bfe1e670a825dfd9542d252d53732c40 Reviewed-on: https://skia-review.googlesource.com/54103 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@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>
* make most of SkColorPriv.h privateGravatar Cary Clark2017-09-15
| | | | | | | | | | | | | created new file src/core/SkColorData.h for internal consumption. Note that many of the functions there are unused as well. Bug: skia: 6898 R: reed@google.com Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d Reviewed-on: https://skia-review.googlesource.com/46848 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com>
* 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 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>
* 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>
* Assume HQ is handled by pipeline, delete legacy code-pathGravatar Mike Reed2017-07-20
| | | | | | | | | CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Bug: skia: Change-Id: If6f0d0a57463bf99a66d674e65a62ce3931d0116 Reviewed-on: https://skia-review.googlesource.com/24644 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* experimental: draw into unpremulGravatar Mike Reed2017-07-19
| | | | | | | | | | raster-only Bug: skia: Change-Id: I3af19f031083c9cc258f73ba6a2f6020bb15f110 Reviewed-on: https://skia-review.googlesource.com/24400 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Add some raster pipeline perspective assertsGravatar Florin Malita2017-07-12
| | | | | | | | | | | | | | | | | | | | | I meant to add these when removing the guard, but since we landed without a guard, might as well do it now. A couple of things exposed by these asserts: 1) we need to also catch perspective in local matrices 2) we need to disallow burst mode with perspective Also tweak the predicate to hasPerspective() instead of explicit mask check. Change-Id: I099e5125fca52dccffca77c60fc800bbdf539b53 Reviewed-on: https://skia-review.googlesource.com/22483 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Always use raster pipeline for perspectiveGravatar Florin Malita2017-07-12
| | | | | | | | | Change-Id: I6205769ea77e12647985496a5c74d3754edd3108 Reviewed-on: https://skia-review.googlesource.com/22365 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Reed <reed@google.com>
* remove unused flag SK_SUPPORT_LEGACY_COLORFILTER_FILTERSPANGravatar Mike Reed2017-06-29
| | | | | | | | Bug: skia: Change-Id: I884f79f9a162f38365930d1ccca889fca2850557 Reviewed-on: https://skia-review.googlesource.com/21202 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* use rasterpipline for hq scalingGravatar Mike Reed2017-06-28
| | | | | | | | | Bug: skia: Change-Id: Ic67f869ba35be17d49d371bb7f3fa60b6b2e20ee Reviewed-on: https://skia-review.googlesource.com/21105 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* use rasterpipeline for colorfiltersGravatar Mike Reed2017-06-25
| | | | | | | | Bug: skia: Change-Id: Ia0e88f3ae29d026843ac7beb2aee3c891123ce18 Reviewed-on: https://skia-review.googlesource.com/20773 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Disable dithering of const paintsGravatar Florin Malita2017-06-19
| | | | | | | | | | | | ... except for 565. Change-Id: I8ab633661c54583478234a46942ef804eb74a619 Reviewed-on: https://skia-review.googlesource.com/19880 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com>
* remove dead code associated with SK_SUPPORT_LEGACY_RASTERPIPELINEGravatar Mike Reed2017-06-12
| | | | | | | | | | | | | Now we just look at the paint to decide if the user wants to dither. Needs this to land first: https://skia-review.googlesource.com/c/19448/ Bug: skia: Change-Id: I31940696e114922bcc8fb9ca3c24c2eb0a622800 Reviewed-on: https://skia-review.googlesource.com/19496 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* add testing flag to force rasterpipelineGravatar Mike Reed2017-06-05
| | | | | | | | Bug: skia: Change-Id: I8e195e90dc00b9be9072858086f7541e993428da Reviewed-on: https://skia-review.googlesource.com/18585 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* have start_pipeline() return limit againGravatar Mike Klein2017-06-05
| | | | | | | | | | | | | | | | | | | This is spooky. I don't quite yet understand why, but this makes things much faster. Performance regressed across the board when we no longer needed the value and changed it to return void: https://perf.skia.org/e/?begin=1496176469&keys=6994&xbaroffset=28513 You can see similar regressions following this Chromium bug link. BUG=chromium:729237 Change-Id: I68371b0456014f909acf819aca52aa4f4f187460 Reviewed-on: https://skia-review.googlesource.com/18580 Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove unused blittersGravatar Mike Reed2017-06-03
| | | | | | | | Bug: skia: Change-Id: Iaa2ead32a4025071c3592f83d47f174ffeb63a49 Reviewed-on: https://skia-review.googlesource.com/18530 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* force SkRasterPipeline when using complex blendsGravatar Mike Klein2017-05-25
| | | | | | | | | | | | | | | | | | | | Looks like we're faster than legacy pretty much across the board. out/nanobench -m Hue Saturation Luminosity Color\$ Color_aa\$ --config 8888 -q --ms 2000 Xfermode_Luminosity 80128.68 -> 27189.83 Xfermode_Luminosity_aa 18001.46 -> 14449.67 Xfermode_Color 183520.09 -> 27448.49 Xfermode_Color_aa 34257.75 -> 14694.85 Xfermode_Saturation 80323.96 -> 36449.01 Xfermode_Saturation_aa 19605.81 -> 18576.62 Xfermode_Hue 125866.82 -> 36611.03 Xfermode_Hue_aa 25318.00 -> 18489.33 Change-Id: I842b8f53fb356bf1a5e81502be88e4b34d4ad0dc Reviewed-on: https://skia-review.googlesource.com/17992 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove unused PM4f blittersGravatar Florin Malita2017-05-25
| | | | | | | | Change-Id: I19106b70ba19bffb04ae0517225fce2169ab5f33 Reviewed-on: https://skia-review.googlesource.com/17990 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Reland of SkShaderBaseGravatar Florin Malita2017-05-25
| | | | | | | | | | Introduce a private base class (SkShaderBase), to hide implementation details from the public interface (SkShader). Change-Id: Ib1d76cde880bd51868b97408710f8bb38128e536 Reviewed-on: https://skia-review.googlesource.com/17925 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Revert "SkShaderBase"Gravatar Florin Malita2017-05-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 58a756435ca3700d9766a4580bb0771a9774f603. Reason for revert: g3, Android borkage. Original change's description: > SkShaderBase > > Introduce a private base class (SkShaderBase), to hide > implementation details from the public interface (SkShader). > > Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176 > Reviewed-on: https://skia-review.googlesource.com/17241 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I32b012ee466dd006c074593f211f43ed602f1078 Reviewed-on: https://skia-review.googlesource.com/17845 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>