Skip to content

Commit 0c41729

Browse files
author
Jonah Williams
authored
[Impeller] require and use backpressure for AHB swapchain. (flutter#52676)
I think we might be buffer stuffing on the A02s specifically. Though I don't know if this will just "fix" it by turning off the swapchain for that device. flutter/flutter#147721
1 parent 86d2768 commit 0c41729

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

impeller/toolkit/android/proc_table.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ namespace impeller::android {
6060
INVOKE(ASurfaceTransaction_setBuffer, 29) \
6161
INVOKE(ASurfaceTransaction_setColor, 29) \
6262
INVOKE(ASurfaceTransaction_setOnComplete, 29) \
63+
INVOKE(ASurfaceTransaction_setEnableBackPressure, 31) \
6364
INVOKE(ASurfaceTransactionStats_getPreviousReleaseFenceFd, 29) \
6465
INVOKE(ATrace_isEnabled, 23) \
6566
INVOKE(eglGetNativeClientBufferANDROID, 0)

impeller/toolkit/android/surface_control.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "impeller/toolkit/android/surface_control.h"
66

77
#include "impeller/base/validation.h"
8+
#include "impeller/toolkit/android/proc_table.h"
89
#include "impeller/toolkit/android/surface_transaction.h"
910

1011
namespace impeller::android {
@@ -49,7 +50,8 @@ bool SurfaceControl::RemoveFromParent() const {
4950

5051
bool SurfaceControl::IsAvailableOnPlatform() {
5152
return GetProcTable().IsValid() &&
52-
GetProcTable().ASurfaceControl_createFromWindow.IsAvailable();
53+
GetProcTable().ASurfaceControl_createFromWindow.IsAvailable() &&
54+
GetProcTable().ASurfaceTransaction_setEnableBackPressure.IsAvailable();
5355
}
5456

5557
} // namespace impeller::android

impeller/toolkit/android/surface_transaction.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ bool SurfaceTransaction::SetContents(const SurfaceControl* control,
5858
VALIDATION_LOG << "Invalid control or buffer.";
5959
return false;
6060
}
61-
GetProcTable().ASurfaceTransaction_setBuffer(
61+
62+
const auto& proc_table = GetProcTable();
63+
64+
proc_table.ASurfaceTransaction_setEnableBackPressure(
65+
transaction_.get(), control->GetHandle(), true);
66+
67+
proc_table.ASurfaceTransaction_setBuffer(
6268
transaction_.get(), //
6369
control->GetHandle(), //
6470
buffer->GetHandle(), //

0 commit comments

Comments
 (0)