Commit Graph

8 Commits

Author SHA1 Message Date
Chris Dalton
b96995d05f Handle tessellated paths that require more segments than are supported
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>
2020-06-05 15:33:19 +00:00
Chris Dalton
0d0758e42a Wire up mouse and keyboard events in CanvasKit viewer
Change-Id: I10b57f18edb516b48be3ba16f98a540370ec689f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292793
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-05-29 17:24:30 +00:00
Mike Reed
1f60733fb3 Revert "Revert "move onto new factories for SkMatrix""
This reverts commit c80ee456ad.

fix: update flutter's gn file to add guard

Change-Id: Iac5171c8475d9a862d06255dab1c6f38f10de2f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-21 16:58:39 +00:00
Mike Reed
c80ee456ad Revert "move onto new factories for SkMatrix"
This reverts commit 046c2b7d90.

Reason for revert: need to update/guard flutter

Original change's description:
> move onto new factories for SkMatrix
> 
> Just rename, no functional changes expected.
> 
> Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: Ic74f177128913374b8c60b4df88f04cf72fbacb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291359
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-21 16:05:20 +00:00
Mike Reed
046c2b7d90 move onto new factories for SkMatrix
Just rename, no functional changes expected.

Change-Id: Id77ab1cf6b1cab35087a7c56000750912cf47383
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290831
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-05-21 15:04:09 +00:00
Chris Dalton
8d3eb24f2e Delete ToolUtils::set_path_pt
This can be done more simply with SkPathRef::Editor::writablePoints.

Change-Id: Icef31bf3a6cc2c8c4ef6da36167c574c73a0d944
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287497
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-05-04 19:00:57 +00:00
Chris Dalton
f9aea7f7e5 Add a tessellation mode that triangulates the inner polygon separately
Wedges fanning out from the center work fine for relatively simple
paths, but for paths made up of thousands of verbs, a fan is an
inefficient triangulation to give the rasterizer. This CL adds a
tessellation mode that draws the inner polygon and standalone cubics
separately, and triangulates the inner polygon by recursive
subdivision.

This reduces the stencil time from 7.4ms -> 3.0ms on desk_ynevsvg.skp.

Change-Id: Ie56e760d98e6c69e9a97752fe851726f36a7f574
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265522
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-22 17:01:06 +00:00
Chris Dalton
b832ce61ee Add a path renderer that uses GPU tessellation
Implements a simple first pass for a path renderer that uses the
classic Red Book "stencil then cover" method, and linearizes curves
with GPU tessellation shaders.

The new path renderer is disabled by default, and can only be enabled
in the viewer UI or by passing the "--pr gtess" flag.

Change-Id: Ic9354952e93c8b108577961760b4f0daa82d35aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261715
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-07 20:00:22 +00:00