Add comments

This commit is contained in:
Hajime Hoshi 2016-08-23 00:05:23 +09:00
parent 749a751369
commit 3dad97af8a
2 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,7 @@ func (i *Image) Size() (int, int) {
} }
func (i *Image) Fill(clr color.Color) error { func (i *Image) Fill(clr color.Color) error {
// TODO: Need to clone clr value
c := &fillCommand{ c := &fillCommand{
dst: i, dst: i,
color: clr, color: clr,

View File

@ -79,6 +79,8 @@ func (p *Pixels) AppendDrawImageHistory(image *graphics.Image, vertices []int16,
if p.stale { if p.stale {
return return
} }
// All images must be resolved and not stale each after frame.
// So we don't have to care if image is stale or not here.
item := &drawImageHistoryItem{ item := &drawImageHistoryItem{
image: image, image: image,
vertices: vertices, vertices: vertices,
@ -107,6 +109,7 @@ func (p *Pixels) DependsOn(target *graphics.Image) bool {
if p.stale { if p.stale {
return false return false
} }
// TODO: Performance is bad when drawImageHistory is too many.
for _, c := range p.drawImageHistory { for _, c := range p.drawImageHistory {
if c.image == target { if c.image == target {
return true return true