From f3dddaf3245f1bd6a7ff330d1fe633e99d0991c4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 3 Nov 2020 02:30:00 +0900 Subject: [PATCH] buffered: Better comment --- internal/buffered/image.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/buffered/image.go b/internal/buffered/image.go index 9a9b86f63..cf09eccb0 100644 --- a/internal/buffered/image.go +++ b/internal/buffered/image.go @@ -218,8 +218,9 @@ func (i *Image) ReplacePixels(pix []byte, x, y, width, height int) error { if x == 0 && y == 0 && width == i.width && height == i.height { i.invalidatePendingPixels() - // Call ReplacePixels immediately. If a lot of new images are created but they are used at different - // timings, pixels are sent to GPU at different timings, which is very inefficient. + // Call ReplacePixels immediately. Do not buffer the command. + // If a lot of new images are created but they are used at different timings, + // pixels are sent to GPU at different timings, which is very inefficient. i.img.ReplacePixels(pix) return nil }