This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
impeller/renderer/backend/vulkan/swapchain/ahb Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,6 @@ std::shared_ptr<AHBSurfaceVK> AHBSwapchainVK::CreateNewSurface() {
134134std::shared_ptr<Surface> AHBSwapchainVK::AcquireNextDrawable () {
135135 TRACE_EVENT0 (" impeller" , __FUNCTION__);
136136
137- Lock lock (mutex_);
138-
139137 {
140138 TRACE_EVENT0 (" impeller" , " CompositorBackpressure" );
141139 // Accompanying signal is in the call to recycle the surface after the
@@ -146,6 +144,8 @@ std::shared_ptr<Surface> AHBSwapchainVK::AcquireNextDrawable() {
146144 }
147145 }
148146
147+ Lock lock (mutex_);
148+
149149 if (auto surface = PopRecyclable ()) {
150150 FML_LOG (IMPORTANT) << " Recycled surface." ;
151151 return surface;
@@ -204,8 +204,10 @@ bool AHBSwapchainVK::PresentSurface(
204204
205205void AHBSwapchainVK::OnSurfaceDidCompleteBeingUsedByCompositor (
206206 std::shared_ptr<AHBSurfaceVK> surface) {
207- Lock lock (mutex_);
208- PushRecyclable (std::move (surface));
207+ {
208+ Lock lock (mutex_);
209+ PushRecyclable (std::move (surface));
210+ }
209211 drawable_count_sema_.Signal ();
210212}
211213
Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ class AHBSwapchainVK final
6565 std::weak_ptr<Context> context_;
6666 std::shared_ptr<android::NativeWindow> native_window_;
6767 std::shared_ptr<android::SurfaceControl> surface_control_;
68+ fml::Semaphore drawable_count_sema_;
6869 mutable Mutex mutex_;
69- fml::Semaphore drawable_count_sema_ IPLR_GUARDED_BY (mutex_);
7070 android::HardwareBufferDescriptor desc_ IPLR_GUARDED_BY (mutex_);
7171 std::deque<Recyclable> recyclable_ IPLR_GUARDED_BY (mutex_);
7272 bool is_valid_ = false ;
You can’t perform that action at this time.
0 commit comments