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

Commit 117bdbcf authored by Chris Craik's avatar Chris Craik
Browse files

Glop ColorFilter & VertexBuffer support, initial enable

Enables Glop rendering for supported Rects and VertexBuffers
Also removes unused Query object

Change-Id: Ibe227bc362685a153159f75077664f0947764e06
parent 34725687
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ inline bool needsExtraForEdge(float firstAlpha, float secondAlpha) {
void AmbientShadow::createAmbientShadow(bool isCasterOpaque,
        const Vector3* casterVertices, int casterVertexCount, const Vector3& centroid3d,
        float heightFactor, float geomFactor, VertexBuffer& shadowVertexBuffer) {
    shadowVertexBuffer.setMode(VertexBuffer::kIndices);
    shadowVertexBuffer.setMeshFeatureFlags(VertexBuffer::kAlpha | VertexBuffer::kIndices);

    // In order to computer the outer vertices in one loop, we need pre-compute
    // the normal by the vertex (n - 1) to vertex 0, and the spike and alpha value
+6 −5
Original line number Diff line number Diff line
@@ -48,10 +48,11 @@ Caches* Caches::sInstance = nullptr;
///////////////////////////////////////////////////////////////////////////////

Caches::Caches(RenderState& renderState)
        : patchCache(renderState)
        : gradientCache(mExtensions)
        , patchCache(renderState)
        , programCache(mExtensions)
        , dither(*this)
        , mRenderState(&renderState)
        , mExtensions(Extensions::getInstance())
        , mInitialized(false) {
    INIT_LOGD("Creating OpenGL renderer caches");
    init();
@@ -187,9 +188,9 @@ bool Caches::initProperties() {
        INIT_LOGD("  Draw reorder enabled");
    }

    return (prevDebugLayersUpdates != debugLayersUpdates) ||
            (prevDebugOverdraw != debugOverdraw) ||
            (prevDebugStencilClip != debugStencilClip);
    return (prevDebugLayersUpdates != debugLayersUpdates)
            || (prevDebugOverdraw != debugOverdraw)
            || (prevDebugStencilClip != debugStencilClip);
}

void Caches::terminate() {
+8 −4
Original line number Diff line number Diff line
@@ -178,14 +178,18 @@ public:
        kStencilShowRegion
    };
    StencilClipDebug debugStencilClip;

private:
    // Declared before gradientCache and programCache which need this to initialize.
    // TODO: cleanup / move elsewhere
    Extensions mExtensions;
public:
    TextureCache textureCache;
    LayerCache layerCache;
    RenderBufferCache renderBufferCache;
    GradientCache gradientCache;
    ProgramCache programCache;
    PathCache pathCache;
    PatchCache patchCache;
    PathCache pathCache;
    ProgramCache programCache;
    TessellationCache tessellationCache;
    TextDropShadowCache dropShadowCache;
    FboCache fboCache;
@@ -220,6 +224,7 @@ public:
    void setProgram(const ProgramDescription& description);
    void setProgram(Program* program);

    Extensions& extensions() { return mExtensions; }
    Program& program() { return *mProgram; }
    PixelBufferState& pixelBufferState() { return *mPixelBufferState; }
    TextureState& textureState() { return *mTextureState; }
@@ -248,7 +253,6 @@ private:
    }

    RenderState* mRenderState;
    Extensions& mExtensions;

    // Used to render layers
    std::unique_ptr<TextureVertex[]> mRegionMesh;
+1 −3
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@ Dither::Dither(Caches& caches)

void Dither::bindDitherTexture() {
    if (!mInitialized) {
        bool useFloatTexture = Extensions::getInstance().hasFloatTextures();

        glGenTextures(1, &mDitherTexture);
        mCaches.textureState().bindTexture(mDitherTexture);

@@ -43,7 +41,7 @@ void Dither::bindDitherTexture() {
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

        if (useFloatTexture) {
        if (mCaches.extensions().hasFloatTextures()) {
            // We use a R16F texture, let's remap the alpha channel to the
            // red channel to avoid changing the shader sampling code on GL ES 3.0+
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED);
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ namespace android {
namespace uirenderer {

class Caches;
class Extensions;
class Program;

// Must be a power of two
Loading