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
d7ff3703
Commit
d7ff3703
authored
Sep 21, 2020
by
Aleix Pol Gonzalez
🐧
Browse files
Do not create a temporary QRegion unnecessarily
Just modify the one we are updating in one go
parent
260d6e7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wayland/surface_interface.cpp
View file @
d7ff3703
...
...
@@ -324,7 +324,7 @@ void SurfaceInterfacePrivate::surface_attach(Resource *resource, struct ::wl_res
void
SurfaceInterfacePrivate
::
surface_damage
(
Resource
*
,
int32_t
x
,
int32_t
y
,
int32_t
width
,
int32_t
height
)
{
pending
.
damage
=
pending
.
damage
.
united
(
QRect
(
x
,
y
,
width
,
height
)
)
;
pending
.
damage
|
=
QRect
(
x
,
y
,
width
,
height
);
}
void
SurfaceInterfacePrivate
::
surface_frame
(
Resource
*
resource
,
uint32_t
callback
)
...
...
@@ -379,7 +379,7 @@ void SurfaceInterfacePrivate::surface_set_buffer_scale(Resource *resource, int32
void
SurfaceInterfacePrivate
::
surface_damage_buffer
(
Resource
*
resource
,
int32_t
x
,
int32_t
y
,
int32_t
width
,
int32_t
height
)
{
Q_UNUSED
(
resource
)
pending
.
bufferDamage
=
pending
.
bufferDamage
.
united
(
QRect
(
x
,
y
,
width
,
height
)
)
;
pending
.
bufferDamage
|
=
QRect
(
x
,
y
,
width
,
height
);
}
SurfaceInterface
::
SurfaceInterface
(
CompositorInterface
*
compositor
,
wl_resource
*
resource
)
...
...
@@ -650,7 +650,7 @@ void SurfaceInterfacePrivate::swapStates(State *source, State *target, bool emit
const
QRegion
windowRegion
=
QRegion
(
0
,
0
,
q
->
size
().
width
(),
q
->
size
().
height
());
const
QRegion
bufferDamage
=
q
->
mapFromBuffer
(
target
->
bufferDamage
);
target
->
damage
=
windowRegion
.
intersected
(
target
->
damage
.
united
(
bufferDamage
));
trackedDamage
=
trackedDamage
.
united
(
target
->
damage
)
;
trackedDamage
|
=
target
->
damage
;
emit
q
->
damaged
(
target
->
damage
);
// workaround for https://bugreports.qt.io/browse/QTBUG-52092
// if the surface is a sub-surface, but the main surface is not yet mapped, fake frame rendered
...
...
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