From 479a96fc22a9ea0a7df4c20724418b5c63c820f6 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 12 May 2016 15:52:18 -0700 Subject: [PATCH] Move Painter into EventDispatcher. --- firmware/application/event_m0.cpp | 3 +-- firmware/application/event_m0.hpp | 3 +-- firmware/application/main.cpp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/firmware/application/event_m0.cpp b/firmware/application/event_m0.cpp index 47b0cd23..f0f0bdb4 100644 --- a/firmware/application/event_m0.cpp +++ b/firmware/application/event_m0.cpp @@ -62,10 +62,9 @@ Thread* EventDispatcher::thread_event_loop = nullptr; EventDispatcher::EventDispatcher( ui::Widget* const top_widget, - ui::Painter& painter, ui::Context& context ) : top_widget { top_widget }, - painter(painter), + painter { }, context(context) { init_message_queues(); diff --git a/firmware/application/event_m0.hpp b/firmware/application/event_m0.hpp index 947f51ee..6c716488 100644 --- a/firmware/application/event_m0.hpp +++ b/firmware/application/event_m0.hpp @@ -50,7 +50,6 @@ class EventDispatcher { public: EventDispatcher( ui::Widget* const top_widget, - ui::Painter& painter, ui::Context& context ); @@ -87,7 +86,7 @@ private: touch::Manager touch_manager; ui::Widget* const top_widget; - ui::Painter& painter; + ui::Painter painter; ui::Context& context; uint32_t encoder_last = 0; bool is_running = true; diff --git a/firmware/application/main.cpp b/firmware/application/main.cpp index 63f9a822..0475073c 100755 --- a/firmware/application/main.cpp +++ b/firmware/application/main.cpp @@ -57,9 +57,8 @@ static void event_loop() { context, portapack::display.screen_rect() }; - ui::Painter painter; - EventDispatcher event_dispatcher { &system_view, painter, context }; + EventDispatcher event_dispatcher { &system_view, context }; MessageHandlerRegistration message_handler_shutdown { Message::ID::Shutdown,