aboutsummaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-01-24 18:10:15 -0500
committerKristian Høgsberg <krh@bitplanet.net>2010-01-24 18:10:15 -0500
commita341fa016c54948af4fc76cde864f460f962f9db (patch)
treee03749a18af66b568b5872298cdc29eded71b877 /window.c
parentRequire libdrm 2.4.17 for page flip API (diff)
downloadwayland-a341fa016c54948af4fc76cde864f460f962f9db.tar
wayland-a341fa016c54948af4fc76cde864f460f962f9db.tar.gz
wayland-a341fa016c54948af4fc76cde864f460f962f9db.tar.bz2
wayland-a341fa016c54948af4fc76cde864f460f962f9db.tar.lz
wayland-a341fa016c54948af4fc76cde864f460f962f9db.tar.xz
wayland-a341fa016c54948af4fc76cde864f460f962f9db.tar.zst
wayland-a341fa016c54948af4fc76cde864f460f962f9db.zip
Use FBOs instead of eagle-specific API
Diffstat (limited to 'window.c')
-rw-r--r--window.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/window.c b/window.c
index e27ff32..95f3e21 100644
--- a/window.c
+++ b/window.c
@@ -66,6 +66,7 @@ struct window {
uint32_t modifiers;
cairo_surface_t *cairo_surface, *pending_surface;
+ int new_surface;
window_resize_handler_t resize_handler;
window_key_handler_t key_handler;
@@ -113,6 +114,17 @@ window_attach_surface(struct window *window)
window->allocation.height);
}
+void
+window_commit(struct window *window, uint32_t key)
+{
+ if (window->new_surface) {
+ window_attach_surface(window);
+ window->new_surface = 0;
+ }
+
+ wl_compositor_commit(window->display->compositor, key);
+}
+
static void
window_draw_decorations(struct window *window)
{
@@ -210,8 +222,6 @@ window_draw_decorations(struct window *window)
cairo_fill(cr);
}
cairo_destroy(cr);
-
- window_attach_surface(window);
}
static void
@@ -222,8 +232,6 @@ window_draw_fullscreen(struct window *window)
CAIRO_CONTENT_COLOR_ALPHA,
window->allocation.width,
window->allocation.height);
-
- window_attach_surface(window);
}
void
@@ -236,6 +244,8 @@ window_draw(struct window *window)
window_draw_fullscreen(window);
else
window_draw_decorations(window);
+
+ window->new_surface = 1;
}
static void
@@ -251,13 +261,11 @@ window_handle_acknowledge(void *data,
* safely free the old window buffer if we resized and
* render the next frame into our back buffer.. */
- if (key == 0) {
- pending = window->pending_surface;
- window->pending_surface = NULL;
- if (pending != window->cairo_surface)
- window_attach_surface(window);
- cairo_surface_destroy(pending);
- }
+ pending = window->pending_surface;
+ window->pending_surface = NULL;
+ if (pending != window->cairo_surface)
+ window_attach_surface(window);
+ cairo_surface_destroy(pending);
}
static void
@@ -585,7 +593,7 @@ window_copy(struct window *window,
cairo_t *cr;
surface = cairo_drm_surface_create_for_name (window->display->device,
- name, CAIRO_CONTENT_COLOR_ALPHA,
+ name, CAIRO_FORMAT_ARGB32,
rectangle->width, rectangle->height,
stride);