mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 17:11:12 +02:00
Bug 1886 - Sluggish behaviour caused by the large time taken to draw the Track Control Panel
All backing bitmaps (not just the one in track panel) now are set to 24 bits. Big thanks to David Bailes for tracking down the root cause of slow BitBlts, and the comments at https://trac.wxwidgets.org/ticket/14403 which led to the fix. In testing the bitmaps, I also fixed the sizer errors reported for Export.cpp that wxWidgets now reports as ASSERTS when running in debug builds.
This commit is contained in:
@@ -14,7 +14,7 @@ BackedPanel::BackedPanel(wxWindow * parent, wxWindowID id,
|
||||
const wxSize & size,
|
||||
long style)
|
||||
: wxPanelWrapper(parent, id, pos, size, style)
|
||||
, mBacking{ std::make_unique<wxBitmap>(1, 1) }
|
||||
, mBacking{ std::make_unique<wxBitmap>(1, 1, 24) }
|
||||
{
|
||||
// Preinit the backing DC and bitmap so routines that require it will
|
||||
// not cause a crash if they run before the panel is fully initialized.
|
||||
@@ -53,7 +53,7 @@ void BackedPanel::ResizeBacking()
|
||||
|
||||
wxSize sz = GetClientSize();
|
||||
mBacking = std::make_unique<wxBitmap>();
|
||||
mBacking->Create(sz.x, sz.y); //, *dc);
|
||||
mBacking->Create(sz.x, sz.y,24); //, *dc);
|
||||
mBackingDC.SelectObject(*mBacking);
|
||||
}
|
||||
|
||||
|
@@ -1353,7 +1353,7 @@ bool NumericTextCtrl::Layout()
|
||||
wxMemoryDC memDC;
|
||||
|
||||
// Placeholder bitmap so the memDC has something to reference
|
||||
mBackgroundBitmap = std::make_unique<wxBitmap>(1, 1);
|
||||
mBackgroundBitmap = std::make_unique<wxBitmap>(1, 1, 24);
|
||||
memDC.SelectObject(*mBackgroundBitmap);
|
||||
|
||||
mDigits.clear();
|
||||
@@ -1420,7 +1420,7 @@ bool NumericTextCtrl::Layout()
|
||||
|
||||
wxBrush Brush;
|
||||
|
||||
mBackgroundBitmap = std::make_unique<wxBitmap>(mWidth + mButtonWidth, mHeight);
|
||||
mBackgroundBitmap = std::make_unique<wxBitmap>(mWidth + mButtonWidth, mHeight,24);
|
||||
memDC.SelectObject(*mBackgroundBitmap);
|
||||
|
||||
theTheme.SetBrushColour( Brush, clrTimeHours );
|
||||
|
Reference in New Issue
Block a user