hwc: Display view frame needs to be set before using it.

The display view frame needs to be set before calling trimLayer api
because it uses view frame to find the scissor for display, which is
used to clip crop for out-of-bounds display frame sent by framework.
If mViewFrame is not set, scissor will be empty rect, which leads to
wrong source crop calculation.

Change-Id: I52ad4eb9037d34aff24c30fe65e3793684445264
This commit is contained in:
Sushil Chauhan
2014-04-09 09:15:37 -07:00
parent 867f16b54b
commit f68d0dfdbf

View File

@@ -817,13 +817,13 @@ void setListStats(hwc_context_t *ctx,
ctx->mViewFrame[dpy] = (hwc_rect_t){0, 0, 0, 0}; ctx->mViewFrame[dpy] = (hwc_rect_t){0, 0, 0, 0};
ctx->dpyAttr[dpy].mActionSafePresent = isActionSafePresent(ctx, dpy); ctx->dpyAttr[dpy].mActionSafePresent = isActionSafePresent(ctx, dpy);
trimList(ctx, list, dpy);
optimizeLayerRects(list);
// Calculate view frame of ext display from primary resolution // Calculate view frame of ext display from primary resolution
// and primary device orientation. // and primary device orientation.
ctx->mViewFrame[dpy] = calculateDisplayViewFrame(ctx, dpy); ctx->mViewFrame[dpy] = calculateDisplayViewFrame(ctx, dpy);
trimList(ctx, list, dpy);
optimizeLayerRects(list);
for (size_t i = 0; i < (size_t)ctx->listStats[dpy].numAppLayers; i++) { for (size_t i = 0; i < (size_t)ctx->listStats[dpy].numAppLayers; i++) {
hwc_layer_1_t const* layer = &list->hwLayers[i]; hwc_layer_1_t const* layer = &list->hwLayers[i];
private_handle_t *hnd = (private_handle_t *)layer->handle; private_handle_t *hnd = (private_handle_t *)layer->handle;