148 {
153 glfwMakeContextCurrent(static_cast<GLFWwindow*>(userdata));
154 return true;
155 };
157 glfwMakeContextCurrent(nullptr);
158 return true;
159 };
162
166 }
167
168
170
171
172 PFNEGLSETDAMAGEREGIONKHRPROC set_damage_region_ = nullptr;
174 set_damage_region_ = reinterpret_cast<PFNEGLSETDAMAGEREGIONKHRPROC>(
175 eglGetProcAddress("eglSetDamageRegionKHR"));
176 }
177
178
179 PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage_ = nullptr;
181 swap_buffers_with_damage_ =
182 reinterpret_cast<PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC>(
183 eglGetProcAddress("eglSwapBuffersWithDamageEXT"));
185 swap_buffers_with_damage_ =
186 reinterpret_cast<PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC>(
187 eglGetProcAddress("eglSwapBuffersWithDamageKHR"));
188 }
189
190 if (set_damage_region_) {
191
194 }
195
196
200 }
201
202 if (swap_buffers_with_damage_) {
203
206 1);
207 } else {
208
209
211 }
212 };
214 return 0;
215 };
217 [](void* userdata, intptr_t fbo_id,
219
220
221 EGLint age;
222 if (glfwExtensionSupported(
"GL_EXT_buffer_age") ==
GLFW_TRUE) {
224 } else {
225 age = 4;
226 }
227
228 existing_damage->num_rects = 1;
229
230
236
237 if (age > 1) {
238 --age;
239
244 existing_damage->damage[0] = {
i->left,
i->top,
i->right,
i->bottom};
245 }
246 } else {
248 }
249 }
250 }
251 };
253 return reinterpret_cast<void*
>(glfwGetProcAddress(
name));
254 };
256
257
258 std::string assets_path = project_path + "/build/flutter_assets";
261 .assets_path = assets_path.c_str(),
262 .icu_data_path =
263 icudtl_path.c_str(),
264 };
270 std::cout << "Could not run the Flutter Engine." << std::endl;
271 return false;
272 }
273
276
277 return true;
278}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
FlutterEngineResult FlutterEngineRun(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize and run a Flutter engine instance and return a handle to it. This is a convenience method ...
#define FLUTTER_ENGINE_VERSION
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static std::array< EGLint, 4 > RectToInts(const FlutterRect rect)
static const int kMaxHistorySize
std::unordered_map< intptr_t, FlutterRect * > existing_damage_map_
static void JoinFlutterRect(FlutterRect *rect, FlutterRect additional_rect)
std::list< FlutterRect > damage_history_
static bool HasExtension(const char *extensions, const char *name)
void * malloc(size_t size)
A structure to represent a damage region.
ProcResolver gl_proc_resolver
BoolCallback make_current
BoolPresentInfoCallback present_with_info
UIntCallback fbo_callback
size_t struct_size
The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
bool fbo_reset_after_present
FlutterFrameBufferWithDamageCallback populate_existing_damage
BoolCallback clear_current
A structure to represent a rectangle.
FlutterOpenGLRendererConfig open_gl