mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 23:39:37 -05:00
Push more widget painting code into ui::Painter
Hide knowledge of damage tracking strategy.
This commit is contained in:
parent
2ebb41c0e6
commit
b1a4418f06
@ -266,10 +266,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handle_lcd_frame_sync() {
|
void handle_lcd_frame_sync() {
|
||||||
if( ui::is_dirty() ) {
|
painter.paint_widget_tree(top_widget);
|
||||||
painter.paint_widget(top_widget);
|
|
||||||
ui::dirty_clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_sd_card_detect() {
|
void handle_sd_card_detect() {
|
||||||
|
@ -73,6 +73,13 @@ void Painter::fill_rectangle(const Rect r, const Color c) {
|
|||||||
display.fill_rectangle(r, c);
|
display.fill_rectangle(r, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Painter::paint_widget_tree(Widget* const w) {
|
||||||
|
if( ui::is_dirty() ) {
|
||||||
|
paint_widget(w);
|
||||||
|
ui::dirty_clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Painter::paint_widget(Widget* const w) {
|
void Painter::paint_widget(Widget* const w) {
|
||||||
if( w->hidden() ) {
|
if( w->hidden() ) {
|
||||||
// Mark widget (and all children) as invisible.
|
// Mark widget (and all children) as invisible.
|
||||||
|
@ -53,11 +53,13 @@ public:
|
|||||||
void draw_rectangle(const Rect r, const Color c);
|
void draw_rectangle(const Rect r, const Color c);
|
||||||
void fill_rectangle(const Rect r, const Color c);
|
void fill_rectangle(const Rect r, const Color c);
|
||||||
|
|
||||||
void paint_widget(Widget* const w);
|
void paint_widget_tree(Widget* const w);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void draw_hline(Point p, size_t width, const Color c);
|
void draw_hline(Point p, size_t width, const Color c);
|
||||||
void draw_vline(Point p, size_t height, const Color c);
|
void draw_vline(Point p, size_t height, const Color c);
|
||||||
|
|
||||||
|
void paint_widget(Widget* const w);
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
Loading…
Reference in New Issue
Block a user