io/pointer: re-introduce PassOp

A previous change merged PassOp with AreaOp under the assumption that
the pass mode would be set on a particular area. That assumption turns
out not to hold, so this change brings back PassOp as an independent
stack operation.

This is an API change: replace AreaOp{Pass: true} with a separate
pointer.PassOp operation.

Fixes gio#288

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-10-09 16:27:24 +02:00
parent 61a3395879
commit 960f3068a1
5 changed files with 58 additions and 29 deletions
+13 -2
View File
@@ -23,7 +23,7 @@ type Ops struct {
nextStateID int
macroStack stack
stacks [3]stack
stacks [4]stack
}
type OpType byte
@@ -45,6 +45,8 @@ const (
TypeLinearGradient
TypeArea
TypePopArea
TypePass
TypePopPass
TypePointerInput
TypeClipboardRead
TypeClipboardWrite
@@ -88,6 +90,7 @@ const (
ClipStack StackKind = iota
AreaStack
TransStack
PassStack
)
const (
@@ -102,8 +105,10 @@ const (
TypePaintLen = 1
TypeColorLen = 1 + 4
TypeLinearGradientLen = 1 + 8*2 + 4*2
TypeAreaLen = 1 + 1 + 1 + 4*4
TypeAreaLen = 1 + 1 + 4*4
TypePopAreaLen = 1
TypePassLen = 1
TypePopPassLen = 1
TypePointerInputLen = 1 + 1 + 1 + 2*4 + 2*4
TypeClipboardReadLen = 1
TypeClipboardWriteLen = 1
@@ -313,6 +318,8 @@ func (t OpType) Size() int {
TypeLinearGradientLen,
TypeAreaLen,
TypePopAreaLen,
TypePassLen,
TypePopPassLen,
TypePointerInputLen,
TypeClipboardReadLen,
TypeClipboardWriteLen,
@@ -370,6 +377,10 @@ func (t OpType) String() string {
return "Area"
case TypePopArea:
return "PopArea"
case TypePass:
return "Pass"
case TypePopPass:
return "PopPass"
case TypePointerInput:
return "PointerInput"
case TypeClipboardRead: