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);
47 proc_table.ASurfaceTransaction_apply(transaction_.
get());
56 if (control ==
nullptr ||
buffer ==
nullptr) {
78 ADATASPACE_SRGB_LINEAR
88 if (new_parent && !new_parent->
IsValid()) {
94 new_parent ==
nullptr ?
nullptr : new_parent->
GetHandle()
101 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)
Encodes that the updated contents of a surface control are specified by the given hardware buffer....
std::function< void(void)> 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
static const uint8_t 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