op/clip,gpu,internal/scene: encode cubic bézier curves natively

The compute renderer supports cubic curves, so encode them as such.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-03-11 18:34:45 +01:00
parent f1ae923a89
commit 9e79cee447
4 changed files with 130 additions and 70 deletions
+7
View File
@@ -706,6 +706,13 @@ func encodePath(pathData []byte, stroke clip.StrokeStyle, dashes dashOp) encoder
}
hasPrev = true
prevTo = to
case scene.OpFillCubic:
from, _, _, to := scene.DecodeCubic(cmd)
if hasPrev && from != prevTo {
enc.scene[len(enc.scene)-1][0] |= (flagEndPath << 16)
}
hasPrev = true
prevTo = to
default:
panic("unsupported path scene command")
}