Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
surface_control.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
impeller/toolkit/android/surface_control.h
"
6
7
#include "
impeller/base/validation.h
"
8
#include "
impeller/toolkit/android/surface_control_impl.h
"
9
#include "
impeller/toolkit/android/surface_transaction.h
"
10
11
namespace
impeller::android
{
12
13
std::unique_ptr<SurfaceControl>
SurfaceControl::Create
(
ANativeWindow
*
window
,
14
const
char
* debug_name) {
15
return
std::unique_ptr<SurfaceControl>(
16
new
SurfaceControlImpl
(
window
, debug_name));
17
}
18
19
bool
SurfaceControl::IsAvailableOnPlatform
() {
20
auto
api_level = android_get_device_api_level();
21
22
// Technically SurfaceControl is supported on API 29 but I've observed
23
// enough reported bugs that I'm bumping the constraint to 30. If
24
// we had more time to test all of these older devices maybe we could
25
// figure out what the problem is.
26
// https://github.com/flutter/flutter/issues/155877
27
return
api_level >= 29 &&
GetProcTable
().
IsValid
() &&
28
GetProcTable
().ASurfaceControl_createFromWindow.IsAvailable();
29
}
30
31
}
// namespace impeller::android
impeller::android::SurfaceControl::Create
static std::unique_ptr< SurfaceControl > Create(ANativeWindow *window, const char *debug_name=nullptr)
Creates a new surface control and adds it as a child of the given window.
Definition
surface_control.cc:13
impeller::android::SurfaceControl::IsAvailableOnPlatform
static bool IsAvailableOnPlatform()
Definition
surface_control.cc:19
impeller::android::SurfaceControlImpl
Definition
surface_control_impl.h:13
window
GLFWwindow * window
Definition
main.cc:60
impeller::android
Definition
ahb_swapchain_vk_unittests.cc:11
impeller::android::GetProcTable
const ProcTable & GetProcTable()
Definition
proc_table.cc:12
impeller::android::ProcTable::IsValid
bool IsValid() const
If a valid proc table could be setup. This may fail in case of setup on non-Android platforms.
Definition
proc_table.cc:65
surface_control.h
surface_control_impl.h
surface_transaction.h
validation.h
ANativeWindow
struct ANativeWindow ANativeWindow
Definition
vulkan_native_surface_android.h:12
impeller
toolkit
android
surface_control.cc
Generated on Mon May 25 2026 06:07:36 for Flutter Engine Uber Docs by
1.9.8