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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user