ui: introduce OpColor, a specialized OpImage for uniform colors

To avoid allocating an image.Image for OpImage.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-06-01 13:01:51 +02:00
parent 0061c73a89
commit 00a87f542d
3 changed files with 45 additions and 1 deletions
+3
View File
@@ -29,6 +29,7 @@ const (
TypeClip
TypeImage
TypeDraw
TypeColor
TypePointerHandler
TypeKeyHandler
TypeHideInput
@@ -45,6 +46,7 @@ const (
TypeClipLen = 1 + 4
TypeImageLen = 1 + 4 + 4*4
TypeDrawLen = 1 + 4*4
TypeColorLen = 1 + 4
TypePointerHandlerLen = 1 + 4 + 4 + 1
TypeKeyHandlerLen = 1 + 4 + 1
TypeHideInputLen = 1
@@ -61,6 +63,7 @@ var typeLengths = [...]int{
TypeClipLen,
TypeImageLen,
TypeDrawLen,
TypeColorLen,
TypePointerHandlerLen,
TypeKeyHandlerLen,
TypeHideInputLen,