From 4066a02c8328193a98fd033de20c287cb223f933 Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Tue, 14 Jun 2011 13:52:22 -0700 Subject: [PATCH] libhwcomposer: Honor the HWC_DO_NOT_USE_OVERLAY flag If SurfaceFlinger marks a layer with the HWC_DO_NOT_USE_OVERLAY flag, do not use the overlay to draw the layer (cherry picked from commit 9271a839b6bbbdc7b22bd7f1dca6f4c0c63de965) Change-Id: Ie44586a1254a2dc2ad41ae902debc5bb442cbfde --- libhwcomposer/hwcomposer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index 32d0b3f..c3d8f29 100755 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -57,7 +57,8 @@ enum HWCCompositionType { }; enum HWCPrivateFlags { - HWC_USE_ORIGINAL_RESOLUTION = 0x10000000, // This layer is to be drawn using overlays + HWC_USE_ORIGINAL_RESOLUTION = HWC_FLAGS_PRIVATE_0, // This layer is to be drawn using overlays + HWC_DO_NOT_USE_OVERLAY = HWC_FLAGS_PRIVATE_1, // Do not use overlays to draw this layer }; enum HWCLayerType{ @@ -203,7 +204,8 @@ static int hwc_prepare(hwc_composer_device_t *dev, hwc_layer_list_t* list) { if (list) { for (size_t i=0 ; inumHwLayers; i++) { private_handle_t *hnd = (private_handle_t *)list->hwLayers[i].handle; - if(hnd && (hnd->bufferType == BUFFER_TYPE_VIDEO)) { + if(hnd && (hnd->bufferType == BUFFER_TYPE_VIDEO) && + !(list->hwLayers[i].flags & HWC_DO_NOT_USE_OVERLAY)) { yuvBufferCount++; if (yuvBufferCount > 1) { break;