diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 283: NativeStateWayland: make wayland window opaque

Message ID 20130904175129.7960.22894.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org Sept. 4, 2013, 5:51 p.m. UTC
------------------------------------------------------------
revno: 283
fixes bug: https://launchpad.net/bugs/1219764
author: RafaƂ Mielniczuk <rafal.mielniczuk2@gmail.com>, Rafal Mielniczuk <rafal.mielniczuk2@gmail.com>
committer: Alexandros Frantzis <alexandros.frantzis@canonical.com>
branch nick: glmark2-wayland-opaque-region
timestamp: Wed 2013-09-04 18:42:26 +0200
message:
  NativeStateWayland: make wayland window opaque
  
  We need to make window opaque in order to prevent redrawing background
  behind it in some of the benchmarks, eg. jellyfish.
  
  https://bugs.launchpad.net/glmark2/+bug/1219764
modified:
  src/native-state-wayland.cpp
  src/native-state-wayland.h


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/native-state-wayland.cpp'
--- src/native-state-wayland.cpp	2013-08-28 17:43:48 +0000
+++ src/native-state-wayland.cpp	2013-09-04 16:42:26 +0000
@@ -54,6 +54,8 @@ 
     if (window_) {
         if (window_->shell_surface)
             wl_shell_surface_destroy(window_->shell_surface);
+        if (window_->opaque_reqion)
+            wl_region_destroy(window_->opaque_reqion);
         if (window_->surface)
             wl_surface_destroy(window_->surface);
         if (window_->native)
@@ -233,6 +235,13 @@ 
         window_->native = wl_egl_window_create(window_->surface,
                                                properties.width, properties.height);
     }
+
+    window_->opaque_reqion = wl_compositor_create_region(display_->compositor);
+    wl_region_add(window_->opaque_reqion, 0, 0,
+                  window_->properties.width,
+                  window_->properties.height);
+    wl_surface_set_opaque_region(window_->surface, window_->opaque_reqion);
+
     window_->shell_surface = wl_shell_get_shell_surface(display_->shell,
                                                         window_->surface);
 

=== modified file 'src/native-state-wayland.h'
--- src/native-state-wayland.h	2013-08-06 22:18:53 +0000
+++ src/native-state-wayland.h	2013-09-04 16:42:26 +0000
@@ -106,6 +106,7 @@ 
     struct my_window {
         WindowProperties properties;
         struct wl_surface *surface;
+        struct wl_region *opaque_reqion;
         struct wl_egl_window *native;
         struct wl_shell_surface *shell_surface;
     } *window_;