void render(Canvas canvas)
{
m_Src = new Rect(0, 0, m_RectWidth, m_RectHeight);
m_Dst = new Rect(m_RectX, m_RectY, m_RectX + m_RectWidth, m_RectY + m_RectHeight);
canvas.drawBitmap(m_Bitmap, m_Src, m_Dst, null);
}
Here you allocate 2 Rect
objects each time. You should initialize them only once and use Rect.set
to change their values.
Also if your Bitmap
size should not change, you could use public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint)
since this method doesn't do any scaling/translation to the Bitmap
and should be more efficient.