 |
Flutter Impeller
|
|
Go to the documentation of this file.
14 : transaction_(
GetProcTable().ASurfaceTransaction_create()) {}
19 return transaction_.is_valid();
37 auto data = std::make_unique<TransactionInFlightData>();
38 data->callback = callback;
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) {
60 GetProcTable().ASurfaceTransaction_setBuffer(transaction_.get(),
72 GetProcTable().ASurfaceTransaction_setColor(transaction_.get(),
78 ADATASPACE_SRGB_LINEAR
88 if (new_parent && !new_parent->
IsValid()) {
94 new_parent ==
nullptr ?
nullptr : new_parent->
GetHandle()
101 GetProcTable().ASurfaceTransaction_create.IsAvailable();
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...
SurfaceTransaction::OnCompleteCallback callback
A wrapper for ASurfaceControl. https://developer.android.com/ndk/reference/group/native-activity#asur...
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 SetContents(const SurfaceControl *control, const HardwareBuffer *buffer)
Encodes that the updated contents of a surface control are specified by the given hardware buffer....
A wrapper for AHardwareBuffer https://developer.android.com/ndk/reference/group/a-hardware-buffer.
bool Apply(OnCompleteCallback callback=nullptr)
Applies the updated encoded in the transaction and invokes the callback when the updated are complete...
bool IsValid() const
If a valid proc table could be setup. This may fail in case of setup on non-Android platforms.
AHardwareBuffer * GetHandle() const
ASurfaceControl * GetHandle() const
const ProcTable & GetProcTable()
std::function< void(void)> OnCompleteCallback
static bool IsAvailableOnPlatform()