Merge "fix display artifacts in preview screen in timelapse video mode"
This commit is contained in:
committed by
Android (Google) Code Review
commit
66b665ab8b
@@ -212,6 +212,24 @@ void Layer::setGeometry(hwc_layer_t* hwcl)
|
|||||||
} else {
|
} else {
|
||||||
hwcl->transform = finalTransform;
|
hwcl->transform = finalTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isCropped()) {
|
||||||
|
hwcl->sourceCrop.left = mCurrentCrop.left;
|
||||||
|
hwcl->sourceCrop.top = mCurrentCrop.top;
|
||||||
|
hwcl->sourceCrop.right = mCurrentCrop.right;
|
||||||
|
hwcl->sourceCrop.bottom = mCurrentCrop.bottom;
|
||||||
|
} else {
|
||||||
|
const sp<GraphicBuffer>& buffer(mActiveBuffer);
|
||||||
|
hwcl->sourceCrop.left = 0;
|
||||||
|
hwcl->sourceCrop.top = 0;
|
||||||
|
if (buffer != NULL) {
|
||||||
|
hwcl->sourceCrop.right = buffer->width;
|
||||||
|
hwcl->sourceCrop.bottom = buffer->height;
|
||||||
|
} else {
|
||||||
|
hwcl->sourceCrop.right = mTransformedBounds.width();
|
||||||
|
hwcl->sourceCrop.bottom = mTransformedBounds.height();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::setPerFrameData(hwc_layer_t* hwcl) {
|
void Layer::setPerFrameData(hwc_layer_t* hwcl) {
|
||||||
@@ -225,23 +243,6 @@ void Layer::setPerFrameData(hwc_layer_t* hwcl) {
|
|||||||
} else {
|
} else {
|
||||||
hwcl->handle = buffer->handle;
|
hwcl->handle = buffer->handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCropped()) {
|
|
||||||
hwcl->sourceCrop.left = mCurrentCrop.left;
|
|
||||||
hwcl->sourceCrop.top = mCurrentCrop.top;
|
|
||||||
hwcl->sourceCrop.right = mCurrentCrop.right;
|
|
||||||
hwcl->sourceCrop.bottom = mCurrentCrop.bottom;
|
|
||||||
} else {
|
|
||||||
hwcl->sourceCrop.left = 0;
|
|
||||||
hwcl->sourceCrop.top = 0;
|
|
||||||
if (buffer != NULL) {
|
|
||||||
hwcl->sourceCrop.right = buffer->width;
|
|
||||||
hwcl->sourceCrop.bottom = buffer->height;
|
|
||||||
} else {
|
|
||||||
hwcl->sourceCrop.right = mTransformedBounds.width();
|
|
||||||
hwcl->sourceCrop.bottom = mTransformedBounds.height();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Layer::onDraw(const Region& clip) const
|
void Layer::onDraw(const Region& clip) const
|
||||||
@@ -416,8 +417,7 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
|
sp<GraphicBuffer> newFrontBuffer(mSurfaceTexture->getCurrentBuffer());
|
||||||
mSurfaceTexture->getTransformMatrix(mTextureMatrix);
|
|
||||||
|
|
||||||
const Rect crop(mSurfaceTexture->getCurrentCrop());
|
const Rect crop(mSurfaceTexture->getCurrentCrop());
|
||||||
const uint32_t transform(mSurfaceTexture->getCurrentTransform());
|
const uint32_t transform(mSurfaceTexture->getCurrentTransform());
|
||||||
@@ -432,7 +432,23 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
|
|||||||
mFlinger->invalidateHwcGeometry();
|
mFlinger->invalidateHwcGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
mCurrentOpacity = getOpacityForFormat(mActiveBuffer->format);
|
GLfloat textureMatrix[16];
|
||||||
|
mSurfaceTexture->getTransformMatrix(textureMatrix);
|
||||||
|
if (memcmp(textureMatrix, mTextureMatrix, sizeof(textureMatrix))) {
|
||||||
|
memcpy(mTextureMatrix, textureMatrix, sizeof(textureMatrix));
|
||||||
|
mFlinger->invalidateHwcGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t bufWidth = newFrontBuffer->getWidth();
|
||||||
|
uint32_t bufHeight = newFrontBuffer->getHeight();
|
||||||
|
if (mActiveBuffer != NULL) {
|
||||||
|
if (bufWidth != uint32_t(mActiveBuffer->width) ||
|
||||||
|
bufHeight != uint32_t(mActiveBuffer->height)) {
|
||||||
|
mFlinger->invalidateHwcGeometry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mCurrentOpacity = getOpacityForFormat(newFrontBuffer->format);
|
||||||
if (oldOpacity != isOpaque()) {
|
if (oldOpacity != isOpaque()) {
|
||||||
recomputeVisibleRegions = true;
|
recomputeVisibleRegions = true;
|
||||||
}
|
}
|
||||||
@@ -446,15 +462,14 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
|
|||||||
// FIXME: mPostedDirtyRegion = dirty & bounds
|
// FIXME: mPostedDirtyRegion = dirty & bounds
|
||||||
mPostedDirtyRegion.set(front.w, front.h);
|
mPostedDirtyRegion.set(front.w, front.h);
|
||||||
|
|
||||||
|
// update active buffer
|
||||||
|
mActiveBuffer = newFrontBuffer;
|
||||||
|
|
||||||
if ((front.w != front.requested_w) ||
|
if ((front.w != front.requested_w) ||
|
||||||
(front.h != front.requested_h))
|
(front.h != front.requested_h))
|
||||||
{
|
{
|
||||||
// check that we received a buffer of the right size
|
// check that we received a buffer of the right size
|
||||||
// (Take the buffer's orientation into account)
|
// (Take the buffer's orientation into account)
|
||||||
sp<GraphicBuffer> newFrontBuffer(mActiveBuffer);
|
|
||||||
uint32_t bufWidth = newFrontBuffer->getWidth();
|
|
||||||
uint32_t bufHeight = newFrontBuffer->getHeight();
|
|
||||||
if (mCurrentTransform & Transform::ROT_90) {
|
if (mCurrentTransform & Transform::ROT_90) {
|
||||||
swap(bufWidth, bufHeight);
|
swap(bufWidth, bufHeight);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,15 +335,16 @@ void LayerBase::setGeometry(hwc_layer_t* hwcl)
|
|||||||
reinterpret_cast<hwc_rect_t const *>(
|
reinterpret_cast<hwc_rect_t const *>(
|
||||||
visibleRegionScreen.getArray(
|
visibleRegionScreen.getArray(
|
||||||
&hwcl->visibleRegionScreen.numRects));
|
&hwcl->visibleRegionScreen.numRects));
|
||||||
|
|
||||||
|
hwcl->sourceCrop.left = 0;
|
||||||
|
hwcl->sourceCrop.top = 0;
|
||||||
|
hwcl->sourceCrop.right = mTransformedBounds.width();
|
||||||
|
hwcl->sourceCrop.bottom = mTransformedBounds.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerBase::setPerFrameData(hwc_layer_t* hwcl) {
|
void LayerBase::setPerFrameData(hwc_layer_t* hwcl) {
|
||||||
hwcl->compositionType = HWC_FRAMEBUFFER;
|
hwcl->compositionType = HWC_FRAMEBUFFER;
|
||||||
hwcl->handle = NULL;
|
hwcl->handle = NULL;
|
||||||
hwcl->sourceCrop.left = 0;
|
|
||||||
hwcl->sourceCrop.top = 0;
|
|
||||||
hwcl->sourceCrop.right = mTransformedBounds.width();
|
|
||||||
hwcl->sourceCrop.bottom = mTransformedBounds.height();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerBase::setFiltering(bool filtering)
|
void LayerBase::setFiltering(bool filtering)
|
||||||
|
|||||||
Reference in New Issue
Block a user