From a0dc58fce0889640415b80d423504d6d6c5d9145 Mon Sep 17 00:00:00 2001 From: Jeykumar Sankaran Date: Tue, 31 Jan 2012 17:27:01 -0800 Subject: [PATCH] libhwcomposer: Fix dynamic composition. Layer orientation can be ignored since displayFrame always represents the destination region in framebuffer orientation. (cherry picked from commit f6ab48d14d32ba805fc25597533de14dae1c4e2b) Change-Id: I0f9217e81a953a63cf9ea4ef9ddab25a1c67184e --- libhwcomposer/hwcomposer.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index fa89544..88a2881 100644 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -375,19 +375,12 @@ bool canSkipComposition(hwc_context_t* ctx, int yuvBufferCount, int currentLayer return false; } -void getNonRotatedResolution(const hwc_layer_t* layer, int& width, int& height) +inline void getLayerResolution(const hwc_layer_t* layer, int& width, int& height) { - int transform = layer->transform; + hwc_rect_t displayFrame = layer->displayFrame; - hwc_rect_t displayFrame = layer->displayFrame; - - width = displayFrame.right - displayFrame.left; - height = displayFrame.bottom - displayFrame.top; - - if(transform & (HWC_TRANSFORM_ROT_90 | HWC_TRANSFORM_ROT_270)) { - height = displayFrame.right - displayFrame.left; - width = displayFrame.bottom - displayFrame.top; - } + width = displayFrame.right - displayFrame.left; + height = displayFrame.bottom - displayFrame.top; } static bool canUseCopybit(const framebuffer_device_t* fbDev, const hwc_layer_list_t* list) { @@ -419,8 +412,8 @@ static bool canUseCopybit(const framebuffer_device_t* fbDev, const hwc_layer_lis int w1, h1; int w2, h2; - getNonRotatedResolution(&list->hwLayers[0], w1, h1); - getNonRotatedResolution(&list->hwLayers[1], w2, h2); + getLayerResolution(&list->hwLayers[0], w1, h1); + getLayerResolution(&list->hwLayers[1], w2, h2); use_copybit = ((fb_w >= w1) && (fb_w >= w2) && ((fb_h * 2) > (h1 + h2))); }