5#include "flutter/impeller/toolkit/android/surface_transaction.h"
7#include "flutter/impeller/toolkit/android/hardware_buffer.h"
8#include "flutter/impeller/toolkit/android/surface_control.h"
14 : transaction_(
GetProcTable().ASurfaceTransaction_create()) {}
37 auto data = std::make_unique<TransactionInFlightData>();
39 proc_table.ASurfaceTransaction_setOnComplete(
42 [](
void* context, ASurfaceTransactionStats*
stats) ->
void {
43 auto data = reinterpret_cast<TransactionInFlightData*>(context);
44 data->callback(stats);
47 proc_table.ASurfaceTransaction_apply(transaction_.
get());
57 if (control ==
nullptr ||
buffer ==
nullptr) {
64 proc_table.ASurfaceTransaction_setEnableBackPressure(
67 proc_table.ASurfaceTransaction_setBuffer(
87 ADATASPACE_SRGB_LINEAR
97 if (new_parent && !new_parent->
IsValid()) {
103 new_parent ==
nullptr ?
nullptr : new_parent->
GetHandle()
110 GetProcTable().ASurfaceTransaction_create.IsAvailable();
void reset(const T &value=Traits::InvalidValue())
A wrapper for AHardwareBuffer https://developer.android.com/ndk/reference/group/a-hardware-buffer.
A wrapper for ASurfaceControl. https://developer.android.com/ndk/reference/group/native-activity#asur...
ASurfaceControl * GetHandle() const
bool SetContents(const SurfaceControl *control, const HardwareBuffer *buffer, fml::UniqueFD acquire_fence={})
Encodes that the updated contents of a surface control are specified by the given hardware buffer....
std::function< void(ASurfaceTransactionStats *)> OnCompleteCallback
bool Apply(OnCompleteCallback callback=nullptr)
Applies the updated encoded in the transaction and invokes the callback when the updated are complete...
bool SetBackgroundColor(const SurfaceControl &control, const Color &color)
Encodes the updated background color of the surface control. The update will not be committed till th...
bool SetParent(const SurfaceControl &control, const SurfaceControl *new_parent=nullptr)
Set the new parent control of the given control. If the new parent is null, it is removed from the co...
static bool IsAvailableOnPlatform()
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
const ProcTable & GetProcTable()
bool IsValid() const
If a valid proc table could be setup. This may fail in case of setup on non-Android platforms.
SurfaceTransaction::OnCompleteCallback callback
std::shared_ptr< const fml::Mapping > data