mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
clutter/cogl/stage: Rename have_clip to is_full_redraw
The 'have_clip' variable has repeatedly confused me to meaning that there is a clip. What it actually means is that the effective clip covers the whole view; the 'redraw_clip == NULL' meaning full redraw is an important implementation detail for the context, and makes the intention of the variable unclear; especially since we will after a couple of blocks will *always* have a clip, just that it covers the whole view. Rename the variable to 'is_full_redraw' and negate the meaning, aiming to make things a lot more clear. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042
This commit is contained in:
parent
0d039c3ba3
commit
86ccc28413
@ -685,7 +685,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
clutter_stage_view_cogl_get_instance_private (view_cogl);
|
||||||
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
|
CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
|
||||||
cairo_rectangle_int_t view_rect;
|
cairo_rectangle_int_t view_rect;
|
||||||
gboolean have_clip;
|
gboolean is_full_redraw;
|
||||||
gboolean may_use_clipped_redraw;
|
gboolean may_use_clipped_redraw;
|
||||||
gboolean use_clipped_redraw;
|
gboolean use_clipped_redraw;
|
||||||
gboolean can_blit_sub_buffer;
|
gboolean can_blit_sub_buffer;
|
||||||
@ -717,7 +717,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
|
|
||||||
/* NB: a NULL redraw clip == full stage redraw */
|
/* NB: a NULL redraw clip == full stage redraw */
|
||||||
if (!stage_cogl->redraw_clip)
|
if (!stage_cogl->redraw_clip)
|
||||||
have_clip = FALSE;
|
is_full_redraw = TRUE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cairo_region_t *view_region;
|
cairo_region_t *view_region;
|
||||||
@ -726,14 +726,14 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
|
|||||||
view_region = cairo_region_create_rectangle (&view_rect);
|
view_region = cairo_region_create_rectangle (&view_rect);
|
||||||
cairo_region_intersect (redraw_clip, view_region);
|
cairo_region_intersect (redraw_clip, view_region);
|
||||||
|
|
||||||
have_clip = !cairo_region_equal (redraw_clip, view_region);
|
is_full_redraw = cairo_region_equal (redraw_clip, view_region);
|
||||||
cairo_region_destroy (view_region);
|
cairo_region_destroy (view_region);
|
||||||
}
|
}
|
||||||
|
|
||||||
may_use_clipped_redraw = FALSE;
|
may_use_clipped_redraw = FALSE;
|
||||||
if (_clutter_stage_window_can_clip_redraws (stage_window) &&
|
if (_clutter_stage_window_can_clip_redraws (stage_window) &&
|
||||||
(can_blit_sub_buffer || has_buffer_age) &&
|
(can_blit_sub_buffer || has_buffer_age) &&
|
||||||
have_clip &&
|
!is_full_redraw &&
|
||||||
/* some drivers struggle to get going and produce some junk
|
/* some drivers struggle to get going and produce some junk
|
||||||
* frames when starting up... */
|
* frames when starting up... */
|
||||||
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)
|
||||||
|
Loading…
Reference in New Issue
Block a user