[cogl/cogl-1.16] Implicitly allocate on cogl_wayland_onscreen_get_(shell_)?surface
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.16] Implicitly allocate on cogl_wayland_onscreen_get_(shell_)?surface
- Date: Tue, 9 Jul 2013 14:49:09 +0000 (UTC)
commit 8911da794ef363d777ebcb68d0db5fa85fb776d4
Author: Neil Roberts <neil linux intel com>
Date: Wed Jul 3 18:32:00 2013 +0100
Implicitly allocate on cogl_wayland_onscreen_get_(shell_)?surface
The idea with the framebuffer allocation is that it will lazily
allocate so that if you don't want to handle errors then you don't
have to be aware that there is an allocation step. In order for this
to work any accessors that get data that is only available after
allocation should implicitly allocate the framebuffer. This patch
makes that change for cogl_wayland_onscreen_get_surface and
cogl_wayland_onscreen_get_shell_surface.
Reviewed-by: Robert Bragg <robert linux intel com>
(cherry picked from commit 0c4ba78787323fedd162d7b71b86b460908b9b98)
cogl/winsys/cogl-winsys-egl-wayland.c | 36 ++++++++++++++------------------
1 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c
index 3b69611..6d6f965 100644
--- a/cogl/winsys/cogl-winsys-egl-wayland.c
+++ b/cogl/winsys/cogl-winsys-egl-wayland.c
@@ -634,33 +634,29 @@ cogl_wayland_renderer_get_shell (CoglRenderer *renderer)
struct wl_surface *
cogl_wayland_onscreen_get_surface (CoglOnscreen *onscreen)
{
- CoglFramebuffer *fb;
+ CoglOnscreenEGL *egl_onscreen;
+ CoglOnscreenWayland *wayland_onscreen;
- fb = COGL_FRAMEBUFFER (onscreen);
- if (fb->allocated)
- {
- CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
- CoglOnscreenWayland *wayland_onscreen = egl_onscreen->platform;
- return wayland_onscreen->wayland_surface;
- }
- else
- return NULL;
+ cogl_framebuffer_allocate (COGL_FRAMEBUFFER (onscreen), NULL);
+
+ egl_onscreen = onscreen->winsys;
+ wayland_onscreen = egl_onscreen->platform;
+
+ return wayland_onscreen->wayland_surface;
}
struct wl_shell_surface *
cogl_wayland_onscreen_get_shell_surface (CoglOnscreen *onscreen)
{
- CoglFramebuffer *fb;
+ CoglOnscreenEGL *egl_onscreen;
+ CoglOnscreenWayland *wayland_onscreen;
- fb = COGL_FRAMEBUFFER (onscreen);
- if (fb->allocated)
- {
- CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
- CoglOnscreenWayland *wayland_onscreen = egl_onscreen->platform;
- return wayland_onscreen->wayland_shell_surface;
- }
- else
- return NULL;
+ cogl_framebuffer_allocate (COGL_FRAMEBUFFER (onscreen), NULL);
+
+ egl_onscreen = onscreen->winsys;
+ wayland_onscreen = egl_onscreen->platform;
+
+ return wayland_onscreen->wayland_shell_surface;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]