Graphics benchmark compilation fix under Unix

Only use wxMSW-specific wxBitmap::UseAlpha() when using this port.

See 7ddb522ec2
This commit is contained in:
Vadim Zeitlin
2018-09-30 00:30:53 +02:00
parent 829f181ccd
commit a8ac1e3240

View File

@@ -152,7 +152,9 @@ public:
Connect(wxEVT_SIZE, wxSizeEventHandler(GraphicsBenchmarkFrame::OnSize)); Connect(wxEVT_SIZE, wxSizeEventHandler(GraphicsBenchmarkFrame::OnSize));
m_bitmapARGB.Create(64, 64, 32); m_bitmapARGB.Create(64, 64, 32);
#ifdef __WXMSW__
m_bitmapARGB.UseAlpha(true); m_bitmapARGB.UseAlpha(true);
#endif // __WXMSW__
m_bitmapRGB.Create(64, 64, 24); m_bitmapRGB.Create(64, 64, 24);
m_renderer = NULL; m_renderer = NULL;
@@ -320,8 +322,12 @@ private:
BenchmarkDCAndGC("RGB memory", dc, gcdc); BenchmarkDCAndGC("RGB memory", dc, gcdc);
} }
{ {
#ifdef __WXMSW__
wxBitmap bmp(opts.width, opts.height, 32); wxBitmap bmp(opts.width, opts.height, 32);
bmp.UseAlpha(false); bmp.UseAlpha(false);
#else // !__WXMSW__
wxBitmap bmp(opts.width, opts.height, 24);
#endif // __WXMSW__/!__WXMSW__
wxMemoryDC dc(bmp); wxMemoryDC dc(bmp);
wxGCDC gcdc; wxGCDC gcdc;
if ( m_renderer ) if ( m_renderer )
@@ -333,7 +339,9 @@ private:
} }
{ {
wxBitmap bmp(opts.width, opts.height, 32); wxBitmap bmp(opts.width, opts.height, 32);
#ifdef __WXMSW__
bmp.UseAlpha(true); bmp.UseAlpha(true);
#endif // __WXMSW__
wxMemoryDC dc(bmp); wxMemoryDC dc(bmp);
wxGCDC gcdc; wxGCDC gcdc;
if ( m_renderer ) if ( m_renderer )