Select the bitmap out of wxDC before using it in the unit test
The unit test added in 607b800444
had a bug as
it tried to use the bitmap directly while it was still selected into a
wxMemoryDC, which wasn't guaranteed to work and resulted in an assert.
Fix this by destroying wxMemoryDC earlier.
See #17666.
This commit is contained in:
@@ -93,7 +93,7 @@ void BitmapTestCase::OverlappingBlit()
|
|||||||
m_bmp.SetMask( NULL );
|
m_bmp.SetMask( NULL );
|
||||||
|
|
||||||
// Clear to white.
|
// Clear to white.
|
||||||
|
{
|
||||||
wxMemoryDC dc(m_bmp);
|
wxMemoryDC dc(m_bmp);
|
||||||
dc.SetBackground( *wxWHITE );
|
dc.SetBackground( *wxWHITE );
|
||||||
dc.Clear();
|
dc.Clear();
|
||||||
@@ -106,6 +106,7 @@ void BitmapTestCase::OverlappingBlit()
|
|||||||
// Scroll down one line.
|
// Scroll down one line.
|
||||||
|
|
||||||
dc.Blit( 0, 1, 10, 9, &dc, 0, 0 );
|
dc.Blit( 0, 1, 10, 9, &dc, 0, 0 );
|
||||||
|
} // Select the bitmap out of the memory DC before using it directly.
|
||||||
|
|
||||||
// Now, lines 0 and 1 should be red, lines 2++ should still be white.
|
// Now, lines 0 and 1 should be red, lines 2++ should still be white.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user