File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ package pixel
15
15
//
16
16
// Whenever you change the Triangles, call Dirty to notify Drawer that Triangles changed. You don't
17
17
// need to notify Drawer about a change of the Picture.
18
+ //
19
+ // Note, that Drawer caches the results of MakePicture from Targets it's drawn to for each Picture
20
+ // it's set to. What it means is that using a Drawer with an unbounded number of Pictures leads to a
21
+ // memory leak, since Drawer caches them and never forgets. In such a situation, create a new Drawer
22
+ // for each Picture.
18
23
type Drawer struct {
19
24
Triangles Triangles
20
25
Picture Picture
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ import "image/color"
11
11
//
12
12
// To achieve different anchoring, transformations and color masking, use SetMatrix and SetColorMask
13
13
// methods.
14
+ //
15
+ // Note, that Sprite caches the results of MakePicture from Targets it's drawn to for each Picture
16
+ // it's set to. What it means is that using a Sprite with an unbounded number of Pictures leads to a
17
+ // memory leak, since Sprite caches them and never forgets. In such a situation, create a new Sprite
18
+ // for each Picture.
14
19
type Sprite struct {
15
20
tri * TrianglesData
16
21
frame Rect
You can’t perform that action at this time.
0 commit comments