ui/input/system: introduce package for system events

And add ProfileOp and ProfileEvent for registering and receiving
profile data.

Remove the Profiling field and Timings method from app.Window.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-12 15:31:29 +02:00
parent 032e9a380e
commit 86533ae683
4 changed files with 70 additions and 11 deletions
+4 -1
View File
@@ -23,6 +23,7 @@ const (
TypePop
TypeAux
TypeClip
TypeProfile
)
const (
@@ -43,6 +44,7 @@ const (
TypePopLen = 1
TypeAuxLen = 1 + 4
TypeClipLen = 1 + 4*4
TypeProfileLen = 1
)
func (t OpType) Size() int {
@@ -64,12 +66,13 @@ func (t OpType) Size() int {
TypePopLen,
TypeAuxLen,
TypeClipLen,
TypeProfileLen,
}[t-firstOpIndex]
}
func (t OpType) NumRefs() int {
switch t {
case TypeBlock, TypeImage, TypeKeyHandler, TypePointerHandler:
case TypeBlock, TypeImage, TypeKeyHandler, TypePointerHandler, TypeProfile:
return 1
default:
return 0