From a30b2de5f620aca95c36ee173e2c29f08873c043 Mon Sep 17 00:00:00 2001 From: ZhangYu Date: Fri, 19 Aug 2022 10:16:07 +0800 Subject: [PATCH] Lightweight Simulator Change-Id: I564715e096135d206bc76eeb0012a9226860a1d0 --- engine/flutter/shell/platform/glfw/flutter_glfw.cc | 5 +++++ engine/flutter/shell/platform/glfw/public/flutter_glfw.h | 3 +++ skia/include/core/SkFontMgr.h | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/flutter/shell/platform/glfw/flutter_glfw.cc b/engine/flutter/shell/platform/glfw/flutter_glfw.cc index 1126702a..623b7514 100644 --- a/engine/flutter/shell/platform/glfw/flutter_glfw.cc +++ b/engine/flutter/shell/platform/glfw/flutter_glfw.cc @@ -680,6 +680,11 @@ void FlutterDesktopWaitForEvents(FlutterDesktopWindowControllerRef controller) { controller->event_loop->WaitForEvents(wait_duration); } +void FlutterDesktopSetWindowShouldClose(FlutterDesktopWindowControllerRef controller, bool flag) { + GLFWwindow* window = controller->window.get(); + glfwSetWindowShouldClose(window, flag ? GLFW_TRUE : GLFW_FALSE); +} + bool FlutterDesktopWindowShouldClose(FlutterDesktopWindowControllerRef controller) { GLFWwindow* window = controller->window.get(); return glfwWindowShouldClose(window); diff --git a/engine/flutter/shell/platform/glfw/public/flutter_glfw.h b/engine/flutter/shell/platform/glfw/public/flutter_glfw.h index a65ec5a5..378ccb4f 100644 --- a/engine/flutter/shell/platform/glfw/public/flutter_glfw.h +++ b/engine/flutter/shell/platform/glfw/public/flutter_glfw.h @@ -116,6 +116,9 @@ FLUTTER_EXPORT void FlutterDesktopRunWindowLoop( FLUTTER_EXPORT void FlutterDesktopWaitForEvents( FlutterDesktopWindowControllerRef controller); +FLUTTER_EXPORT void FlutterDesktopSetWindowShouldClose( + FlutterDesktopWindowControllerRef controller, bool flag); + FLUTTER_EXPORT bool FlutterDesktopWindowShouldClose( FlutterDesktopWindowControllerRef controller); diff --git a/skia/include/core/SkFontMgr.h b/skia/include/core/SkFontMgr.h index e9880d41..7d5a10e4 100644 --- a/skia/include/core/SkFontMgr.h +++ b/skia/include/core/SkFontMgr.h @@ -136,7 +136,7 @@ public: #if defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN) or defined(SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC) /** Set the whether to use physical device font in previwer */ - static void setPhysicalDeviceFonts(bool& physicalDeviceFontsEnabled) + static void setPhysicalDeviceFonts(bool physicalDeviceFontsEnabled) { physicalDeviceFonts = physicalDeviceFontsEnabled; } -- Gitee