aboutsummaryrefslogtreecommitdiff
path: root/gui/EventRecorder.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2018-01-07 10:39:22 +0100
committerEugene Sandulenko2018-03-12 11:46:04 +0100
commit4d0bb753e418ee9f70937777cb3827cd3181a26b (patch)
tree151cffe7d73693389430ba33f8843f941629c6fb /gui/EventRecorder.cpp
parent99eb0159dbd35c0081352fbc9bfeaf3077204655 (diff)
downloadscummvm-rg350-4d0bb753e418ee9f70937777cb3827cd3181a26b.tar.gz
scummvm-rg350-4d0bb753e418ee9f70937777cb3827cd3181a26b.tar.bz2
scummvm-rg350-4d0bb753e418ee9f70937777cb3827cd3181a26b.zip
GUI: Remove the ThemeItem draw queues
Drawing nows happens directly when the Dialog or Widget draw methods are called. This makes it easy to debug why a particular low level draw method was called, by inspecting the call stack. This replaces the notion of "buffering" by two independant ways to control what is drawn and where: - The active layer is used to select whether the foreground or background part of the dialogs are rendered by the draw calls. - The active surface is used to select if the draw calls affect the back buffer or the screen. The foreground layer of the active dialog is drawn directly to the screen. Its background layer is drawn to the back buffer. This way widgets can restore the back buffer in order to update without having to redraw the dialog's background. Dialogs lower in the dialog stack are drawn entirely to the back buffer.
Diffstat (limited to 'gui/EventRecorder.cpp')
-rw-r--r--gui/EventRecorder.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index 39811513e3..849405410a 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -557,17 +557,19 @@ Common::SaveFileManager *EventRecorder::getSaveManager(Common::SaveFileManager *
}
void EventRecorder::preDrawOverlayGui() {
- if ((_initialized) || (_needRedraw)) {
+ if ((_initialized) || (_needRedraw)) {
RecordMode oldMode = _recordMode;
_recordMode = kPassthrough;
g_system->showOverlay();
g_gui.theme()->clearAll();
- g_gui.theme()->openDialog(true, GUI::ThemeEngine::kShadingNone);
- _controlPanel->drawDialog();
- g_gui.theme()->finishBuffering();
+ g_gui.theme()->drawToBackbuffer();
+ _controlPanel->drawDialog(kDrawLayerBackground);
+ g_gui.theme()->drawToScreen();
+ g_gui.theme()->copyBackBufferToScreen();
+ _controlPanel->drawDialog(kDrawLayerForeground);
g_gui.theme()->updateScreen();
_recordMode = oldMode;
- }
+ }
}
void EventRecorder::postDrawOverlayGui() {