commit | 26d8d77aae56c20b7174ac06056c1e5ec7903e6b | [log] [tgz] |
---|---|---|

author | Mike Reed <reed@google.com> | Tue Nov 27 13:41:57 2018 -0500 |

committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Tue Nov 27 19:36:36 2018 +0000 |

tree | f2fc34e09b385f29b2c04aa9e1b0172866863b50 | |

parent | b8c363836398ec19de70e77bd2b366f5cfa0e142 [diff] |

don't trust convexity with affine transforms In theory, a convex shape transformed by an affine matrix should still be convex. However, due to numerical nastiness of floats, when we try to determine if something is convex, we can get different answers pre and post a transformation (think of two line segments nearly colinear). Convex paths take a faster scan converter, but it is only well behaved if the path is, in fact, convex. Thus we have to be conservative about which paths we mark as convex. This bug found a case where a "convex" path, after going through a transform, became (according to our measure) non-convex. The bug was that we *thought* that once convex always convex, but in reality it was not. The fix (hack) is to notice when we transform by an affine matrix (we're still assuming/hoping that scaling and translate keep things convex (1)...) and mark the convexity as "unknown", forcing us to re-compute it. This will slow down these paths, since it costs something to compute convexity. Hopefully non-scale-translate transforms are rare, so we won't notice the speed loss too much. (1) This is not proven. If we find scaling/translation to break our notion of convexity, we'll need to get more aggressive/clever to find a fix. Bug: 899689 Change-Id: I5921eca247428bf89380bc2395fe373fa70deb1d Reviewed-on: https://skia-review.googlesource.com/c/173080 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>

2 files changed

tree: f2fc34e09b385f29b2c04aa9e1b0172866863b50

- animations/
- bench/
- bin/
- dm/
- docker/
- docs/
- example/
- experimental/
- fuzz/
- gm/
- gn/
- include/
- infra/
- modules/
- platform_tools/
- resources/
- samplecode/
- site/
- src/
- tests/
- third_party/
- tools/
- .clang-format
- .gitignore
- .gn
- AUTHORS
- BUILD.gn
- codereview.settings
- CONTRIBUTING
- CQ_COMMITTERS
- DEPS
- Doxyfile
- LICENSE
- OWNERS
- PRESUBMIT.py
- public.bzl
- README
- README.chromium
- whitespace.txt