Loading libs/surfaceflinger/LayerBuffer.cpp +30 −16 Original line number Diff line number Diff line Loading @@ -328,7 +328,8 @@ bool LayerBuffer::Source::transformed() const { LayerBuffer::BufferSource::BufferSource(LayerBuffer& layer, const ISurface::BufferHeap& buffers) : Source(layer), mStatus(NO_ERROR), mBufferSize(0) : Source(layer), mStatus(NO_ERROR), mBufferSize(0), mUseEGLImageDirectly(true) { if (buffers.heap == NULL) { // this is allowed, but in this case, it is illegal to receive Loading Loading @@ -466,8 +467,22 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const #if defined(EGL_ANDROID_image_native_buffer) if (mLayer.mFlags & DisplayHardware::DIRECT_TEXTURE) { err = INVALID_OPERATION; if (ourBuffer->supportsCopybit()) { // 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, GraphicBuffer::USAGE_HW_TEXTURE, src.img.w, src.img.handle, false); err = mLayer.initializeEglImage(buffer, &mTexture); if (err != NO_ERROR) { mUseEGLImageDirectly = false; } } copybit_device_t* copybit = mLayer.mBlitEngine; if (copybit && ourBuffer->supportsCopybit()) { if (copybit && err != NO_ERROR) { // create our EGLImageKHR the first time err = initTempBuffer(); if (err == NO_ERROR) { Loading @@ -483,8 +498,7 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const clearTempBufferImage(); } } } else { err = INVALID_OPERATION; } } } #endif Loading libs/surfaceflinger/LayerBuffer.h +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ private: mutable LayerBase::Texture mTexture; mutable NativeBuffer mTempBuffer; mutable sp<GraphicBuffer> mTempGraphicBuffer; mutable bool mUseEGLImageDirectly; }; class OverlaySource : public Source { Loading Loading
libs/surfaceflinger/LayerBuffer.cpp +30 −16 Original line number Diff line number Diff line Loading @@ -328,7 +328,8 @@ bool LayerBuffer::Source::transformed() const { LayerBuffer::BufferSource::BufferSource(LayerBuffer& layer, const ISurface::BufferHeap& buffers) : Source(layer), mStatus(NO_ERROR), mBufferSize(0) : Source(layer), mStatus(NO_ERROR), mBufferSize(0), mUseEGLImageDirectly(true) { if (buffers.heap == NULL) { // this is allowed, but in this case, it is illegal to receive Loading Loading @@ -466,8 +467,22 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const #if defined(EGL_ANDROID_image_native_buffer) if (mLayer.mFlags & DisplayHardware::DIRECT_TEXTURE) { err = INVALID_OPERATION; if (ourBuffer->supportsCopybit()) { // 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, GraphicBuffer::USAGE_HW_TEXTURE, src.img.w, src.img.handle, false); err = mLayer.initializeEglImage(buffer, &mTexture); if (err != NO_ERROR) { mUseEGLImageDirectly = false; } } copybit_device_t* copybit = mLayer.mBlitEngine; if (copybit && ourBuffer->supportsCopybit()) { if (copybit && err != NO_ERROR) { // create our EGLImageKHR the first time err = initTempBuffer(); if (err == NO_ERROR) { Loading @@ -483,8 +498,7 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const clearTempBufferImage(); } } } else { err = INVALID_OPERATION; } } } #endif Loading
libs/surfaceflinger/LayerBuffer.h +1 −0 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ private: mutable LayerBase::Texture mTexture; mutable NativeBuffer mTempBuffer; mutable sp<GraphicBuffer> mTempGraphicBuffer; mutable bool mUseEGLImageDirectly; }; class OverlaySource : public Source { Loading