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

Commit 10001700 authored by Rebecca Schultz Zavin's avatar Rebecca Schultz Zavin
Browse files

Add a flag to set whether the overlay has been initialized. Commit needs to...


Add a flag to set whether the overlay has been initialized.  Commit needs to be called at least once on each overlay, and it appears that sometimes this
doesn't happen because the visibility never changes.  With this change
the overlay parameter and position will be committed when either the visibility
of the window changes, or on the first call to visibility resolved, if it
hasn't already been done.

Signed-off-by: default avatarRebecca Schultz Zavin <rebecca@android.com>
parent 96df49bb
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -575,6 +575,7 @@ LayerBuffer::OverlaySource::OverlaySource(LayerBuffer& layer,
    mFormat = overlay->format; 
    mFormat = overlay->format; 
    mWidthStride = overlay->w_stride;
    mWidthStride = overlay->w_stride;
    mHeightStride = overlay->h_stride;
    mHeightStride = overlay->h_stride;
    mInitialized = false;


    mOverlayHandle = overlay->getHandleRef(overlay);
    mOverlayHandle = overlay->getHandleRef(overlay);
    
    
@@ -614,8 +615,9 @@ void LayerBuffer::OverlaySource::onVisibilityResolved(
    // this code-path must be as tight as possible, it's called each time
    // this code-path must be as tight as possible, it's called each time
    // the screen is composited.
    // the screen is composited.
    if (UNLIKELY(mOverlay != 0)) {
    if (UNLIKELY(mOverlay != 0)) {
        if (mVisibilityChanged) {
        if (mVisibilityChanged || !mInitialized) {
            mVisibilityChanged = false;
            mVisibilityChanged = false;
            mInitialized = true;
            const Rect& bounds = mLayer.getTransformedBounds();
            const Rect& bounds = mLayer.getTransformedBounds();
            int x = bounds.left;
            int x = bounds.left;
            int y = bounds.top;
            int y = bounds.top;
+1 −0
Original line number Original line Diff line number Diff line
@@ -175,6 +175,7 @@ private:
        int32_t mWidthStride;
        int32_t mWidthStride;
        int32_t mHeightStride;
        int32_t mHeightStride;
        mutable Mutex mLock;
        mutable Mutex mLock;
        bool mInitialized;
    };
    };