From 68bc25ee82b9c5038bc089566621a58add22f859 Mon Sep 17 00:00:00 2001 From: spx Date: Wed, 25 May 2011 21:48:59 +0000 Subject: [PATCH] Tweaks. (Uses CachedBitmap if image scaling isn't needed.) --- Library/MeterImage.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Library/MeterImage.cpp b/Library/MeterImage.cpp index 770d3a81..3a94a8df 100644 --- a/Library/MeterImage.cpp +++ b/Library/MeterImage.cpp @@ -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);