Flutter Engine
glfw_event_loop.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_GLFW_GLFW_EVENT_LOOP_H_
6 #define FLUTTER_SHELL_PLATFORM_GLFW_GLFW_EVENT_LOOP_H_
7 
8 #include "flutter/shell/platform/glfw/event_loop.h"
9 
10 namespace flutter {
11 
12 // An event loop implementation that supports Flutter Engine tasks scheduling in
13 // the GLFW event loop.
14 class GLFWEventLoop : public EventLoop {
15  public:
16  GLFWEventLoop(std::thread::id main_thread_id,
17  const TaskExpiredCallback& on_task_expired);
18 
19  virtual ~GLFWEventLoop();
20 
21  // Prevent copying.
22  GLFWEventLoop(const GLFWEventLoop&) = delete;
23  GLFWEventLoop& operator=(const GLFWEventLoop&) = delete;
24 
25  private:
26  // |EventLoop|
27  void WaitUntil(const TaskTimePoint& time) override;
28 
29  // |EventLoop|
30  void Wake() override;
31 };
32 
33 } // namespace flutter
34 
35 #endif // FLUTTER_SHELL_PLATFORM_GLFW_GLFW_EVENT_LOOP_H_
std::chrono::steady_clock::time_point TaskTimePoint
Definition: event_loop.h:50
std::function< void(const FlutterTask *)> TaskExpiredCallback
Definition: event_loop.h:22
GLFWEventLoop & operator=(const GLFWEventLoop &)=delete
int32_t id
GLFWEventLoop(std::thread::id main_thread_id, const TaskExpiredCallback &on_task_expired)