Improved the drawing performance by using PixelFormat32bppPARGB instead of PixelFormat32bppARGB. (PARGB is faster than ARGB.)

This commit is contained in:
spx
2011-01-06 01:44:09 +00:00
parent 7c09acb889
commit 89ea706055
3 changed files with 72 additions and 57 deletions

View File

@ -113,7 +113,7 @@ void CMeterButton::Initialize()
for (int i = 0; i < BUTTON_FRAMES; ++i)
{
Bitmap bitmapPart(m_W, m_H, PixelFormat32bppARGB);
Bitmap bitmapPart(m_W, m_H, PixelFormat32bppPARGB);
Graphics graphics(&bitmapPart);
Rect r(0, 0, m_W, m_H);
@ -250,7 +250,7 @@ bool CMeterButton::HitTest2(int px, int py, bool checkAlpha)
{
if (checkAlpha)
{
if (m_SolidColor.GetA() > 0 || m_SolidColor2.GetA() > 0)
if (m_SolidColor.GetA() != 0 || m_SolidColor2.GetA() != 0)
{
return true;
}
@ -260,7 +260,7 @@ bool CMeterButton::HitTest2(int px, int py, bool checkAlpha)
{
Color color;
Status status = m_Image.GetImage()->GetPixel(px - x + m_W * m_State, py - y, &color);
if (status != Ok || color.GetA() > 0)
if (status != Ok || color.GetA() != 0)
{
return true;
}