summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaceflinger/LayerBuffer.cpp')
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 0869283..7be3981 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -365,6 +365,14 @@ LayerBuffer::BufferSource::BufferSource(LayerBuffer& layer,
return;
}
+ const DisplayHardware& hw(mLayer.mFlinger->
+ graphicPlane(0).displayHardware());
+ int flags = hw.getFlags();
+ if(flags & DisplayHardware::SLOW_CONFIG)
+ mUseEGLImageDirectly = true;
+ else
+ mUseEGLImageDirectly = false;
+
mBufferHeap = buffers;
mLayer.setNeedsBlending((info.h_alpha - info.l_alpha) > 0);
mBufferSize = info.getScanlineSize(buffers.hor_stride)*buffers.ver_stride;
@@ -474,22 +482,22 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
// there are constraints on buffers used by the GPU and these may not
// be honored here. We need to change the API so the buffers
// are allocated with gralloc. For now disable this code-path
-#if 0
+
// First, try to use the buffer as an EGLImage directly
if (mUseEGLImageDirectly) {
// NOTE: Assume the buffer is allocated with the proper USAGE flags
sp<GraphicBuffer> buffer = new GraphicBuffer(
- src.img.w, src.img.h, src.img.format,
+ src.crop.r, src.crop.b, src.img.format,
GraphicBuffer::USAGE_HW_TEXTURE,
src.img.w, src.img.handle, false);
+ buffer->setVerticalStride(src.img.h);
err = mLayer.initializeEglImage(buffer, &mTexture);
if (err != NO_ERROR) {
mUseEGLImageDirectly = false;
}
}
-#endif
copybit_device_t* copybit = mLayer.mBlitEngine;
if (copybit && err != NO_ERROR) {