From 62ee2daaba46ca5d1d28f0976ce0cbc353d175bd Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 29 Mar 2018 11:13:47 -0300 Subject: [PATCH] Add a comment in the ColorSelector::Painter for future work --- src/app/ui/color_selector.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/app/ui/color_selector.cpp b/src/app/ui/color_selector.cpp index 6a360e3ed..eb931771f 100644 --- a/src/app/ui/color_selector.cpp +++ b/src/app/ui/color_selector.cpp @@ -44,6 +44,19 @@ using namespace ui; // 2. When the painting is done, we flip the buffer onto the screen // 3. If we receive another onPaint() we can cancel the background // painting and start another onPaintSurfaceInBgThread() +// +// An alternative (better) way: +// 1. Create an alternative ui::Graphics implementation that generates +// a list commands for the render thread +// 2. Widgets can still use the same onPaint() +// 3. The background threads consume the list of commands and render +// the screen. +// +// The bad side is that is harder to invalidate the commands that will +// render an old state of the widget. So the render thread should +// start caring about invalidating old commands (outdated regions) or +// cleaning the queue if it gets too big. +// class ColorSelector::Painter { public: Painter() : m_canvas(nullptr) {