forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GLFW example with dirty region management (flutter#35057)
* Update the GLFW example callbacks. * Update the dart example. * Update CMakeLists * Update library dependencies in the BUILD file. * Documenting. * Formatting. * Update the callback name. * Move glfw_drm example to a new folder. * Create new example folder for drm_embedder. * Add the flutter spinkit dependency * Update BUILD files. * Do not compile glfw_drm example if running it on mac. * Update the executable name for the glfw_drm example. * Avoid looking for the surface and display every time since they are always the same. * Formatting. * GN formatting. * Update the way the user malloc's the existing damage * Update comment * Update example and add gitignore. Co-authored-by: Bernardo Eilert Trevisan <[email protected]>
- Loading branch information
1 parent
198b005
commit 33fccf5
Showing
8 changed files
with
544 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
debug/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2013 The Flutter Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//flutter/examples/examples.gni") | ||
|
||
if (build_embedder_examples) { | ||
executable("glfw_drm") { | ||
output_name = "embedder_example_drm" | ||
|
||
sources = [ "FlutterEmbedderGLFW.cc" ] | ||
|
||
deps = [ | ||
"//flutter/shell/platform/embedder:embedder", | ||
"//third_party/glfw", | ||
] | ||
|
||
libs = [ "EGL" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(FlutterEmbedderGLFW) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" ) | ||
|
||
add_executable(flutter_glfw FlutterEmbedderGLFW.cc) | ||
|
||
############################################################ | ||
# GLFW | ||
############################################################ | ||
option(GLFW_BUILD_EXAMPLES "" OFF) | ||
option(GLFW_BUILD_TESTS "" OFF) | ||
option(GLFW_BUILD_DOCS "" OFF) | ||
option(GLFW_INSTALL "" OFF) | ||
find_package(OpenGL REQUIRED COMPONENTS EGL) | ||
include_directories(${OPENGL_INCLUDE_DIRS}) | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/../../../third_party/glfw glfw) | ||
target_link_libraries(flutter_glfw glfw OpenGL::EGL) | ||
include_directories(${CMAKE_SOURCE_DIR}/../../../third_party/glfw/include) | ||
|
||
############################################################ | ||
# Flutter Engine | ||
############################################################ | ||
# This is assuming you've built a local version of the Flutter Engine. If you | ||
# downloaded yours is from the internet you'll have to change this. | ||
include_directories(${CMAKE_SOURCE_DIR}/../../shell/platform/embedder) | ||
find_library(FLUTTER_LIB flutter_engine PATHS ${CMAKE_SOURCE_DIR}/../../../out/host_debug_unopt) | ||
target_link_libraries(flutter_glfw ${FLUTTER_LIB}) | ||
|
||
# Copy the flutter library here since the shared library | ||
# name is `./libflutter_engine.dylib`. | ||
add_custom_command( | ||
TARGET flutter_glfw POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
${FLUTTER_LIB} | ||
${CMAKE_CURRENT_BINARY_DIR}) |
Oops, something went wrong.