mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
op/clip: compute bounds during Path build
The current renderer transforms and processes paths before sending them to the GPU. It can compute bounds during processing. The new renderer passes paths verbatim to the GPU, but needs the bounds for constructing clip bounds. This change computes the bounds during construction, so it is available at use. As a bonus for storing the bounds with the path, path caches (such as for storing text fragments) automatically reuse the bounds calculations as well. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-2
@@ -760,8 +760,7 @@ func (r *renderer) packStencils(pops *[]*pathOp) {
|
||||
*pops = ops
|
||||
}
|
||||
|
||||
// intersects intersects clip and b where b is offset by off.
|
||||
// ceilRect returns a bounding image.Rectangle for a f32.Rectangle.
|
||||
// boundRectF returns a bounding image.Rectangle for a f32.Rectangle.
|
||||
func boundRectF(r f32.Rectangle) image.Rectangle {
|
||||
return image.Rectangle{
|
||||
Min: image.Point{
|
||||
|
||||
Reference in New Issue
Block a user