Tweaks. (Uses CachedBitmap if image scaling isn't needed.)

This commit is contained in:
spx 2011-05-25 21:48:59 +00:00
parent 01b3c31477
commit 68bc25ee82

View File

@ -246,7 +246,16 @@ bool CMeterImage::Draw(Graphics& graphics)
int drawW = m_W;
int drawH = m_H;
if (m_Tile)
GUID guid;
if (drawW == imageW && drawH == imageH &&
m_ScaleMargins.left == 0 && m_ScaleMargins.top == 0 && m_ScaleMargins.right == 0 && m_ScaleMargins.bottom == 0 &&
GetTransformationMatrix().IsIdentity() &&
Ok == drawBitmap->GetRawFormat(&guid) && guid != ImageFormatMemoryBMP)
{
CachedBitmap cache(drawBitmap, &graphics);
graphics.DrawCachedBitmap(&cache, x, y);
}
else if (m_Tile)
{
ImageAttributes imgAttr;
imgAttr.SetWrapMode(WrapModeTile);