summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author Jim Shargo <jshargo@google.com> 2024-08-17 00:20:45 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-08-17 00:20:45 +0000
commit66394ad694a439fbfe80849d76c695e7362636fb (patch)
tree750023ed33bec3277765ba2828fad294e0d3b830 /services/surfaceflinger/SurfaceFlinger.cpp
parent9f392a9327668ef2e9487437397035533f79d394 (diff)
parent6ccc5e8b229804d9c86f7f80d2221c6951255a83 (diff)
Merge "sf: ConsumerBase-based classes now create their own BufferQueues" into main
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index b140fd6d1a..9ef46f0680 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -40,6 +40,7 @@
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/PermissionCache.h>
+#include <com_android_graphics_libgui_flags.h>
#include <com_android_graphics_surfaceflinger_flags.h>
#include <common/FlagManager.h>
#include <common/trace.h>
@@ -3728,11 +3729,20 @@ void SurfaceFlinger::processDisplayAdded(const wp<IBinder>& displayToken,
state.surface.get());
const auto displayId = PhysicalDisplayId::tryCast(compositionDisplay->getId());
LOG_FATAL_IF(!displayId);
+#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ)
+ const auto frameBufferSurface =
+ sp<FramebufferSurface>::make(getHwComposer(), *displayId, bqProducer, bqConsumer,
+ state.physical->activeMode->getResolution(),
+ ui::Size(maxGraphicsWidth, maxGraphicsHeight));
+ displaySurface = frameBufferSurface;
+ producer = frameBufferSurface->getSurface()->getIGraphicBufferProducer();
+#else
displaySurface =
sp<FramebufferSurface>::make(getHwComposer(), *displayId, bqConsumer,
state.physical->activeMode->getResolution(),
ui::Size(maxGraphicsWidth, maxGraphicsHeight));
producer = bqProducer;
+#endif // COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ)
}
LOG_FATAL_IF(!displaySurface);