Merge "hwc: Refactor disable animation on external"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
c25d39f9e9
@@ -172,6 +172,7 @@ void initContext(hwc_context_t *ctx)
|
||||
for (uint32_t i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
|
||||
ctx->mHwcDebug[i] = new HwcDebug(i);
|
||||
ctx->mLayerRotMap[i] = new LayerRotMap();
|
||||
ctx->mAnimationState[i] = ANIMATION_STOPPED;
|
||||
}
|
||||
|
||||
MDPComp::init(ctx);
|
||||
@@ -189,13 +190,8 @@ void initContext(hwc_context_t *ctx)
|
||||
defaultServiceManager()->getService(
|
||||
String16("display.qservice")))->connect(client);
|
||||
|
||||
// Initialize "No animation on external display" related parameters.
|
||||
// Initialize device orientation to its default orientation
|
||||
ctx->deviceOrientation = 0;
|
||||
ctx->mPrevCropVideo.left = ctx->mPrevCropVideo.top =
|
||||
ctx->mPrevCropVideo.right = ctx->mPrevCropVideo.bottom = 0;
|
||||
ctx->mPrevDestVideo.left = ctx->mPrevDestVideo.top =
|
||||
ctx->mPrevDestVideo.right = ctx->mPrevDestVideo.bottom = 0;
|
||||
ctx->mPrevTransformVideo = 0;
|
||||
ctx->mBufferMirrorMode = false;
|
||||
#ifdef VPU_TARGET
|
||||
ctx->mVPUClient = new VPUClient();
|
||||
@@ -1241,12 +1237,7 @@ int hwc_sync(hwc_context_t *ctx, hwc_display_contents_1_t* list, int dpy,
|
||||
} else if(isExtAnimating) {
|
||||
// Release all the app layer fds immediately,
|
||||
// if animation is in progress.
|
||||
hwc_layer_1_t const* layer = &list->hwLayers[i];
|
||||
private_handle_t *hnd = (private_handle_t *)layer->handle;
|
||||
if(isYuvBuffer(hnd)) {
|
||||
list->hwLayers[i].releaseFenceFd = dup(releaseFd);
|
||||
} else
|
||||
list->hwLayers[i].releaseFenceFd = -1;
|
||||
list->hwLayers[i].releaseFenceFd = -1;
|
||||
} else if(list->hwLayers[i].releaseFenceFd < 0) {
|
||||
//If rotator has not already populated this field.
|
||||
list->hwLayers[i].releaseFenceFd = dup(releaseFd);
|
||||
@@ -1494,25 +1485,6 @@ int configureNonSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
}
|
||||
|
||||
if(dpy && isYuvBuffer(hnd)) {
|
||||
if(!ctx->listStats[dpy].isDisplayAnimating) {
|
||||
ctx->mPrevCropVideo = crop;
|
||||
ctx->mPrevDestVideo = dst;
|
||||
ctx->mPrevTransformVideo = transform;
|
||||
} else {
|
||||
// Restore the previous crop, dest rect and transform values, during
|
||||
// animation to avoid displaying videos at random coordinates.
|
||||
crop = ctx->mPrevCropVideo;
|
||||
dst = ctx->mPrevDestVideo;
|
||||
transform = ctx->mPrevTransformVideo;
|
||||
orient = static_cast<eTransform>(transform);
|
||||
//In you tube use case when a device rotated from landscape to
|
||||
// portrait, set the isFg flag and zOrder to avoid displaying UI on
|
||||
// hdmi during animation
|
||||
if(ctx->deviceOrientation) {
|
||||
isFg = ovutils::IS_FG_SET;
|
||||
z = ZORDER_1;
|
||||
}
|
||||
}
|
||||
calcExtDisplayPosition(ctx, hnd, dpy, crop, dst,
|
||||
transform, orient);
|
||||
}
|
||||
@@ -1623,28 +1595,6 @@ int configureSplit(hwc_context_t *ctx, hwc_layer_1_t *layer,
|
||||
whf.format = getMdpFormat(HAL_PIXEL_FORMAT_BGRX_8888);
|
||||
}
|
||||
|
||||
if(dpy && isYuvBuffer(hnd)) {
|
||||
if(!ctx->listStats[dpy].isDisplayAnimating) {
|
||||
ctx->mPrevCropVideo = crop;
|
||||
ctx->mPrevDestVideo = dst;
|
||||
ctx->mPrevTransformVideo = transform;
|
||||
} else {
|
||||
// Restore the previous crop, dest rect and transform values, during
|
||||
// animation to avoid displaying videos at random coordinates.
|
||||
crop = ctx->mPrevCropVideo;
|
||||
dst = ctx->mPrevDestVideo;
|
||||
transform = ctx->mPrevTransformVideo;
|
||||
orient = static_cast<eTransform>(transform);
|
||||
//In you tube use case when a device rotated from landscape to
|
||||
// portrait, set the isFg flag and zOrder to avoid displaying UI on
|
||||
// hdmi during animation
|
||||
if(ctx->deviceOrientation) {
|
||||
isFg = ovutils::IS_FG_SET;
|
||||
z = ZORDER_1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setMdpFlags(layer, mdpFlagsL, 0, transform);
|
||||
|
||||
if(lDest != OV_INVALID && rDest != OV_INVALID) {
|
||||
|
||||
Reference in New Issue
Block a user