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

Commit 8320ba3

Browse files
committed
Export GPU symbols for embedder
-resolves flutter/flutter#153196 Signed-off-by: Joel Winarske <[email protected]>
1 parent a8f4e53 commit 8320ba3

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

examples/glfw/main.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import '../../lib/gpu/lib/gpu.dart' as gpu;
56
import 'package:flutter/material.dart';
67
import 'package:flutter/foundation.dart'
78
show debugDefaultTargetPlatformOverride;
89

910
void main() {
11+
// Ensure Flutter GPU symbols are available by forcing the GPU context to instantiate.
12+
try {
13+
// ignore: unnecessary_statements
14+
gpu.gpuContext; // Force the context to instantiate.
15+
} catch (e) {
16+
// If impeller is not enabled, make sure the exception isn't about symbols missing.
17+
assert(e.toString().contains(
18+
'Flutter GPU requires the Impeller rendering backend to be enabled.'));
19+
}
20+
1021
// This is a hack to make Flutter think you are running on Google Fuchsia,
1122
// otherwise you will get an error about running from an unsupported platform.
1223
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;

shell/platform/embedder/embedder_exports.lst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
kDartIsolateSnapshotInstructions;
1414
kDartVmSnapshotData;
1515
kDartVmSnapshotInstructions;
16+
InternalFlutterGpu*;
17+
kInternalFlutterGpu*;
1618
local:
1719
*;
1820
};

0 commit comments

Comments
 (0)