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

Commit a2f4e56f authored by Mathias Agopian's avatar Mathias Agopian
Browse files

get rid off preserve backbuffer optimization in SF

this optimization didn't improve performance and in fact
seemed to hurt more than anything else. it also made
things a lot more complex as it introduced edges cases
when switching to/from h/w composer.

Change-Id: Iaafc235e175f5740cd98bff914d706e02ab88bb8
parent 172a62a2
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -280,12 +280,6 @@ void DisplayHardware::init(uint32_t dpy)
                EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);
    }

    if (eglQuerySurface(display, surface, EGL_SWAP_BEHAVIOR, &dummy) == EGL_TRUE) {
        if (dummy == EGL_BUFFER_PRESERVED) {
            mFlags |= BUFFER_PRESERVED;
        }
    }

    /*
     * Create our OpenGL ES context
     */
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ public:

    enum {
        COPY_BITS_EXTENSION         = 0x00000008,
        BUFFER_PRESERVED            = 0x00010000,
        PARTIAL_UPDATES             = 0x00020000,   // video driver feature
        SLOW_CONFIG                 = 0x00040000,   // software
        SWAP_RECTANGLE              = 0x00080000,
+1 −9
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display)
    : dpy(display), contentDirty(false),
      sequence(uint32_t(android_atomic_inc(&sSequence))),
      mFlinger(flinger), mFiltering(false),
      mNeedsFiltering(false), mInOverlay(false),
      mNeedsFiltering(false),
      mOrientation(0),
      mPlaneOrientation(0),
      mTransactionFlags(0),
@@ -333,14 +333,6 @@ void LayerBase::setPerFrameData(hwc_layer_t* hwcl) {
    hwcl->handle = NULL;
}

void LayerBase::setOverlay(bool inOverlay) {
    mInOverlay = inOverlay;
}

bool LayerBase::isOverlay() const {
    return mInOverlay;
}

void LayerBase::setFiltering(bool filtering)
{
    mFiltering = filtering;
+3 −9
Original line number Diff line number Diff line
@@ -109,8 +109,6 @@ public:

    virtual void setGeometry(hwc_layer_t* hwcl);
    virtual void setPerFrameData(hwc_layer_t* hwcl);
            void setOverlay(bool inOverlay);
            bool isOverlay() const;


    /**
@@ -231,13 +229,14 @@ public:
    int32_t  getOrientation() const { return mOrientation; }
    int32_t  getPlaneOrientation() const { return mPlaneOrientation; }

    void clearWithOpenGL(const Region& clip) const;

protected:
    const GraphicPlane& graphicPlane(int dpy) const;
          GraphicPlane& graphicPlane(int dpy);

          void clearWithOpenGL(const Region& clip, GLclampf r, GLclampf g,
                               GLclampf b, GLclampf alpha) const;
          void clearWithOpenGL(const Region& clip) const;
          void drawWithOpenGL(const Region& clip) const;

          void setFiltering(bool filtering);
@@ -255,11 +254,6 @@ private:
                // Whether filtering is needed b/c of the drawingstate
                bool            mNeedsFiltering;

                // this layer is currently handled by the hwc. this is
                // updated at composition time, always frmo the composition
                // thread.
                bool            mInOverlay;

protected:
                // cached during validateVisibility()
                int32_t         mOrientation;
+0 −2
Original line number Diff line number Diff line
@@ -70,8 +70,6 @@ void LayerScreenshot::initTexture(GLfloat u, GLfloat v) {
    glBindTexture(GL_TEXTURE_2D, mTextureName);
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    mTexCoords[0] = 0;         mTexCoords[1] = v;
    mTexCoords[2] = 0;         mTexCoords[3] = 0;
    mTexCoords[4] = u;         mTexCoords[5] = 0;
Loading