summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdkglcontext-wayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdk/wayland/gdkglcontext-wayland.c')
-rw-r--r--gdk/wayland/gdkglcontext-wayland.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index 14cece96c6..1e6f2ca28a 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -26,7 +26,7 @@
#include "gdkwaylanddisplay.h"
#include "gdkwaylandglcontext.h"
-#include "gdkwaylandwindow.h"
+#include "gdkwaylandsurface.h"
#include "gdkprivate-wayland.h"
#include "gdkinternals.h"
@@ -163,7 +163,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLSurface egl_surface;
- GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
+ GdkSurface *surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
int buffer_age = 0;
if (display_wayland->have_egl_buffer_age)
@@ -176,7 +176,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
shared = context;
shared_wayland = GDK_WAYLAND_GL_CONTEXT (shared);
- egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
+ egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface,
shared_wayland->egl_config);
gdk_gl_context_make_current (shared);
eglQuerySurface (display_wayland->egl_display, egl_surface,
@@ -184,16 +184,16 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
if (buffer_age == 2)
{
- if (window->old_updated_area[0])
- return cairo_region_copy (window->old_updated_area[0]);
+ if (surface->old_updated_area[0])
+ return cairo_region_copy (surface->old_updated_area[0]);
}
else if (buffer_age == 3)
{
- if (window->old_updated_area[0] &&
- window->old_updated_area[1])
+ if (surface->old_updated_area[0] &&
+ surface->old_updated_area[1])
{
- cairo_region_t *damage = cairo_region_copy (window->old_updated_area[0]);
- cairo_region_union (damage, window->old_updated_area[1]);
+ cairo_region_t *damage = cairo_region_copy (surface->old_updated_area[0]);
+ cairo_region_union (damage, surface->old_updated_area[1]);
return damage;
}
}
@@ -208,8 +208,8 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
cairo_region_t *damage)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
- GdkWindow *window = gdk_gl_context_get_window (context);
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkSurface *surface = gdk_gl_context_get_surface (context);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
EGLSurface egl_surface;
@@ -220,7 +220,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
gdk_gl_context_make_current (context);
- egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
+ egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface,
context_wayland->egl_config);
if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL)
@@ -228,13 +228,13 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
int i, j, n_rects = cairo_region_num_rectangles (damage);
EGLint *rects = g_new (EGLint, n_rects * 4);
cairo_rectangle_int_t rect;
- int window_height = gdk_window_get_height (window);
+ int surface_height = gdk_surface_get_height (surface);
for (i = 0, j = 0; i < n_rects; i++)
{
cairo_region_get_rectangle (damage, i, &rect);
rects[j++] = rect.x;
- rects[j++] = window_height - rect.height - rect.y;
+ rects[j++] = surface_height - rect.height - rect.y;
rects[j++] = rect.width;
rects[j++] = rect.height;
}
@@ -244,7 +244,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
else
eglSwapBuffers (display_wayland->egl_display, egl_surface);
- gdk_wayland_window_sync (window);
+ gdk_wayland_surface_sync (surface);
}
static void
@@ -360,11 +360,11 @@ gdk_wayland_display_init_gl (GdkDisplay *display)
#define MAX_EGL_ATTRS 30
static gboolean
-find_eglconfig_for_window (GdkWindow *window,
+find_eglconfig_for_surface (GdkSurface *surface,
EGLConfig *egl_config_out,
GError **error)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLint attrs[MAX_EGL_ATTRS];
EGLint count;
@@ -418,12 +418,12 @@ find_eglconfig_for_window (GdkWindow *window,
}
GdkGLContext *
-gdk_wayland_window_create_gl_context (GdkWindow *window,
+gdk_wayland_surface_create_gl_context (GdkSurface *surface,
gboolean attached,
GdkGLContext *share,
GError **error)
{
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context;
EGLConfig config;
@@ -444,11 +444,11 @@ gdk_wayland_window_create_gl_context (GdkWindow *window,
return NULL;
}
- if (!find_eglconfig_for_window (window, &config, error))
+ if (!find_eglconfig_for_surface (surface, &config, error))
return NULL;
context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
- "window", window,
+ "surface", surface,
"shared-context", share,
NULL);
@@ -466,8 +466,8 @@ gdk_wayland_gl_context_dispose (GObject *gobject)
if (context_wayland->egl_context != NULL)
{
GdkGLContext *context = GDK_GL_CONTEXT (gobject);
- GdkWindow *window = gdk_gl_context_get_window (context);
- GdkDisplay *display = gdk_window_get_display (window);
+ GdkSurface *surface = gdk_gl_context_get_surface (context);
+ GdkDisplay *display = gdk_surface_get_display (surface);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
if (eglGetCurrentContext () == context_wayland->egl_context)
@@ -490,7 +490,7 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display,
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context_wayland;
- GdkWindow *window;
+ GdkSurface *surface;
EGLSurface egl_surface;
if (context == NULL)
@@ -501,16 +501,16 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display,
}
context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
- window = gdk_gl_context_get_window (context);
+ surface = gdk_gl_context_get_surface (context);
if (context_wayland->is_attached || gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context)))
- egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window, context_wayland->egl_config);
+ egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface, context_wayland->egl_config);
else
{
if (display_wayland->have_egl_surfaceless_context)
egl_surface = EGL_NO_SURFACE;
else
- egl_surface = gdk_wayland_window_get_dummy_egl_surface (window->impl_window,
+ egl_surface = gdk_wayland_surface_get_dummy_egl_surface (surface->impl_surface,
context_wayland->egl_config);
}