Merge "hwc: Define binder interface to set view frame of a display"

This commit is contained in:
Linux Build Service Account
2014-06-15 21:45:58 -07:00
committed by Gerrit - the friendly Code Review server
6 changed files with 48 additions and 33 deletions

View File

@@ -810,28 +810,6 @@ static void trimList(hwc_context_t *ctx, hwc_display_contents_1_t *list,
}
}
hwc_rect_t calculateDisplayViewFrame(hwc_context_t *ctx, int dpy) {
int dstWidth = ctx->dpyAttr[dpy].xres;
int dstHeight = ctx->dpyAttr[dpy].yres;
int srcWidth = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
int srcHeight = ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
// default we assume viewframe as a full frame for primary display
hwc_rect outRect = {0, 0, dstWidth, dstHeight};
if(dpy) {
// swap srcWidth and srcHeight, if the device orientation is 90 or 270.
if(ctx->deviceOrientation & 0x1) {
swap(srcWidth, srcHeight);
}
// Get Aspect Ratio for external
getAspectRatioPosition(dstWidth, dstHeight, srcWidth,
srcHeight, outRect);
}
ALOGD_IF(HWC_UTILS_DEBUG, "%s: view frame for dpy %d is [%d %d %d %d]",
__FUNCTION__, dpy, outRect.left, outRect.top,
outRect.right, outRect.bottom);
return outRect;
}
void setListStats(hwc_context_t *ctx,
hwc_display_contents_1_t *list, int dpy) {
const int prevYuvCount = ctx->listStats[dpy].yuvCount;
@@ -847,19 +825,13 @@ void setListStats(hwc_context_t *ctx,
ctx->listStats[dpy].isDisplayAnimating = false;
ctx->listStats[dpy].secureUI = false;
ctx->listStats[dpy].yuv4k2kCount = 0;
ctx->mViewFrame[dpy] = (hwc_rect_t){0, 0, 0, 0};
ctx->dpyAttr[dpy].mActionSafePresent = isActionSafePresent(ctx, dpy);
ctx->listStats[dpy].renderBufIndexforABC = -1;
resetROI(ctx, dpy);
// Calculate view frame of ext display from primary resolution
// and primary device orientation.
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++) {
hwc_layer_1_t const* layer = &list->hwLayers[i];
private_handle_t *hnd = (private_handle_t *)layer->handle;