Skip to content

Commit

Permalink
Update version to 2.14.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ehopperdietzel committed Jan 27, 2025
1 parent 2f90eff commit 9f47021
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 18 deletions.
9 changes: 9 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Louvre (2.14.0-1)

# API Additions

- LOutput::repaintFilter(): Intercepts LOutput::repaint() calls, making it easier to retain the last rendered frame. Special thanks to @LeKinaSa and @jgroboredo for highlighting the need for this feature.

-- Eduardo Hopperdietzel <ehopperdietzel@gmail.com> Mon, 27 Jan 2025 17:47:20 -0300


Louvre (2.13.0-1)

# License
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<img src="https://img.shields.io/badge/license-LGPLv2.1-blue.svg" alt="Louvre is released under the LGPLv2.1 license." />
</a>
<a href="https://github.com/CuarzoSoftware/Louvre">
<img src="https://img.shields.io/badge/version-2.13.0-brightgreen" alt="Current Louvre version." />
<img src="https://img.shields.io/badge/version-2.14.0-brightgreen" alt="Current Louvre version." />
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.0
2.14.0
12 changes: 3 additions & 9 deletions pkg/fedora/latest.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%global basever 2.13.0
%global basever 2.14.0
%global origrel 1
%global somajor 2

Expand Down Expand Up @@ -90,11 +90,5 @@ pushd repo/src
%{_libdir}/pkgconfig/Louvre.pc

%changelog
* Sun Dec 08 2024 Eduardo Hopperdietzel <ehopperdietzel@gmail.com> - %{basever}-%{origrel}
- Updated license to LGPLv2.1.
- LTexture::write(Begin/Update/End): An alternative to LTexture::updateRect() that allows multiple texture updates without issuing an immediate internal synchronization.
- LOutput::currentBufferAge: Retrieves the age of the current buffer according to the [EGL_EXT_buffer_age](https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_buffer_age.txt) extension specification.
- Added damage tracking support.
- LPainter::bindProgram() now fully synchronizes all uniforms and GL state, instead of just binding its GL program. This resolves issues encountered when integrating external shaders.
- Replaced LScene index-based damage tracking with buffer age.
- Updated SRM dependency to >= 0.11.0.
* Mon Jan 27 2025 Eduardo Hopperdietzel <ehopperdietzel@gmail.com> - %{basever}-%{origrel}

8 changes: 4 additions & 4 deletions src/lib/core/LCompositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ bool LCompositor::start()
goto fail;
}

imp()->state = CompositorState::Initialized;
initialized();

imp()->events[LEV_UNLOCK].events = EPOLLIN;
imp()->events[LEV_UNLOCK].data.fd = eventfd(0, EFD_NONBLOCK);

Expand All @@ -247,6 +244,8 @@ bool LCompositor::start()
compositor()->imp()->events[LEV_UNLOCK].data.fd,
&compositor()->imp()->events[LEV_UNLOCK]);

imp()->state = CompositorState::Initialized;
initialized();
return true;

fail:
Expand Down Expand Up @@ -340,9 +339,10 @@ Int32 LCompositor::processLoop(Int32 msTimeout)

imp()->destroyPendingRenderBuffers(nullptr);
imp()->handleDestroyedClients();
imp()->handleOutputRepaintRequests();
}

imp()->handleOutputRepaintRequests();

