Kaydet (Commit) 86186de4 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

create "disabled" image (icon) only if the original changes

Currently we create a "disabled" version of  bitmaps in "Image"
class (used for toolbar icons for example) in every draw call.
This is not really optimal. The solution is to calculate the
checksum of the original and create a "disabled" version only if
the checksum changes.

Change-Id: I6ed2d08c64fee028b479fedb35e4384f112e98e2
üst a6ef5718
......@@ -39,6 +39,8 @@ public:
private:
BitmapEx maBmpEx;
BitmapChecksum maBitmapChecksum;
BitmapEx maDisabledBmpEx;
BitmapEx* mpDisplayBmp;
Size maSize;
......
......@@ -182,7 +182,12 @@ void ImplImageBmp::Draw( OutputDevice* pOutDev,
if( nStyle & DrawImageFlags::Disable )
{
ImplUpdateDisabledBmpEx();
BitmapChecksum aChecksum = maBmpEx.GetChecksum();
if (maBitmapChecksum != aChecksum)
{
maBitmapChecksum = aChecksum;
ImplUpdateDisabledBmpEx();
}
pOutDev->DrawBitmapEx( rPos, aOutSize, aSrcPos, maSize, maDisabledBmpEx );
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment