Merge change Ib548dbb2 into eclair

* changes:
  improve video performance to minimize the tearing effect seen in 720p movies
This commit is contained in:
Android (Google) Code Review
2009-12-09 01:39:23 -08:00

View File

@@ -120,9 +120,7 @@ uint32_t LayerBuffer::doTransaction(uint32_t flags)
source->onTransaction(flags); source->onTransaction(flags);
uint32_t res = LayerBase::doTransaction(flags); uint32_t res = LayerBase::doTransaction(flags);
// we always want filtering for these surfaces // we always want filtering for these surfaces
if (!(mFlags & DisplayHardware::SLOW_CONFIG)) { mUseLinearFiltering = !(mFlags & DisplayHardware::SLOW_CONFIG);
mUseLinearFiltering = true;
}
return res; return res;
} }
@@ -371,25 +369,33 @@ LayerBuffer::BufferSource::BufferSource(LayerBuffer& layer,
// note that the size of this buffer doesn't really matter, // note that the size of this buffer doesn't really matter,
// the final image will always be drawn with proper aspect ratio. // the final image will always be drawn with proper aspect ratio.
int w = buffers.w; int w = layer.mTransformedBounds.width();
int h = buffers.h; int h = layer.mTransformedBounds.height();
if (buffers.w * h != buffers.h * w) {
int t = w; w = h; h = t;
}
if (buffers.w * h == buffers.h * w) {
// same pixel area, don't use filtering
layer.mUseLinearFiltering = false;
}
mTempGraphicBuffer.clear(); mTempGraphicBuffer.clear();
mTempGraphicBuffer = new GraphicBuffer( mTempGraphicBuffer = new GraphicBuffer(
w, h, HAL_PIXEL_FORMAT_RGBX_8888, w, h, HAL_PIXEL_FORMAT_RGB_565,
GraphicBuffer::USAGE_HW_TEXTURE | GraphicBuffer::USAGE_HW_TEXTURE |
GraphicBuffer::USAGE_HW_2D); GraphicBuffer::USAGE_HW_2D);
if (mTempGraphicBuffer->initCheck() == NO_ERROR) { if (mTempGraphicBuffer->initCheck() == NO_ERROR) {
NativeBuffer& dst(mTempBuffer); NativeBuffer& dst(mTempBuffer);
dst.img.w = mTempGraphicBuffer->getStride(); dst.img.w = mTempGraphicBuffer->getStride();
dst.img.h = mTempGraphicBuffer->getHeight(); dst.img.h = h;
dst.img.format = mTempGraphicBuffer->getPixelFormat(); dst.img.format = mTempGraphicBuffer->getPixelFormat();
dst.img.handle = (native_handle_t *)mTempGraphicBuffer->handle; dst.img.handle = (native_handle_t *)mTempGraphicBuffer->handle;
dst.img.base = 0; dst.img.base = 0;
dst.crop.l = 0; dst.crop.l = 0;
dst.crop.t = 0; dst.crop.t = 0;
dst.crop.r = mTempGraphicBuffer->getWidth(); dst.crop.r = w;
dst.crop.b = mTempGraphicBuffer->getHeight(); dst.crop.b = h;
} else { } else {
mTempGraphicBuffer.clear(); mTempGraphicBuffer.clear();
} }