Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
10namespace flutter {
11
12// An event loop implementation that supports Flutter Engine tasks scheduling in
13// the GLFW event loop.
14class 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;
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::function< void(const FlutterTask *)> TaskExpiredCallback
Definition event_loop.h:22
std::chrono::steady_clock::time_point TaskTimePoint
Definition event_loop.h:50
void WaitUntil(const TaskTimePoint &time) override
GLFWEventLoop(const GLFWEventLoop &)=delete
GLFWEventLoop & operator=(const GLFWEventLoop &)=delete