Other code outside this namespace will want to use this method soon.
Bug: skia:10419
Change-Id: Ib155f224866fd333b8f9a4b78e6c9e51ac0600df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311936
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Adds a method to determine the worst-case number of tessellated line
segments that a path might require, and disables hardware tessellation
if it is more segments than are supported (falling back on indirect
draw shaders).
If the path requires even more segments than are supported by the
indirect draw shaders (1024), we crop the path to the viewport. The
required number of segments is proportional to the square root of the
bounding box's diagonal, so we won't start cropping paths until their
device-space bounding box diagonal is nearly 175,000 pixels long.
Change-Id: I8a9435e70bb93dda3464cc11a3e44fbe511744ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293691
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This is a reland of e278e1c1c7
Original change's description:
> Add an implementation and log2 variants for Wang's formula
>
> Wang's formulas for cubics and quadratics (1985) tell us how many line
> segments a curve must be chopped into when tessellating. This CL adds
> an implementation along with optimized log2 variants, as well as tests
> and a benchmark.
>
> Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com
Change-Id: Ie3822c62439fc579a59ea8adb49583224de41aa5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289680
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit e278e1c1c7.
Reason for revert: i think we need to do that add with an unsigned, or test instead of always += (1<<23)-1.
Original change's description:
> Add an implementation and log2 variants for Wang's formula
>
> Wang's formulas for cubics and quadratics (1985) tell us how many line
> segments a curve must be chopped into when tessellating. This CL adds
> an implementation along with optimized log2 variants, as well as tests
> and a benchmark.
>
> Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,brianosman@google.com,csmartdalton@google.com
Change-Id: I24dfd8549054b632f38f7b05b4d857b640cf5cd1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289658
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Wang's formulas for cubics and quadratics (1985) tell us how many line
segments a curve must be chopped into when tessellating. This CL adds
an implementation along with optimized log2 variants, as well as tests
and a benchmark.
Change-Id: I3f777b8d0312c57c3a1cc24307de5945c70be287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288321
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>