Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c61dd2b authored by Naomi Luis's avatar Naomi Luis Committed by toastcfh
Browse files

Add support for drawing non-GPU supported buffers.

Add support for drawing buffers which are not supported by the GPU.
These buffers are drawn using the overlay or C2D. During rotation,
when the draw operation is performed, the GPU clears the clip region
for this buffer.

Change-Id: I8738dcffbfb31db330872ec2c295181b540e03fb
parent 06ea7500
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -817,7 +817,23 @@ status_t SurfaceTexture::updateTexImage() {
        // Update the GL texture object.
        EGLImageKHR image = mSlots[buf].mEglImage;
        EGLDisplay dpy = eglGetCurrentDisplay();
#ifdef QCOM_HARDWARE
	if (isGPUSupportedFormat(mSlots[buf].mGraphicBuffer->format)) {
            // Update the GL texture object.
            EGLImageKHR image = mSlots[buf].mEglImage;
#else
        if (image == EGL_NO_IMAGE_KHR) {
            if (mSlots[buf].mGraphicBuffer == 0) {
                ST_LOGE("buffer at slot %d is null", buf);
                return BAD_VALUE;
            }
            image = createImage(dpy, mSlots[buf].mGraphicBuffer);
            mSlots[buf].mEglImage = image;
            mSlots[buf].mEglDisplay = dpy;
#endif
            if (image == EGL_NO_IMAGE_KHR) {
#ifdef QCOM_HARDWARE
		EGLDisplay dpy = eglGetCurrentDisplay();
                if (mSlots[buf].mGraphicBuffer == 0) {
                    ST_LOGE("buffer at slot %d is null", buf);
                    return BAD_VALUE;
@@ -826,6 +842,7 @@ status_t SurfaceTexture::updateTexImage() {
                mSlots[buf].mEglImage = image;
                mSlots[buf].mEglDisplay = dpy;
                if (image == EGL_NO_IMAGE_KHR) {
#endif
                // NOTE: if dpy was invalid, createImage() is guaranteed to
                // fail. so we'd end up here.
                return -EINVAL;
+4 −1
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ ifeq ($(TARGET_BOARD_PLATFORM), s5pc110)
	LOCAL_CFLAGS += -DREFRESH_RATE=56
endif
ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
LOCAL_SHARED_LIBRARIES := \
	libQcomUI
LOCAL_C_INCLUDES += hardware/qcom/display/libqcomui
LOCAL_CFLAGS += -DQCOM_HARDWARE
endif

+11 −0
Original line number Diff line number Diff line
@@ -39,6 +39,10 @@
#include "SurfaceFlinger.h"
#include "SurfaceTextureLayer.h"

#ifdef QCOM_HARDWARE
#include <qcom_ui.h>
#endif

#define DEBUG_RESIZE    0


@@ -285,6 +289,13 @@ void Layer::onDraw(const Region& clip) const
        return;
    }

#ifdef QCOM_HARDWARE
	if (!isGPUSupportedFormat(mActiveBuffer->format)) {
	    clearWithOpenGL(clip, 0, 0, 0, 1);
        return;
	}
#endif

    if (!isProtected()) {
        glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureName);
        GLenum filter = GL_NEAREST;