Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
d5203c79
Commit
d5203c79
authored
Oct 30, 2020
by
Vlad Zahorodnii
Browse files
Report partial updates on all outputs
Previously, we couldn't do it because repaints weren't tracked per each output.
parent
d9528a5d
Changes
10
Hide whitespace changes
Inline
Side-by-side
platformsupport/scenes/opengl/backend.cpp
View file @
d5203c79
...
...
@@ -111,8 +111,9 @@ QSharedPointer<KWin::GLTexture> OpenGLBackend::textureForOutput(AbstractOutput*
return
{};
}
void
OpenGLBackend
::
aboutToStartPainting
(
const
QRegion
&
damage
)
void
OpenGLBackend
::
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
)
{
Q_UNUSED
(
screenId
)
Q_UNUSED
(
damage
)
}
...
...
platformsupport/scenes/opengl/backend.h
View file @
d5203c79
...
...
@@ -70,7 +70,7 @@ public:
*
* @p damage contains the reported damage as suggested by windows and effects on prepaint calls.
*/
virtual
void
aboutToStartPainting
(
const
QRegion
&
damage
);
virtual
void
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
);
/**
* @brief Backend specific code to handle the end of rendering a frame.
...
...
plugins/platforms/drm/egl_gbm_backend.cpp
View file @
d5203c79
...
...
@@ -465,14 +465,10 @@ static QVector<EGLint> regionToRects(const QRegion ®ion, AbstractWaylandOutpu
return
rects
;
}
void
EglGbmBackend
::
aboutToStartPainting
(
const
QRegion
&
damagedRegion
)
void
EglGbmBackend
::
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damagedRegion
)
{
// See EglGbmBackend::endRenderingFrameForScreen comment for the reason why we only support screenId=0
if
(
m_outputs
.
count
()
>
1
)
{
return
;
}
const
Output
&
output
=
m_outputs
.
at
(
0
);
Q_ASSERT_X
(
screenId
!=
-
1
,
"aboutToStartPainting"
,
"not using per screen rendering"
);
const
Output
&
output
=
m_outputs
.
at
(
screenId
);
if
(
output
.
bufferAge
>
0
&&
!
damagedRegion
.
isEmpty
()
&&
supportsPartialUpdate
())
{
const
QRegion
region
=
damagedRegion
&
output
.
output
->
geometry
();
...
...
plugins/platforms/drm/egl_gbm_backend.h
View file @
d5203c79
...
...
@@ -48,7 +48,7 @@ public:
protected:
void
present
()
override
;
void
cleanupSurfaces
()
override
;
void
aboutToStartPainting
(
const
QRegion
&
damage
)
override
;
void
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
)
override
;
private:
bool
initializeEgl
();
...
...
plugins/platforms/wayland/egl_wayland_backend.cpp
View file @
d5203c79
...
...
@@ -306,9 +306,10 @@ static QVector<EGLint> regionToRects(const QRegion ®ion, AbstractWaylandOutpu
return
rects
;
}
void
EglWaylandBackend
::
aboutToStartPainting
(
const
QRegion
&
damagedRegion
)
void
EglWaylandBackend
::
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damagedRegion
)
{
EglWaylandOutput
*
output
=
m_outputs
.
at
(
0
);
Q_ASSERT_X
(
screenId
!=
-
1
,
"aboutToStartPainting"
,
"not using per screen rendering"
);
EglWaylandOutput
*
output
=
m_outputs
.
at
(
screenId
);
if
(
output
->
m_bufferAge
>
0
&&
!
damagedRegion
.
isEmpty
()
&&
supportsPartialUpdate
())
{
const
QRegion
region
=
damagedRegion
&
output
->
m_waylandOutput
->
geometry
();
...
...
plugins/platforms/wayland/egl_wayland_backend.h
View file @
d5203c79
...
...
@@ -82,7 +82,7 @@ public:
return
m_havePlatformBase
;
}
void
aboutToStartPainting
(
const
QRegion
&
damage
)
override
;
void
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
)
override
;
private:
bool
initializeEgl
();
...
...
plugins/scenes/opengl/scene_opengl.cpp
View file @
d5203c79
...
...
@@ -615,9 +615,9 @@ void SceneOpenGL2::paintCursor(const QRegion &rendered)
glDisable
(
GL_BLEND
);
}
void
SceneOpenGL
::
aboutToStartPainting
(
const
QRegion
&
damage
)
void
SceneOpenGL
::
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
)
{
m_backend
->
aboutToStartPainting
(
damage
);
m_backend
->
aboutToStartPainting
(
screenId
,
damage
);
}
qint64
SceneOpenGL
::
paint
(
const
QRegion
&
damage
,
const
QList
<
Toplevel
*>
&
toplevels
)
...
...
plugins/scenes/opengl/scene_opengl.h
View file @
d5203c79
...
...
@@ -78,7 +78,7 @@ public:
protected:
SceneOpenGL
(
OpenGLBackend
*
backend
,
QObject
*
parent
=
nullptr
);
void
paintBackground
(
const
QRegion
&
region
)
override
;
void
aboutToStartPainting
(
const
QRegion
&
damage
)
override
;
void
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
)
override
;
void
extendPaintRegion
(
QRegion
&
region
,
bool
opaqueFullscreen
)
override
;
QMatrix4x4
transformation
(
int
mask
,
const
ScreenPaintData
&
data
)
const
;
void
paintDesktop
(
int
desktop
,
int
mask
,
const
QRegion
&
region
,
ScreenPaintData
&
data
)
override
;
...
...
scene.cpp
View file @
d5203c79
...
...
@@ -236,7 +236,7 @@ void Scene::paintGenericScreen(int orig_mask, const ScreenPaintData &)
damaged_region
=
QRegion
(
QRect
{{},
screens
()
->
size
()});
if
(
m_paintScreenCount
==
1
)
{
aboutToStartPainting
(
damaged_region
);
aboutToStartPainting
(
painted_screen
,
damaged_region
);
if
(
orig_mask
&
PAINT_SCREEN_BACKGROUND_FIRST
)
{
paintBackground
(
infiniteRegion
());
...
...
@@ -377,7 +377,7 @@ void Scene::paintSimpleScreen(int orig_mask, const QRegion ®ion)
QRegion
paintedArea
;
// Fill any areas of the root window not covered by opaque windows
if
(
m_paintScreenCount
==
1
)
{
aboutToStartPainting
(
dirtyArea
);
aboutToStartPainting
(
painted_screen
,
dirtyArea
);
if
(
orig_mask
&
PAINT_SCREEN_BACKGROUND_FIRST
)
{
paintBackground
(
infiniteRegion
());
...
...
@@ -636,8 +636,9 @@ void Scene::paintDesktop(int desktop, int mask, const QRegion ®ion, ScreenPai
static_cast
<
EffectsHandlerImpl
*>
(
effects
)
->
paintDesktop
(
desktop
,
mask
,
region
,
data
);
}
void
Scene
::
aboutToStartPainting
(
const
QRegion
&
damage
)
void
Scene
::
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
)
{
Q_UNUSED
(
screenId
)
Q_UNUSED
(
damage
)
}
...
...
scene.h
View file @
d5203c79
...
...
@@ -227,7 +227,7 @@ protected:
*
* @p damage contains the reported damage as suggested by windows and effects on prepaint calls.
*/
virtual
void
aboutToStartPainting
(
const
QRegion
&
damage
);
virtual
void
aboutToStartPainting
(
int
screenId
,
const
QRegion
&
damage
);
// called after all effects had their paintWindow() called
void
finalPaintWindow
(
EffectWindowImpl
*
w
,
int
mask
,
const
QRegion
&
region
,
WindowPaintData
&
data
);
// shared implementation, starts painting the window
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment