summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBuffer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-01-20 13:24:14 -0800
committerMathias Agopian <mathias@google.com>2010-01-20 13:24:14 -0800
commit7323e545c8778beb6736a09a5d2c9f81b451e13f (patch)
treefe646ab161afb72a497b4fb5823a4eabfc6374a9 /libs/surfaceflinger/LayerBuffer.cpp
parent425500913aee9885a0f2de1dc5de82910035091e (diff)
downloadframeworks_base-7323e545c8778beb6736a09a5d2c9f81b451e13f.zip
frameworks_base-7323e545c8778beb6736a09a5d2c9f81b451e13f.tar.gz
frameworks_base-7323e545c8778beb6736a09a5d2c9f81b451e13f.tar.bz2
fix [2363506] [Sapphire] Video playback broken
don't try to use copybit for incompatible buffers
Diffstat (limited to 'libs/surfaceflinger/LayerBuffer.cpp')
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 2ff6167..dbcb367 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -261,7 +261,7 @@ sp<OverlayRef> LayerBuffer::SurfaceLayerBuffer::createOverlay(
// ============================================================================
LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers, ssize_t offset)
- : mBufferHeap(buffers)
+ : mBufferHeap(buffers), mSupportsCopybit(false)
{
NativeBuffer& src(mNativeBuffer);
src.crop.l = 0;
@@ -283,10 +283,8 @@ LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers, ssize_t offset)
offset, buffers.heap->base(),
&src.img.handle);
- LOGE_IF(err, "CREATE_HANDLE_FROM_BUFFER (heapId=%d, size=%d, "
- "offset=%ld, base=%p) failed (%s)",
- buffers.heap->heapID(), buffers.heap->getSize(),
- offset, buffers.heap->base(), strerror(-err));
+ // we can fail here is the passed buffer is purely software
+ mSupportsCopybit = (err == NO_ERROR);
}
}
@@ -453,7 +451,7 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
#if defined(EGL_ANDROID_image_native_buffer)
if (mLayer.mFlags & DisplayHardware::DIRECT_TEXTURE) {
copybit_device_t* copybit = mLayer.mBlitEngine;
- if (copybit) {
+ if (copybit && ourBuffer->supportsCopybit()) {
// create our EGLImageKHR the first time
err = initTempBuffer();
if (err == NO_ERROR) {