mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
clutter/stage-cogl: Only construct damage array if it'll be used
It's only used when we actually swap buffers, which we only do if the target framebuffer is an onscreen. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
This commit is contained in:
parent
258f859e8d
commit
9e34028742
@ -378,6 +378,10 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
||||
gboolean swap_with_damage)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = clutter_stage_view_get_onscreen (view);
|
||||
|
||||
if (cogl_is_onscreen (framebuffer))
|
||||
{
|
||||
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
||||
int *damage, n_rects, i;
|
||||
|
||||
n_rects = cairo_region_num_rectangles (swap_region);
|
||||
@ -393,10 +397,6 @@ swap_framebuffer (ClutterStageWindow *stage_window,
|
||||
damage[i * 4 + 3] = rect.height;
|
||||
}
|
||||
|
||||
if (cogl_is_onscreen (framebuffer))
|
||||
{
|
||||
CoglOnscreen *onscreen = COGL_ONSCREEN (framebuffer);
|
||||
|
||||
/* push on the screen */
|
||||
if (n_rects > 0 && !swap_with_damage)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user