if (state() == CompositorState::Uninitializing)
{
uninitialized();
Expand Down
1 change: 1 addition & 0 deletions src/lib/core/LOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ Float32 LOutput::scale() const noexcept

void LOutput::repaint() noexcept
{
// Check LCompositor::processLoop() -> LCompositorPrivate::handleOutputRepaintRequests()
imp()->stateFlags.add(LOutputPrivate::PendingRepaint);
compositor()->imp()->unlockPoll();
}
Expand Down
13 changes: 10 additions & 3 deletions src/lib/core/LOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,17 @@ class Louvre::LOutput : public LFactoryObject
virtual void availableGeometryChanged();

/**
* @brief Selectively disables repaint calls.
* @brief Temporarily disables repaint calls for this output.
*
* This method can be used to intercept repaint() calls and keep the last rendered frame.
* If `false` is returned, the repaint() call is ignored, preventing paintGL() from being triggered.
* An output locks its rendering thread until repaint() is called. However, many objects and implementations
* within the compositor may automatically trigger repaints to reflect changes, making it difficult to
* prevent unwanted repaints.
*
* This method intercepts repaint() calls and preserves the last rendered frame. When `false` is returned,
* the repaint() calls are ignored, and paintGL() is not triggered.
*
* @note During initialization, uninitialization, or mode changes, the rendering thread is forcefully
* unlocked and the filter is ignored to prevent deadlocks.
*
* #### Default Implementation
*
Expand Down
9 changes: 9 additions & 0 deletions src/lib/core/private/LCompositorPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,15 @@ void LCompositor::LCompositorPrivate::handleOutputRepaintRequests() noexcept

for (LOutput *o : outputs)
{
if (!seat->enabled())
{
if (o->imp()->stateFlags.check(LOutput::LOutputPrivate::RepaintLocked))
{
o->imp()->stateFlags.remove(LOutput::LOutputPrivate::RepaintLocked);
o->imp()->repaintFilterMutex.unlock();
}
}

if (!o->imp()->stateFlags.check(LOutput::LOutputPrivate::PendingRepaint))
continue;

Expand Down
8 changes: 8 additions & 0 deletions src/lib/core/private/LOutputPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,17 @@ void LOutput::LOutputPrivate::backendPaintGL()
{
compositor()->imp()->lock();

// This means LOutput::repaintFilter() returned false
if (stateFlags.check(RepaintLocked))
{
// Unlock other threads (let the main loop update the RepaintLocked state)
compositor()->imp()->unlock();

// Wait until LOutput::repaintFilter() returns true
repaintFilterMutex.lock();
repaintFilterMutex.unlock();

// Continue rendering...
compositor()->imp()->lock();
compositor()->imp()->unlockPoll();
}
Expand Down Expand Up @@ -381,6 +387,8 @@ void LOutput::LOutputPrivate::backendPaintGL()

/* Destroy render buffers created from this thread and marked as destroyed by the user */
compositor()->imp()->destroyPendingRenderBuffers(&output->imp()->threadId);

/* Handle LOutput::repaint() calls from this thread */
compositor()->imp()->handleOutputRepaintRequests();

if (callLock)
Expand Down
18 changes: 18 additions & 0 deletions src/lib/core/private/LSeatPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ void LSeat::LSeatPrivate::seatEnabled(libseat *seat, void *data)

compositor()->imp()->unlock();

for (LOutput *o : compositor()->outputs())
{
if (o->imp()->stateFlags.check(LOutput::LOutputPrivate::RepaintLocked))
{
o->imp()->stateFlags.remove(LOutput::LOutputPrivate::RepaintLocked);
o->imp()->repaintFilterMutex.unlock();
}
}

if (compositor()->isGraphicBackendInitialized())
compositor()->imp()->graphicBackend->backendResume();

Expand Down Expand Up @@ -75,6 +84,15 @@ void LSeat::LSeatPrivate::seatDisabled(libseat *seat, void *data)

compositor()->imp()->unlock();

for (LOutput *o : compositor()->outputs())
{
if (o->imp()->stateFlags.check(LOutput::LOutputPrivate::RepaintLocked))
{
o->imp()->stateFlags.remove(LOutput::LOutputPrivate::RepaintLocked);
o->imp()->repaintFilterMutex.unlock();
}
}

if (compositor()->isGraphicBackendInitialized())
compositor()->imp()->graphicBackend->backendSuspend();

Expand Down

0 comments on commit 9f47021

Please sign in to comment.