Do nothing in wxMemoryDC::SelectObject() if the bitmap is already selected.

It doesn't make sense to make a copy of the bitmap in order to select it into
wxMemoryDC if it's already selected into it.

See #11640.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-10-24 22:41:46 +00:00
parent 648c1af93d
commit 71f5b0e7da
2 changed files with 14 additions and 4 deletions

View File

@@ -236,6 +236,12 @@ wxMemoryDC::wxMemoryDC(wxDC *dc)
void wxMemoryDC::SelectObject(wxBitmap& bmp)
{
if ( bmp.IsSameAs(GetSelectedBitmap()) )
{
// Nothing to do, this bitmap is already selected.
return;
}
// make sure that the given wxBitmap is not sharing its data with other
// wxBitmap instances as its contents will be modified by any drawing
// operation done on this DC