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

Commit 2abfb3ef authored by Jamie Gennis's avatar Jamie Gennis Committed by Android Git Automerger
Browse files

am cbb1a958: SurfaceFlinger: tell SurfaceTex about filtering

* commit 'cbb1a958':
  SurfaceFlinger: tell SurfaceTex about filtering
parents 5ce4b59f cbb1a958
Loading
Loading
Loading
Loading
+11 −10
Original line number Original line Diff line number Diff line
@@ -317,16 +317,24 @@ void Layer::onDraw(const Region& clip) const
    }
    }


    if (!isProtected()) {
    if (!isProtected()) {
        // TODO: we could be more subtle with isFixedSize()
        const bool useFiltering = getFiltering() || needsFiltering() || isFixedSize();

        // Query the texture matrix given our current filtering mode.
        float textureMatrix[16];
        mSurfaceTexture->setFilteringEnabled(useFiltering);
        mSurfaceTexture->getTransformMatrix(textureMatrix);

        // Set things up for texturing.
        glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureName);
        glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureName);
        GLenum filter = GL_NEAREST;
        GLenum filter = GL_NEAREST;
        if (getFiltering() || needsFiltering() || isFixedSize() || isCropped()) {
        if (useFiltering) {
            // TODO: we could be more subtle with isFixedSize()
            filter = GL_LINEAR;
            filter = GL_LINEAR;
        }
        }
        glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, filter);
        glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, filter);
        glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, filter);
        glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, filter);
        glMatrixMode(GL_TEXTURE);
        glMatrixMode(GL_TEXTURE);
        glLoadMatrixf(mTextureMatrix);
        glLoadMatrixf(textureMatrix);
        glMatrixMode(GL_MODELVIEW);
        glMatrixMode(GL_MODELVIEW);
        glDisable(GL_TEXTURE_2D);
        glDisable(GL_TEXTURE_2D);
        glEnable(GL_TEXTURE_EXTERNAL_OES);
        glEnable(GL_TEXTURE_EXTERNAL_OES);
@@ -494,13 +502,6 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
            mFlinger->invalidateHwcGeometry();
            mFlinger->invalidateHwcGeometry();
        }
        }


        GLfloat textureMatrix[16];
        mSurfaceTexture->getTransformMatrix(textureMatrix);
        if (memcmp(textureMatrix, mTextureMatrix, sizeof(textureMatrix))) {
            memcpy(mTextureMatrix, textureMatrix, sizeof(textureMatrix));
            mFlinger->invalidateHwcGeometry();
        }

        uint32_t bufWidth  = mActiveBuffer->getWidth();
        uint32_t bufWidth  = mActiveBuffer->getWidth();
        uint32_t bufHeight = mActiveBuffer->getHeight();
        uint32_t bufHeight = mActiveBuffer->getHeight();
        if (oldActiveBuffer != NULL) {
        if (oldActiveBuffer != NULL) {
+0 −1
Original line number Original line Diff line number Diff line
@@ -114,7 +114,6 @@ private:


    // main thread
    // main thread
    sp<GraphicBuffer> mActiveBuffer;
    sp<GraphicBuffer> mActiveBuffer;
    GLfloat mTextureMatrix[16];
    Rect mCurrentCrop;
    Rect mCurrentCrop;
    uint32_t mCurrentTransform;
    uint32_t mCurrentTransform;
    uint32_t mCurrentScalingMode;
    uint32_t mCurrentScalingMode;