#include <cassert>#include <chrono>#include <iostream>#include <EGL/egl.h>#include <EGL/eglext.h>#include <array>#include <cstring>#include <list>#include <unordered_map>#include "GLFW/glfw3.h"#include "GLFW/glfw3native.h"#include "embedder.h"Go to the source code of this file.
Macros | |
| #define | GLFW_EXPOSE_NATIVE_EGL |
| #define | GLFW_INCLUDE_GLEXT |
Functions | |
| void | GLFWcursorPositionCallbackAtPhase (GLFWwindow *window, FlutterPointerPhase phase, double x, double y) |
| void | GLFWcursorPositionCallback (GLFWwindow *window, double x, double y) |
| void | GLFWmouseButtonCallback (GLFWwindow *window, int key, int action, int mods) |
| static void | GLFWKeyCallback (GLFWwindow *window, int key, int scancode, int action, int mods) |
| void | GLFWwindowSizeCallback (GLFWwindow *window, int width, int height) |
| static std::array< EGLint, 4 > | RectToInts (const FlutterRect rect) |
| static void | JoinFlutterRect (FlutterRect *rect, FlutterRect additional_rect) |
| static bool | HasExtension (const char *extensions, const char *name) |
| bool | RunFlutter (GLFWwindow *window, const std::string &project_path, const std::string &icudtl_path) |
| void | printUsage () |
| void | GLFW_ErrorCallback (int error, const char *description) |
| int | main (int argc, const char *argv[]) |
Variables | |
| static double | g_pixelRatio = 1.0 |
| static const size_t | kInitialWindowWidth = 800 |
| static const size_t | kInitialWindowHeight = 600 |
| static const int | kMaxHistorySize = 10 |
| static constexpr FlutterViewId | kImplicitViewId = 0 |
| std::list< FlutterRect > | damage_history_ |
| std::unordered_map< intptr_t, FlutterRect * > | existing_damage_map_ |
| EGLDisplay | display_ |
| EGLSurface | surface_ |
| #define GLFW_EXPOSE_NATIVE_EGL |
Definition at line 9 of file FlutterEmbedderGLFW.cc.
| #define GLFW_INCLUDE_GLEXT |
Definition at line 10 of file FlutterEmbedderGLFW.cc.
| void GLFW_ErrorCallback | ( | int | error, |
| const char * | description | ||
| ) |
| void GLFWcursorPositionCallback | ( | GLFWwindow * | window, |
| double | x, | ||
| double | y | ||
| ) |
Definition at line 68 of file FlutterEmbedderGLFW.cc.
References GLFWcursorPositionCallbackAtPhase(), kMove, window, x, and y.
| void GLFWcursorPositionCallbackAtPhase | ( | GLFWwindow * | window, |
| FlutterPointerPhase | phase, | ||
| double | x, | ||
| double | y | ||
| ) |
Definition at line 47 of file FlutterEmbedderGLFW.cc.
References FlutterEngineSendPointerEvent(), g_pixelRatio, kImplicitViewId, FlutterPointerEvent::struct_size, window, x, and y.
|
static |
Definition at line 91 of file FlutterEmbedderGLFW.cc.
| void GLFWmouseButtonCallback | ( | GLFWwindow * | window, |
| int | key, | ||
| int | action, | ||
| int | mods | ||
| ) |
Definition at line 72 of file FlutterEmbedderGLFW.cc.
References action, GLFWcursorPositionCallback(), GLFWcursorPositionCallbackAtPhase(), kDown, key, kUp, window, x, and y.
| void GLFWwindowSizeCallback | ( | GLFWwindow * | window, |
| int | width, | ||
| int | height | ||
| ) |
Definition at line 101 of file FlutterEmbedderGLFW.cc.
References FlutterEngineSendWindowMetricsEvent(), g_pixelRatio, height, kImplicitViewId, FlutterWindowMetricsEvent::struct_size, width, and window.
|
static |
Definition at line 139 of file FlutterEmbedderGLFW.cc.
References name.
Referenced by RunFlutter().
|
static |
Definition at line 130 of file FlutterEmbedderGLFW.cc.
References FlutterRect::bottom, FlutterRect::left, FlutterRect::right, and FlutterRect::top.
Referenced by RunFlutter().
| int main | ( | int | argc, |
| const char * | argv[] | ||
| ) |
Definition at line 290 of file FlutterEmbedderGLFW.cc.
References argv, display_, g_pixelRatio, GLFW_ErrorCallback(), GLFW_TRUE, GLFWKeyCallback(), GLFWmouseButtonCallback(), GLFWwindowSizeCallback(), kInitialWindowHeight, kInitialWindowWidth, printUsage(), RunFlutter(), surface_, and window.
| void printUsage | ( | ) |
Definition at line 280 of file FlutterEmbedderGLFW.cc.
|
static |
Definition at line 117 of file FlutterEmbedderGLFW.cc.
References FlutterRect::bottom, display_, height, FlutterRect::left, FlutterRect::right, surface_, and FlutterRect::top.
Referenced by RunFlutter().
| bool RunFlutter | ( | GLFWwindow * | window, |
| const std::string & | project_path, | ||
| const std::string & | icudtl_path | ||
| ) |
Definition at line 146 of file FlutterEmbedderGLFW.cc.
References args, FlutterOpenGLRendererConfig::clear_current, damage_history_, display_, engine, existing_damage_map_, FlutterOpenGLRendererConfig::fbo_callback, FlutterOpenGLRendererConfig::fbo_reset_after_present, FLUTTER_ENGINE_VERSION, FlutterEngineRun(), FlutterOpenGLRendererConfig::gl_proc_resolver, GLFW_TRUE, GLFWwindowSizeCallback(), HasExtension(), i, JoinFlutterRect(), kInitialWindowHeight, kInitialWindowWidth, kMaxHistorySize, kOpenGL, kSuccess, FlutterRect::left, FlutterOpenGLRendererConfig::make_current, name, FlutterRendererConfig::open_gl, FlutterOpenGLRendererConfig::populate_existing_damage, FlutterOpenGLRendererConfig::present_with_info, RectToInts(), FlutterOpenGLRendererConfig::struct_size, FlutterProjectArgs::struct_size, surface_, FlutterRendererConfig::type, and window.
| std::list<FlutterRect> damage_history_ |
Definition at line 33 of file FlutterEmbedderGLFW.cc.
Referenced by RunFlutter().
| EGLDisplay display_ |
Definition at line 38 of file FlutterEmbedderGLFW.cc.
Referenced by impeller::egl::Context::ClearCurrent(), main(), impeller::egl::Context::MakeCurrent(), impeller::egl::Surface::Present(), RectToInts(), RunFlutter(), impeller::egl::Context::~Context(), and impeller::egl::Surface::~Surface().
| std::unordered_map<intptr_t, FlutterRect*> existing_damage_map_ |
Definition at line 36 of file FlutterEmbedderGLFW.cc.
Referenced by RunFlutter().
|
static |
Definition at line 23 of file FlutterEmbedderGLFW.cc.
|
staticconstexpr |
Definition at line 29 of file FlutterEmbedderGLFW.cc.
|
static |
Definition at line 25 of file FlutterEmbedderGLFW.cc.
|
static |
Definition at line 24 of file FlutterEmbedderGLFW.cc.
|
static |
Definition at line 28 of file FlutterEmbedderGLFW.cc.
Referenced by RunFlutter().
| EGLSurface surface_ |
Definition at line 39 of file FlutterEmbedderGLFW.cc.
Referenced by impeller::egl::Surface::GetHandle(), flutter::Rasterizer::GetResourceCacheMaxBytes(), flutter::testing::TestVulkanSurface::GetSurfaceSnapshot(), impeller::egl::Surface::IsValid(), flutter::testing::TestVulkanSurface::IsValid(), main(), impeller::egl::Surface::Present(), RectToInts(), RunFlutter(), flutter::Rasterizer::ScreenshotLastLayerTree(), flutter::Rasterizer::SetResourceCacheMaxBytes(), and impeller::egl::Surface::~Surface().