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

Commit fb3c87f2 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am 33c8e2b8: Merge "better fix for [2420565] Surface.lockCanvas() updates the...

am 33c8e2b8: Merge "better fix for [2420565] Surface.lockCanvas() updates the dirty region too often" into kraken
parents 32c7e6a3 33c8e2b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ static jobject Surface_lockCanvas(JNIEnv* env, jobject clazz, jobject dirtyRect)
    
    SkRegion clipReg;
    if (dirtyRegion.isRect()) { // very common case
        const Rect& b(dirtyRegion.getBounds());
        const Rect b(dirtyRegion.getBounds());
        clipReg.setRect(b.left, b.top, b.right, b.bottom);
    } else {
        size_t count;
+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ private:
    sp<GraphicBuffer>           mLockedBuffer;
    sp<GraphicBuffer>           mPostedBuffer;
    mutable Region              mOldDirtyRegion;
    bool                        mNeedFullUpdate;
    bool                        mReserved;

    // query() must be called from dequeueBuffer() thread
    uint32_t                    mWidth;
+9 −3
Original line number Diff line number Diff line
@@ -540,10 +540,16 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
        mFlinger->signalEvent();
    }

    if (!mPostedDirtyRegion.isEmpty()) {
    /* a buffer was posted, so we need to call reloadTexture(), which
     * will update our internal data structures (eg: EGLImageKHR or
     * texture names). we need to do this even if mPostedDirtyRegion is
     * empty -- it's orthogonal to the fact that a new buffer was posted,
     * for instance, a degenerate case could be that the user did an empty
     * update but repainted the buffer with appropriate content (after a
     * resize for instance).
     */
    reloadTexture( mPostedDirtyRegion );
}
}

void Layer::unlockPageFlip(
        const Transform& planeTransform, Region& outDirtyRegion)
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display)
      mOrientation(0),
      mLeft(0), mTop(0),
      mTransactionFlags(0),
      mPremultipliedAlpha(true), mDebug(false),
      mPremultipliedAlpha(true), mName("unnamed"), mDebug(false),
      mInvalidate(0)
{
    const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware());
+6 −2
Original line number Diff line number Diff line
@@ -84,10 +84,14 @@ status_t SharedBufferStack::setDirtyRegion(int buffer, const Region& dirty)
    if (uint32_t(buffer) >= NUM_BUFFER_MAX)
        return BAD_INDEX;

    // in the current implementation we only send a single rectangle
    FlatRegion& reg(buffers[buffer].dirtyRegion);
    if (dirty.isEmpty()) {
        reg.count = 0;
        return NO_ERROR;
    }

    size_t count;
    Rect const* r = dirty.getArray(&count);
    FlatRegion& reg(buffers[buffer].dirtyRegion);
    if (count > FlatRegion::NUM_RECT_MAX) {
        const Rect bounds(dirty.getBounds());
        reg.count = 1;
Loading