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:
parent
3ccdde8fdb
commit
4318cb6780
|
@ -647,7 +647,7 @@ void FreqWindow::DrawBackground(wxMemoryDC & dc)
|
||||||
|
|
||||||
mPlotRect = mFreqPlot->GetClientRect();
|
mPlotRect = mFreqPlot->GetClientRect();
|
||||||
|
|
||||||
mBitmap = std::make_unique<wxBitmap>(mPlotRect.width, mPlotRect.height);
|
mBitmap = std::make_unique<wxBitmap>(mPlotRect.width, mPlotRect.height,24);
|
||||||
|
|
||||||
dc.SelectObject(*mBitmap);
|
dc.SelectObject(*mBitmap);
|
||||||
|
|
||||||
|
|
|
@ -1434,7 +1434,7 @@ void MixerBoard::LoadMusicalInstruments()
|
||||||
wxMemoryDC dc;
|
wxMemoryDC dc;
|
||||||
|
|
||||||
for (const auto &data : table) {
|
for (const auto &data : table) {
|
||||||
auto bmp = std::make_unique<wxBitmap>(data.bitmap);
|
auto bmp = std::make_unique<wxBitmap>(data.bitmap,24);
|
||||||
dc.SelectObject(*bmp);
|
dc.SelectObject(*bmp);
|
||||||
AColor::Bevel(dc, false, bev);
|
AColor::Bevel(dc, false, bev);
|
||||||
mMusicalInstruments.push_back(std::make_unique<MusicalInstrument>(
|
mMusicalInstruments.push_back(std::make_unique<MusicalInstrument>(
|
||||||
|
|
|
@ -657,7 +657,7 @@ void EffectAutoDuckPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
||||||
if (!mBackgroundBitmap || mBackgroundBitmap->GetWidth() != clientWidth ||
|
if (!mBackgroundBitmap || mBackgroundBitmap->GetWidth() != clientWidth ||
|
||||||
mBackgroundBitmap->GetHeight() != clientHeight)
|
mBackgroundBitmap->GetHeight() != clientHeight)
|
||||||
{
|
{
|
||||||
mBackgroundBitmap = std::make_unique<wxBitmap>(clientWidth, clientHeight);
|
mBackgroundBitmap = std::make_unique<wxBitmap>(clientWidth, clientHeight,24);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMemoryDC dc;
|
wxMemoryDC dc;
|
||||||
|
|
|
@ -2903,7 +2903,7 @@ void EqualizationPanel::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||||
{
|
{
|
||||||
mWidth = width;
|
mWidth = width;
|
||||||
mHeight = height;
|
mHeight = height;
|
||||||
mBitmap = std::make_unique<wxBitmap>(mWidth, mHeight);
|
mBitmap = std::make_unique<wxBitmap>(mWidth, mHeight,24);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBrush bkgndBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
wxBrush bkgndBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||||
|
|
|
@ -1069,7 +1069,7 @@ void EffectScienFilterPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
||||||
{
|
{
|
||||||
mWidth = width;
|
mWidth = width;
|
||||||
mHeight = height;
|
mHeight = height;
|
||||||
mBitmap = std::make_unique<wxBitmap>(mWidth, mHeight);
|
mBitmap = std::make_unique<wxBitmap>(mWidth, mHeight,24);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBrush bkgndBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
wxBrush bkgndBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||||
|
|
|
@ -1068,7 +1068,7 @@ void ExportMixerPanel::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||||
{
|
{
|
||||||
mWidth = width;
|
mWidth = width;
|
||||||
mHeight = height;
|
mHeight = height;
|
||||||
mBitmap = std::make_unique<wxBitmap>( mWidth, mHeight );
|
mBitmap = std::make_unique<wxBitmap>( mWidth, mHeight,24 );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour bkgnd = GetBackgroundColour();
|
wxColour bkgnd = GetBackgroundColour();
|
||||||
|
@ -1311,7 +1311,7 @@ ExportMixerDialog::ExportMixerDialog( const TrackList *tracks, bool selectedOnly
|
||||||
mMixerSpec.get(), mTrackNames,
|
mMixerSpec.get(), mTrackNames,
|
||||||
wxDefaultPosition, wxSize(400, -1));
|
wxDefaultPosition, wxSize(400, -1));
|
||||||
mixerPanel->SetName(_("Mixer Panel"));
|
mixerPanel->SetName(_("Mixer Panel"));
|
||||||
vertSizer->Add(mixerPanel, 1, wxEXPAND | wxALIGN_CENTRE | wxALL, 5);
|
vertSizer->Add(mixerPanel, 1, wxEXPAND | wxALL, 5);
|
||||||
|
|
||||||
{
|
{
|
||||||
auto horSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
auto horSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||||
|
|
|
@ -14,7 +14,7 @@ BackedPanel::BackedPanel(wxWindow * parent, wxWindowID id,
|
||||||
const wxSize & size,
|
const wxSize & size,
|
||||||
long style)
|
long style)
|
||||||
: wxPanelWrapper(parent, id, pos, size, 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
|
// 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.
|
// not cause a crash if they run before the panel is fully initialized.
|
||||||
|
@ -53,7 +53,7 @@ void BackedPanel::ResizeBacking()
|
||||||
|
|
||||||
wxSize sz = GetClientSize();
|
wxSize sz = GetClientSize();
|
||||||
mBacking = std::make_unique<wxBitmap>();
|
mBacking = std::make_unique<wxBitmap>();
|
||||||
mBacking->Create(sz.x, sz.y); //, *dc);
|
mBacking->Create(sz.x, sz.y,24); //, *dc);
|
||||||
mBackingDC.SelectObject(*mBacking);
|
mBackingDC.SelectObject(*mBacking);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1353,7 +1353,7 @@ bool NumericTextCtrl::Layout()
|
||||||
wxMemoryDC memDC;
|
wxMemoryDC memDC;
|
||||||
|
|
||||||
// Placeholder bitmap so the memDC has something to reference
|
// 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);
|
memDC.SelectObject(*mBackgroundBitmap);
|
||||||
|
|
||||||
mDigits.clear();
|
mDigits.clear();
|
||||||
|
@ -1420,7 +1420,7 @@ bool NumericTextCtrl::Layout()
|
||||||
|
|
||||||
wxBrush Brush;
|
wxBrush Brush;
|
||||||
|
|
||||||
mBackgroundBitmap = std::make_unique<wxBitmap>(mWidth + mButtonWidth, mHeight);
|
mBackgroundBitmap = std::make_unique<wxBitmap>(mWidth + mButtonWidth, mHeight,24);
|
||||||
memDC.SelectObject(*mBackgroundBitmap);
|
memDC.SelectObject(*mBackgroundBitmap);
|
||||||
|
|
||||||
theTheme.SetBrushColour( Brush, clrTimeHours );
|
theTheme.SetBrushColour( Brush, clrTimeHours );
|
||||||
|
|
Loading…
Reference in New Issue