mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
internal/graphicscommand: add comments
This commit is contained in:
parent
ce25583438
commit
ae9781cd53
@ -29,6 +29,7 @@ func temporaryBytesSize(size int) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// alloc allocates the pixels and returns it.
|
// alloc allocates the pixels and returns it.
|
||||||
|
//
|
||||||
// Be careful that the returned pixels might not be zero-cleared.
|
// Be careful that the returned pixels might not be zero-cleared.
|
||||||
func (t *temporaryBytes) alloc(size int) []byte {
|
func (t *temporaryBytes) alloc(size int) []byte {
|
||||||
if len(t.pixels) < t.pos+size {
|
if len(t.pixels) < t.pos+size {
|
||||||
@ -66,6 +67,9 @@ func (t *temporaryBytes) reset() {
|
|||||||
t.pos = 0
|
t.pos = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AllocBytes allocates bytes from the cache.
|
||||||
|
//
|
||||||
|
// Be careful that the returned pixels might not be zero-cleared.
|
||||||
func AllocBytes(size int) []byte {
|
func AllocBytes(size int) []byte {
|
||||||
return currentCommandQueue().temporaryBytes.alloc(size)
|
return currentCommandQueue().temporaryBytes.alloc(size)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user