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

Commit f8f7dbd4 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

libagl: Allow use of copybit to accelerate 2D rendering

This appears to fix the 2D performance issues on msm7225 and msm7227,
no more stutter in animations or transitions
Enable with TARGET_LIBAGL_USE_GRALLOC_COPYBITS := true

Change-Id: If1e06dc2b7836e370053d1c664fe5192619e3015
parent 5122910c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -51,6 +51,13 @@ ifneq ($(TARGET_SIMULATOR),true)
    LOCAL_C_INCLUDES += bionic/libc/private
endif

ifneq ($(TARGET_LIBAGL_USE_GRALLOC_COPYBITS),)
    LOCAL_CFLAGS += -DLIBAGL_USE_GRALLOC_COPYBITS
    LOCAL_SRC_FILES += copybit.cpp
    LOCAL_SHARED_LIBRARIES += libui
endif


LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
LOCAL_MODULE:= libGLES_android

+3 −0
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ void EGLTextureObject::init()
    memset(crop_rect, 0, sizeof(crop_rect));
    generate_mipmap = GL_FALSE;
    direct = GL_FALSE;
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
    try_copybit = false;
#endif // LIBAGL_USE_GRALLOC_COPYBITS
    buffer = 0;
}

+3 −0
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@ public:
    GLint               crop_rect[4];
    GLint               generate_mipmap;
    GLint               direct;
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
    bool                try_copybit;
#endif // LIBAGL_USE_GRALLOC_COPYBITS
    android_native_buffer_t* buffer;
};

+9 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@
#include "primitives.h"
#include "texture.h"
#include "BufferObjectManager.h"
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
#include "copybit.h"
#endif // LIBAGL_USE_GRALLOC_COPYBITS

// ----------------------------------------------------------------------------

@@ -704,6 +707,12 @@ void drawPrimitivesTriangleStrip(ogles_context_t* c,

void drawPrimitivesTriangleFan(ogles_context_t* c,
        GLint first, GLsizei count) {
#ifdef LIBAGL_USE_GRALLOC_COPYBITS
    if (drawTriangleFanWithCopybit(c, first, count)) {
        return;
    }
#endif // LIBAGL_USE_GRALLOC_COPYBITS

    drawPrimitivesTriangleFanOrStrip(c, first, count, 2);
}

+618 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading