-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayerdrawing.go
More file actions
29 lines (23 loc) · 899 Bytes
/
layerdrawing.go
File metadata and controls
29 lines (23 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package touch
import (
"image"
"image/color"
"image/draw"
)
// DrawingContext is used for both buffered and unbuffered drawing.
// See LayerImageBuffer and DisplayRect.
type DrawingContext interface {
Image() *image.RGBA
Bounds() image.Rectangle
// PutRow writes a row of pixel data into the receiver at (x, y)
// The receiver is responsible for bounds checking:
// x and y may be negative, and x, y, and y + len(row) may exceed receiver's dimensions
DrawRow(row []byte, x, y int, op draw.Op)
// Fill a rect (possibly rounded) with color.
// Radius indicates a corner radius that will be efficiently masked.
Fill(rect image.Rectangle, color color.Color, radius int)
// Marks this drawing context as needing to be flushed after drawing.
SetDirty(rect image.Rectangle)
// Returns a DrawingContext masked to the intersection with rect.
Clip(rect image.Rectangle) DrawingContext
}