Fix building tests with wxUSE_GRAPHICS_CONTEXT==0
Don't execute code which depends on graphics context functions if wxUSE_GRAPHICS_CONTEXT==0.
This commit is contained in:
		| @@ -396,9 +396,11 @@ void TransformMatrixTestCaseDCBase::VMirrorAndTranslate() | |||||||
|     // is affected by the transformation. In this case mirrored bitmap |     // is affected by the transformation. In this case mirrored bitmap | ||||||
|     // needs to be shifthed by dim pixels. |     // needs to be shifthed by dim pixels. | ||||||
|     int ty; |     int ty; | ||||||
|  | #if wxUSE_GRAPHICS_CONTEXT | ||||||
|     if ( m_dc->GetGraphicsContext() ) |     if ( m_dc->GetGraphicsContext() ) | ||||||
|         ty = m_bmpOrig.GetHeight(); |         ty = m_bmpOrig.GetHeight(); | ||||||
|     else |     else | ||||||
|  | #endif // wxUSE_GRAPHICS_CONTEXT | ||||||
|         ty = m_bmpOrig.GetHeight() - 1; |         ty = m_bmpOrig.GetHeight() - 1; | ||||||
|     matrix.Translate(0, -ty); |     matrix.Translate(0, -ty); | ||||||
|     m_dc->SetTransformMatrix(matrix); |     m_dc->SetTransformMatrix(matrix); | ||||||
|   | |||||||
| @@ -17,6 +17,8 @@ | |||||||
|     #pragma hdrstop |     #pragma hdrstop | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | #if wxUSE_GRAPHICS_CONTEXT | ||||||
|  |  | ||||||
| #include "wx/bitmap.h" | #include "wx/bitmap.h" | ||||||
| #include "wx/dcmemory.h" | #include "wx/dcmemory.h" | ||||||
| #include "wx/dcgraph.h" | #include "wx/dcgraph.h" | ||||||
| @@ -24,7 +26,6 @@ | |||||||
| #include "wx/colour.h" | #include "wx/colour.h" | ||||||
| #include "wx/gdicmn.h" | #include "wx/gdicmn.h" | ||||||
|  |  | ||||||
|  |  | ||||||
| // ---------------------------------------------------------------------------- | // ---------------------------------------------------------------------------- | ||||||
| // test class | // test class | ||||||
| // ---------------------------------------------------------------------------- | // ---------------------------------------------------------------------------- | ||||||
| @@ -54,6 +55,7 @@ public: | |||||||
| private: | private: | ||||||
|     wxBitmap m_bmp; |     wxBitmap m_bmp; | ||||||
|     wxMemoryDC m_dc; |     wxMemoryDC m_dc; | ||||||
|  |  | ||||||
|     wxGCDC *m_gcdc; |     wxGCDC *m_gcdc; | ||||||
|  |  | ||||||
|     void AssertBox(int minX, int minY, int width, int height, int margin = 0) |     void AssertBox(int minX, int minY, int width, int height, int margin = 0) | ||||||
| @@ -361,3 +363,5 @@ void GCDCBoundingBoxTestCase::DrawRectsOnTransformedDC() | |||||||
|     m_gcdc->SetDeviceOrigin(5, 10); |     m_gcdc->SetDeviceOrigin(5, 10); | ||||||
|     AssertBox(5, 5, 65, 60); |     AssertBox(5, 5, 65, 60); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #endif // wxUSE_GRAPHICS_CONTEXT | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user