shareable: Refactoring

This commit is contained in:
Hajime Hoshi 2018-04-05 00:40:35 +09:00
parent af0d6d7a48
commit 92e5bc31dc

View File

@ -120,10 +120,6 @@ func (s *Image) Size() (width, height int) {
func (s *Image) DrawImage(img *Image, sx0, sy0, sx1, sy1 int, geom *affine.GeoM, colorm *affine.ColorM, mode opengl.CompositeMode, filter graphics.Filter) {
backendsM.Lock()
defer backendsM.Unlock()
s.drawImage(img, sx0, sy0, sx1, sy1, geom, colorm, mode, filter)
}
func (s *Image) drawImage(img *Image, sx0, sy0, sx1, sy1 int, geom *affine.GeoM, colorm *affine.ColorM, mode opengl.CompositeMode, filter graphics.Filter) {
s.ensureNotShared()
// Compare i and img after ensuring i is not shared, or