I believe it's not necessary to create squaredBitmap. Instead, the BitmapShader can be given a Matrix that has setTranslate(-width, -height). This should accomplish the same thing that creating squaredBitmap does, shifting the viewport on source so that its centre is drawn into bitmap.
I believe it's not necessary to create
squaredBitmap
. Instead, theBitmapShader
can be given aMatrix
that hassetTranslate(-width, -height)
. This should accomplish the same thing that creatingsquaredBitmap
does, shifting the viewport onsource
so that its centre is drawn intobitmap
.