op/clip: split Rect into pixel-aligned Rect and rounded RRect

The pixel-aligned Rect is more efficient and easier to use in the common case
of layout clipping.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-07-09 18:06:00 +02:00
parent 4818538ef8
commit d572aa23ac
14 changed files with 105 additions and 116 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ func TestClipping(t *testing.T) {
Y: float32(sz.Y),
}}}
paint.ColorOp{Color: col}.Add(&ops)
clip.Rect{
clip.RRect{
Rect: f32.Rectangle{
Min: f32.Point{X: 50, Y: 50},
Max: f32.Point{X: 250, Y: 250},
@@ -64,7 +64,7 @@ func TestClipping(t *testing.T) {
}.Add(&ops)
pop.Add(&ops)
paint.ColorOp{Color: col2}.Add(&ops)
clip.Rect{
clip.RRect{
Rect: f32.Rectangle{
Min: f32.Point{X: 100, Y: 100},
Max: f32.Point{X: 350, Y: 350},