Copy virtual display FB to outbuf even with no app layers
In the current composition strategy we bail out if there are no app
layers present. However, this leads to undesirable behaviour if the
FB contains valid data that is expected as output. In this patch we
copy the FB to the output buffer to satisfy this use case.
Change-Id: If905d8b0652faf73b9aecad1abc760f21967807f
diff --git a/libhwcomposer/hwc_virtual.cpp b/libhwcomposer/hwc_virtual.cpp
index b26a733..fec5222 100644
--- a/libhwcomposer/hwc_virtual.cpp
+++ b/libhwcomposer/hwc_virtual.cpp
@@ -90,7 +90,7 @@
hwc_context_t* ctx = (hwc_context_t*)(dev);
const int dpy = HWC_DISPLAY_VIRTUAL;
- if (list && list->numHwLayers > 1) {
+ if (list && list->numHwLayers > 0) {
reset_layer_prop(ctx, dpy, list->numHwLayers - 1);
uint32_t last = list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];
@@ -124,7 +124,7 @@
int ret = 0;
const int dpy = HWC_DISPLAY_VIRTUAL;
- if (list && list->outbuf && list->numHwLayers > 1) {
+ if (list && list->outbuf && list->numHwLayers > 0) {
uint32_t last = list->numHwLayers - 1;
hwc_layer_1_t *fbLayer = &list->hwLayers[last];