Removed some commented test code.

This commit is contained in:
Kimmo Pekkola 2009-07-29 12:37:58 +00:00
parent 5d9ed7ca80
commit 1ec9e90265

View File

@ -169,71 +169,6 @@ bool CMeterButton::Draw(Graphics& graphics)
// Blit the image
graphics.DrawCachedBitmap(m_Bitmaps[m_State], x, y);
// TEST
/* HDC desktopDC = GetDC(GetDesktopWindow());
HDC dc = CreateCompatibleDC(desktopDC);
HBITMAP bm = CreateCompatibleBitmap(desktopDC, 200, 200);
ReleaseDC(GetDesktopWindow(), desktopDC);
HBITMAP oldBM = (HBITMAP)SelectObject(dc, bm);
Graphics dgfx(GetDesktopWindow());
Bitmap nbg(200, 200, PixelFormat32bppARGB);
Bitmap nbm(L"button.png");
Graphics gfx1(&nbg);
Graphics gfx2(dc);
CachedBitmap cbm1(&nbm, &gfx1);
CachedBitmap cbm2(&nbm, &gfx2);
Rect r(0, 0, nbm.GetWidth(), nbm.GetHeight());
int i;
SolidBrush solid(Color(255, 155, 123, 232));
DWORD time = GetTickCount();
for (i = 0; i < 1000000; i++)
{
gfx1.DrawImage(&nbm, r, 0, 0, nbm.GetWidth(), nbm.GetHeight(), UnitPixel);
// gfx1.FillRectangle(&solid, 0, 0, nbm.GetWidth(), nbm.GetHeight()); // 2156
}
DebugLog("Bitmap 2 Bitmap: %i", GetTickCount() - time); // 469
time = GetTickCount();
for (i = 0; i < 1000000; i++)
{
gfx1.DrawCachedBitmap(&cbm1, 0, 0);
}
DebugLog("CachedBitmap 2 Bitmap: %i", GetTickCount() - time); // 125
time = GetTickCount();
for (i = 0; i < 1000000; i++)
{
gfx2.DrawImage(&nbm, r, 0, 0, nbm.GetWidth(), nbm.GetHeight(), UnitPixel);
// gfx2.FillRectangle(&solid, 0, 0, nbm.GetWidth(), nbm.GetHeight()); // 797
}
DebugLog("Bitmap 2 CachedBitmap: %i", GetTickCount() - time); // 469
time = GetTickCount();
for (i = 0; i < 1000000; i++)
{
gfx2.DrawCachedBitmap(&cbm1, 0, 0);
}
DebugLog("CachedBitmap 2 CachedBitmap: %i", GetTickCount() - time); // 109
time = GetTickCount();
for (i = 0; i < 1000000; i++)
{
gfx2.DrawCachedBitmap(&cbm2, 0, 0);
}
DebugLog("CachedBitmap 2 CachedBitmap 2: %i", GetTickCount() - time); // 125
SelectObject(dc, oldBM);
DeleteDC(dc);
DeleteObject(bm);
*/
// ~TEST
return true;
}