[metacity] compositor-xrender: merge paint_all into redraw function
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] compositor-xrender: merge paint_all into redraw function
- Date: Tue, 22 Oct 2019 23:48:50 +0000 (UTC)
commit e94ee45ef7613128da673a36eafd755141e68969
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Oct 23 01:10:26 2019 +0300
compositor-xrender: merge paint_all into redraw function
src/compositor/meta-compositor-xrender.c | 76 ++++++++++++++------------------
1 file changed, 33 insertions(+), 43 deletions(-)
---
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 821cc3d8..5c0c22eb 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -837,46 +837,6 @@ paint_windows (MetaCompositorXRender *xrender,
XFixesDestroyRegion (xdisplay, paint_region);
}
-static void
-paint_all (MetaCompositorXRender *xrender,
- XserverRegion region)
-{
- MetaDisplay *display = meta_screen_get_display (xrender->screen);
- Display *xdisplay = meta_display_get_xdisplay (display);
- int screen_width, screen_height;
- GList *stack;
-
- /* Set clipping to the given region */
- XFixesSetPictureClipRegion (xdisplay, xrender->root_picture, 0, 0, region);
-
- meta_screen_get_size (xrender->screen, &screen_width, &screen_height);
-
- if (xrender->show_redraw)
- {
- Picture overlay;
-
- /* Make a random colour overlay */
- overlay = solid_picture (xdisplay, TRUE, 1, /* 0.3, alpha */
- ((double) (rand () % 100)) / 100.0,
- ((double) (rand () % 100)) / 100.0,
- ((double) (rand () % 100)) / 100.0);
-
- XRenderComposite (xdisplay, PictOpOver, overlay, None, xrender->root_picture,
- 0, 0, 0, 0, 0, 0, screen_width, screen_height);
- XRenderFreePicture (xdisplay, overlay);
- XFlush (xdisplay);
- usleep (100 * 1000);
- }
-
- stack = meta_compositor_get_stack (META_COMPOSITOR (xrender));
- paint_windows (xrender, stack, xrender->root_buffer, region);
-
- XFixesSetPictureClipRegion (xdisplay, xrender->root_buffer, 0, 0, region);
- XRenderComposite (xdisplay, PictOpSrc, xrender->root_buffer, None,
- xrender->root_picture, 0, 0, 0, 0, 0, 0,
- screen_width, screen_height);
-}
-
/* event processors must all be called with an error trap in place */
static void
process_property_notify (MetaCompositorXRender *xrender,
@@ -1153,15 +1113,45 @@ meta_compositor_xrender_redraw (MetaCompositor *compositor,
{
MetaCompositorXRender *xrender;
MetaDisplay *display;
+ Display *xdisplay;
+ int screen_width;
+ int screen_height;
+ GList *stack;
xrender = META_COMPOSITOR_XRENDER (compositor);
+
display = meta_compositor_get_display (compositor);
+ xdisplay = meta_display_get_xdisplay (display);
- meta_error_trap_push (display);
+ meta_screen_get_size (xrender->screen, &screen_width, &screen_height);
- paint_all (xrender, all_damage);
+ /* Set clipping to the given region */
+ XFixesSetPictureClipRegion (xdisplay, xrender->root_picture, 0, 0, all_damage);
- meta_error_trap_pop (display);
+ if (xrender->show_redraw)
+ {
+ Picture overlay;
+
+ /* Make a random colour overlay */
+ overlay = solid_picture (xdisplay, TRUE, 1, /* 0.3, alpha */
+ ((double) (rand () % 100)) / 100.0,
+ ((double) (rand () % 100)) / 100.0,
+ ((double) (rand () % 100)) / 100.0);
+
+ XRenderComposite (xdisplay, PictOpOver, overlay, None, xrender->root_picture,
+ 0, 0, 0, 0, 0, 0, screen_width, screen_height);
+ XRenderFreePicture (xdisplay, overlay);
+ XFlush (xdisplay);
+ usleep (100 * 1000);
+ }
+
+ stack = meta_compositor_get_stack (compositor);
+ paint_windows (xrender, stack, xrender->root_buffer, all_damage);
+
+ XFixesSetPictureClipRegion (xdisplay, xrender->root_buffer, 0, 0, all_damage);
+ XRenderComposite (xdisplay, PictOpSrc, xrender->root_buffer, None,
+ xrender->root_picture, 0, 0, 0, 0, 0, 0,
+ screen_width, screen_height);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]