code: func NewGLPicture(p pixel.Picture) GLPicture {
  	bounds := p.Bounds()
  	bx, by, bw, bh := intBounds(bounds)
  
  	pixels := make([]uint8, 4*bw*bh)
  
  	if pd, ok := p.(*pixel.PictureData); ok {
  		// PictureData short path
  		for y := 0; y < bh; y++ {
  			for x := 0; x < bw; x++ {
  				rgba := pd.Pix[y*pd.Stride+x]
  				off := (y*bw + x) * 4
  				pixels[off+0] = rgba.R
  				pixels[off+1] = rgba.G
  				pixels[off+2] = rgba.B
  				pixels[off+3] = rgba.A
  			}
  		}
  	} else if p, ok := p.(pixel.PictureColor); ok {
  		for y := 0; y < bh; y++ {
  			for x := 0; x < bw; x++ {
  				at := pixel.V(
  					math.Max(float64(bx+x), bounds.Min.X),
  					math.Max(float64(by+y), bounds.Min.Y),
  				)
  				color := p.Color(at)
  				off := (y*bw + x) * 4
  				pixels[off+0] = uint8(color.R * 255)
  				pixels[off+1] = uint8(color.G * 255)
  				pixels[off+2] = uint8(color.B * 255)
  				pixels[off+3] = uint8(color.A * 255)
  			}
  		}
  	}
  
  	var tex *glhf.Texture
  	mainthread.Call(func() {
  		tex = glhf.NewTexture(bw, bh, false, pixels)
  	})
  
  	gp := &glPicture{
  		bounds: bounds,
  		tex:    tex,
  		pixels: pixels,
  	}
  	return gp
  }
docs: // NewGLPicture creates a new GLPicture with it's own static OpenGL texture. This function always
  // allocates a new texture that cannot (shouldn't) be further modified.