Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Impeller] require and use backpressure for AHB swapchain.
  • Loading branch information
jonahwilliams committed May 8, 2024
commit 0ae2d417a95d0b163e4ad65941e0b6c34d710408
1 change: 1 addition & 0 deletions impeller/toolkit/android/proc_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace impeller::android {
INVOKE(ASurfaceTransaction_setBuffer, 29) \
INVOKE(ASurfaceTransaction_setColor, 29) \
INVOKE(ASurfaceTransaction_setOnComplete, 29) \
INVOKE(ASurfaceTransaction_setEnableBackPressure, 31) \
INVOKE(ASurfaceTransactionStats_getPreviousReleaseFenceFd, 29) \
INVOKE(ATrace_isEnabled, 23) \
INVOKE(eglGetNativeClientBufferANDROID, 0)
Expand Down
4 changes: 3 additions & 1 deletion impeller/toolkit/android/surface_control.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "impeller/toolkit/android/surface_control.h"

#include "impeller/base/validation.h"
#include "impeller/toolkit/android/proc_table.h"
#include "impeller/toolkit/android/surface_transaction.h"

namespace impeller::android {
Expand Down Expand Up @@ -49,7 +50,8 @@ bool SurfaceControl::RemoveFromParent() const {

bool SurfaceControl::IsAvailableOnPlatform() {
return GetProcTable().IsValid() &&
GetProcTable().ASurfaceControl_createFromWindow.IsAvailable();
GetProcTable().ASurfaceControl_createFromWindow.IsAvailable() &&
GetProcTable().ASurfaceTransaction_setEnableBackPressure.IsAvailable();
}

} // namespace impeller::android
8 changes: 7 additions & 1 deletion impeller/toolkit/android/surface_transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ bool SurfaceTransaction::SetContents(const SurfaceControl* control,
VALIDATION_LOG << "Invalid control or buffer.";
return false;
}
GetProcTable().ASurfaceTransaction_setBuffer(

const auto& proc_table = GetProcTable();

proc_table.ASurfaceTransaction_setEnableBackPressure(
transaction_.get(), control->GetHandle(), true);

proc_table.ASurfaceTransaction_setBuffer(
transaction_.get(), //
control->GetHandle(), //
buffer->GetHandle(), //
Expand Down