Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f086ec4

Browse files
authored
[Impeller] A toolkit for managed handles to Android NDK vended objects. (#51334)
Only available on Android device API levels >= 29. Proc table is setup has versioning checks. All handles are type safe. Collection of handles takes into account cleanup tasks (like reparenting surface controls). The proc table contains code duplicated in ndk_helpers and I will remove that in favor of this in a subsequent patch. Part of #51213 being chopped up.
1 parent c2fd533 commit f086ec4

37 files changed

+1381
-577
lines changed

BUILD.gn

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ group("unittests") {
167167

168168
public_deps = []
169169
if (is_android) {
170-
public_deps +=
171-
[ "//flutter/shell/platform/android:flutter_shell_native_unittests" ]
170+
public_deps += [
171+
"//flutter/impeller/toolkit/android:unittests",
172+
"//flutter/shell/platform/android:flutter_shell_native_unittests",
173+
]
172174
}
173175

174176
if (is_ios) {

ci/builders/linux_android_emulator.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"ninja": {
3030
"config": "android_emulator_debug_x64",
3131
"targets": [
32+
"flutter/impeller/toolkit/android:unittests",
3233
"flutter/shell/platform/android:flutter_shell_native_unittests",
3334
"flutter/testing/scenario_app"
3435
]
@@ -120,6 +121,7 @@
120121
"ninja": {
121122
"config": "android_emulator_debug_x86",
122123
"targets": [
124+
"flutter/impeller/toolkit/android:unittests",
123125
"flutter/shell/platform/android:flutter_shell_native_unittests",
124126
"flutter/testing/scenario_app"
125127
]

ci/builders/linux_android_emulator_api_33.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"ninja": {
3030
"config": "android_debug_api33_x64",
3131
"targets": [
32+
"flutter/impeller/toolkit/android:unittests",
3233
"flutter/shell/platform/android:flutter_shell_native_unittests",
3334
"flutter/testing/scenario_app"
3435
]

ci/builders/linux_android_emulator_skia.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"ninja": {
3030
"config": "android_emulator_skia_debug_x64",
3131
"targets": [
32+
"flutter/impeller/toolkit/android:unittests",
3233
"flutter/shell/platform/android:flutter_shell_native_unittests",
3334
"flutter/testing/scenario_app"
3435
]

ci/licenses_golden/excluded_files

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
../../../flutter/fml/message_loop_task_queues_unittests.cc
102102
../../../flutter/fml/message_loop_unittests.cc
103103
../../../flutter/fml/paths_unittests.cc
104-
../../../flutter/fml/platform/android/ndk_helpers_unittests.cc
105104
../../../flutter/fml/platform/darwin/cf_utils_unittests.mm
106105
../../../flutter/fml/platform/darwin/scoped_nsobject_arc_unittests.mm
107106
../../../flutter/fml/platform/darwin/scoped_nsobject_unittests.mm
@@ -200,6 +199,8 @@
200199
../../../flutter/impeller/tessellator/dart/pubspec.lock
201200
../../../flutter/impeller/tessellator/dart/pubspec.yaml
202201
../../../flutter/impeller/tessellator/tessellator_unittests.cc
202+
../../../flutter/impeller/toolkit/android/README.md
203+
../../../flutter/impeller/toolkit/android/toolkit_android_unittests.cc
203204
../../../flutter/impeller/tools/build_metal_library.py
204205
../../../flutter/impeller/tools/check_licenses.py
205206
../../../flutter/impeller/tools/malioc_cores.py

ci/licenses_golden/licenses_flutter

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39364,8 +39364,6 @@ ORIGIN: ../../../flutter/fml/platform/android/jni_weak_ref.cc + ../../../flutter
3936439364
ORIGIN: ../../../flutter/fml/platform/android/jni_weak_ref.h + ../../../flutter/LICENSE
3936539365
ORIGIN: ../../../flutter/fml/platform/android/message_loop_android.cc + ../../../flutter/LICENSE
3936639366
ORIGIN: ../../../flutter/fml/platform/android/message_loop_android.h + ../../../flutter/LICENSE
39367-
ORIGIN: ../../../flutter/fml/platform/android/ndk_helpers.cc + ../../../flutter/LICENSE
39368-
ORIGIN: ../../../flutter/fml/platform/android/ndk_helpers.h + ../../../flutter/LICENSE
3936939367
ORIGIN: ../../../flutter/fml/platform/android/paths_android.cc + ../../../flutter/LICENSE
3937039368
ORIGIN: ../../../flutter/fml/platform/android/paths_android.h + ../../../flutter/LICENSE
3937139369
ORIGIN: ../../../flutter/fml/platform/android/scoped_java_ref.cc + ../../../flutter/LICENSE
@@ -40151,6 +40149,18 @@ ORIGIN: ../../../flutter/impeller/tessellator/c/tessellator.h + ../../../flutter
4015140149
ORIGIN: ../../../flutter/impeller/tessellator/dart/lib/tessellator.dart + ../../../flutter/LICENSE
4015240150
ORIGIN: ../../../flutter/impeller/tessellator/tessellator.cc + ../../../flutter/LICENSE
4015340151
ORIGIN: ../../../flutter/impeller/tessellator/tessellator.h + ../../../flutter/LICENSE
40152+
ORIGIN: ../../../flutter/impeller/toolkit/android/choreographer.cc + ../../../flutter/LICENSE
40153+
ORIGIN: ../../../flutter/impeller/toolkit/android/choreographer.h + ../../../flutter/LICENSE
40154+
ORIGIN: ../../../flutter/impeller/toolkit/android/hardware_buffer.cc + ../../../flutter/LICENSE
40155+
ORIGIN: ../../../flutter/impeller/toolkit/android/hardware_buffer.h + ../../../flutter/LICENSE
40156+
ORIGIN: ../../../flutter/impeller/toolkit/android/native_window.cc + ../../../flutter/LICENSE
40157+
ORIGIN: ../../../flutter/impeller/toolkit/android/native_window.h + ../../../flutter/LICENSE
40158+
ORIGIN: ../../../flutter/impeller/toolkit/android/proc_table.cc + ../../../flutter/LICENSE
40159+
ORIGIN: ../../../flutter/impeller/toolkit/android/proc_table.h + ../../../flutter/LICENSE
40160+
ORIGIN: ../../../flutter/impeller/toolkit/android/surface_control.cc + ../../../flutter/LICENSE
40161+
ORIGIN: ../../../flutter/impeller/toolkit/android/surface_control.h + ../../../flutter/LICENSE
40162+
ORIGIN: ../../../flutter/impeller/toolkit/android/surface_transaction.cc + ../../../flutter/LICENSE
40163+
ORIGIN: ../../../flutter/impeller/toolkit/android/surface_transaction.h + ../../../flutter/LICENSE
4015440164
ORIGIN: ../../../flutter/impeller/toolkit/egl/config.cc + ../../../flutter/LICENSE
4015540165
ORIGIN: ../../../flutter/impeller/toolkit/egl/config.h + ../../../flutter/LICENSE
4015640166
ORIGIN: ../../../flutter/impeller/toolkit/egl/context.cc + ../../../flutter/LICENSE
@@ -40874,6 +40884,7 @@ ORIGIN: ../../../flutter/shell/platform/android/flutter_main.h + ../../../flutte
4087440884
ORIGIN: ../../../flutter/shell/platform/android/image_external_texture.h + ../../../flutter/LICENSE
4087540885
ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_gl.cc + ../../../flutter/LICENSE
4087640886
ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_gl.h + ../../../flutter/LICENSE
40887+
ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_vk.cc + ../../../flutter/LICENSE
4087740888
ORIGIN: ../../../flutter/shell/platform/android/image_external_texture_vk.h + ../../../flutter/LICENSE
4087840889
ORIGIN: ../../../flutter/shell/platform/android/image_lru.cc + ../../../flutter/LICENSE
4087940890
ORIGIN: ../../../flutter/shell/platform/android/image_lru.h + ../../../flutter/LICENSE
@@ -42220,8 +42231,6 @@ FILE: ../../../flutter/fml/platform/android/jni_weak_ref.cc
4222042231
FILE: ../../../flutter/fml/platform/android/jni_weak_ref.h
4222142232
FILE: ../../../flutter/fml/platform/android/message_loop_android.cc
4222242233
FILE: ../../../flutter/fml/platform/android/message_loop_android.h
42223-
FILE: ../../../flutter/fml/platform/android/ndk_helpers.cc
42224-
FILE: ../../../flutter/fml/platform/android/ndk_helpers.h
4222542234
FILE: ../../../flutter/fml/platform/android/paths_android.cc
4222642235
FILE: ../../../flutter/fml/platform/android/paths_android.h
4222742236
FILE: ../../../flutter/fml/platform/android/scoped_java_ref.cc
@@ -43008,6 +43017,18 @@ FILE: ../../../flutter/impeller/tessellator/c/tessellator.h
4300843017
FILE: ../../../flutter/impeller/tessellator/dart/lib/tessellator.dart
4300943018
FILE: ../../../flutter/impeller/tessellator/tessellator.cc
4301043019
FILE: ../../../flutter/impeller/tessellator/tessellator.h
43020+
FILE: ../../../flutter/impeller/toolkit/android/choreographer.cc
43021+
FILE: ../../../flutter/impeller/toolkit/android/choreographer.h
43022+
FILE: ../../../flutter/impeller/toolkit/android/hardware_buffer.cc
43023+
FILE: ../../../flutter/impeller/toolkit/android/hardware_buffer.h
43024+
FILE: ../../../flutter/impeller/toolkit/android/native_window.cc
43025+
FILE: ../../../flutter/impeller/toolkit/android/native_window.h
43026+
FILE: ../../../flutter/impeller/toolkit/android/proc_table.cc
43027+
FILE: ../../../flutter/impeller/toolkit/android/proc_table.h
43028+
FILE: ../../../flutter/impeller/toolkit/android/surface_control.cc
43029+
FILE: ../../../flutter/impeller/toolkit/android/surface_control.h
43030+
FILE: ../../../flutter/impeller/toolkit/android/surface_transaction.cc
43031+
FILE: ../../../flutter/impeller/toolkit/android/surface_transaction.h
4301143032
FILE: ../../../flutter/impeller/toolkit/egl/config.cc
4301243033
FILE: ../../../flutter/impeller/toolkit/egl/config.h
4301343034
FILE: ../../../flutter/impeller/toolkit/egl/context.cc

fml/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ source_set("fml") {
188188
"platform/android/jni_weak_ref.h",
189189
"platform/android/message_loop_android.cc",
190190
"platform/android/message_loop_android.h",
191-
"platform/android/ndk_helpers.cc",
192-
"platform/android/ndk_helpers.h",
193191
"platform/android/paths_android.cc",
194192
"platform/android/paths_android.h",
195193
"platform/android/scoped_java_ref.cc",

fml/platform/android/ndk_helpers.cc

Lines changed: 0 additions & 264 deletions
This file was deleted.

0 commit comments

Comments
 (0)