Fixed clipping box tests for Direct2D
Flushing native Direct2D renderer (invoking wxGCDC::Flush() -> wxGraphicsContext::Flush() -> ID2D1RenderTarget::Flush()) is apparently not enough to update underlying DC (with selected in bitmap) and therefore we have to destroy the renderer (which in turn invokes ID2D1RenderTarget::EndDraw()) to do so.
This commit is contained in:
@@ -246,6 +246,16 @@ public:
|
|||||||
|
|
||||||
virtual ~ClippingBoxTestCaseDirect2D() {}
|
virtual ~ClippingBoxTestCaseDirect2D() {}
|
||||||
|
|
||||||
|
virtual void FlushDC()
|
||||||
|
{
|
||||||
|
// Apparently, flushing native Direct2D renderer
|
||||||
|
// is not enough to update underlying DC (bitmap)
|
||||||
|
// and therefore we have to destroy the renderer
|
||||||
|
// to do so.
|
||||||
|
ClippingBoxTestCaseGCDC::FlushDC();
|
||||||
|
m_gcdc->SetGraphicsContext(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPPUNIT_TEST_SUITE( ClippingBoxTestCaseDirect2D );
|
CPPUNIT_TEST_SUITE( ClippingBoxTestCaseDirect2D );
|
||||||
CPPUNIT_TEST( InitialState );
|
CPPUNIT_TEST( InitialState );
|
||||||
@@ -323,9 +333,6 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ClippingBoxTestCaseCairo, "ClippingBoxTes
|
|||||||
|
|
||||||
void ClippingBoxTestCaseBase::CheckBox(int x, int y, int width, int height)
|
void ClippingBoxTestCaseBase::CheckBox(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
// Update wxDC contents.
|
|
||||||
FlushDC();
|
|
||||||
|
|
||||||
// Check clipping box boundaries.
|
// Check clipping box boundaries.
|
||||||
int clipX, clipY, clipW, clipH;
|
int clipX, clipY, clipW, clipH;
|
||||||
m_dc->GetClippingBox(&clipX, &clipY, &clipW, &clipH);
|
m_dc->GetClippingBox(&clipX, &clipY, &clipW, &clipH);
|
||||||
@@ -360,6 +367,9 @@ void ClippingBoxTestCaseBase::CheckBox(int x, int y, int width, int height)
|
|||||||
msg = msgDim;
|
msg = msgDim;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update wxDC contents.
|
||||||
|
FlushDC();
|
||||||
|
|
||||||
// Check whether diagonal corners of the clipping box
|
// Check whether diagonal corners of the clipping box
|
||||||
// are actually drawn at the edge of the clipping region.
|
// are actually drawn at the edge of the clipping region.
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
|
Reference in New Issue
Block a user