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

Commit 149173d2 authored by John Reck's avatar John Reck
Browse files

Support new EGL extensions

Bug: 21753739

Includes a revert of 13d1b4ab
as that only supported EGL_EXT_buffer_age

Change-Id: Ia86a47d19e3355c067934d7764c330b640c6958d
parent fb3a57d0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ LOCAL_SRC_FILES := \
    renderthread/RenderTask.cpp \
    renderthread/RenderThread.cpp \
    renderthread/TimeLord.cpp \
    renderthread/DirtyHistory.cpp \
    thread/TaskManager.cpp \
    utils/Blur.cpp \
    utils/GLUtils.cpp \
+0 −34
Original line number Diff line number Diff line
@@ -68,8 +68,6 @@ bool Caches::init() {
    mRegionMesh = nullptr;
    mProgram = nullptr;

    mFunctorsCount = 0;

    patchCache.init();

    mInitialized = true;
@@ -275,38 +273,6 @@ void Caches::flush(FlushMode mode) {
    GLUtils::dumpGLErrors();
}

///////////////////////////////////////////////////////////////////////////////
// Tiling
///////////////////////////////////////////////////////////////////////////////

void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool discard) {
    if (mExtensions.hasTiledRendering() && !Properties::debugOverdraw) {
        glStartTilingQCOM(x, y, width, height, (discard ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM));
    }
}

void Caches::endTiling() {
    if (mExtensions.hasTiledRendering() && !Properties::debugOverdraw) {
        glEndTilingQCOM(GL_COLOR_BUFFER_BIT0_QCOM);
    }
}

bool Caches::hasRegisteredFunctors() {
    return mFunctorsCount > 0;
}

void Caches::registerFunctors(uint32_t functorCount) {
    mFunctorsCount += functorCount;
}

void Caches::unregisterFunctors(uint32_t functorCount) {
    if (functorCount > mFunctorsCount) {
        mFunctorsCount = 0;
    } else {
        mFunctorsCount -= functorCount;
    }
}

///////////////////////////////////////////////////////////////////////////////
// Regions
///////////////////////////////////////////////////////////////////////////////
+0 −10
Original line number Diff line number Diff line
@@ -124,10 +124,6 @@ public:
     */
    void deleteLayerDeferred(Layer* layer);


    void startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool discard);
    void endTiling();

    /**
     * Returns the mesh used to draw regions. Calling this method will
     * bind a VBO of type GL_ELEMENT_ARRAY_BUFFER that contains the
@@ -141,10 +137,6 @@ public:
    void dumpMemoryUsage();
    void dumpMemoryUsage(String8& log);

    bool hasRegisteredFunctors();
    void registerFunctors(uint32_t functorCount);
    void unregisterFunctors(uint32_t functorCount);

    // Misc
    GLint maxTextureSize;

@@ -206,8 +198,6 @@ private:

    bool mInitialized;

    uint32_t mFunctorsCount;

    // TODO: move below to RenderState
    PixelBufferState* mPixelBufferState = nullptr;
    TextureState* mTextureState = nullptr;
+0 −11
Original line number Diff line number Diff line
@@ -53,21 +53,10 @@ Extensions::Extensions() {
    mHasFramebufferFetch = hasGlExtension("GL_NV_shader_framebuffer_fetch");
    mHasDiscardFramebuffer = hasGlExtension("GL_EXT_discard_framebuffer");
    mHasDebugMarker = hasGlExtension("GL_EXT_debug_marker");
    mHasTiledRendering = hasGlExtension("GL_QCOM_tiled_rendering");
    mHas1BitStencil = hasGlExtension("GL_OES_stencil1");
    mHas4BitStencil = hasGlExtension("GL_OES_stencil4");
    mHasUnpackSubImage = hasGlExtension("GL_EXT_unpack_subimage");

    // Query EGL extensions
    findExtensions(eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS), mEglExtensionList);

    char property[PROPERTY_VALUE_MAX];
    if (property_get(PROPERTY_DEBUG_NV_PROFILING, property, nullptr) > 0) {
        mHasNvSystemTime = !strcmp(property, "true") && hasEglExtension("EGL_NV_system_time");
    } else {
        mHasNvSystemTime = false;
    }

    const char* version = (const char*) glGetString(GL_VERSION);

    // Section 6.1.5 of the OpenGL ES specification indicates the GL version
+0 −4
Original line number Diff line number Diff line
@@ -40,10 +40,8 @@ public:
    inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; }
    inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; }
    inline bool hasDebugMarker() const { return mHasDebugMarker; }
    inline bool hasTiledRendering() const { return mHasTiledRendering; }
    inline bool has1BitStencil() const { return mHas1BitStencil; }
    inline bool has4BitStencil() const { return mHas4BitStencil; }
    inline bool hasNvSystemTime() const { return mHasNvSystemTime; }
    inline bool hasUnpackRowLength() const { return mVersionMajor >= 3 || mHasUnpackSubImage; }
    inline bool hasPixelBufferObjects() const { return mVersionMajor >= 3; }
    inline bool hasOcclusionQueries() const { return mVersionMajor >= 3; }
@@ -67,10 +65,8 @@ private:
    bool mHasFramebufferFetch;
    bool mHasDiscardFramebuffer;
    bool mHasDebugMarker;
    bool mHasTiledRendering;
    bool mHas1BitStencil;
    bool mHas4BitStencil;
    bool mHasNvSystemTime;
    bool mHasUnpackSubImage;

    int mVersionMajor;
Loading