summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl_g3d/common
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2010-01-15 17:39:49 +0800
committerChia-I Wu <olvaffe@gmail.com>2010-01-15 17:42:57 +0800
commit51b00574a2ef81629548b079ef70c016bdd4251d (patch)
treee5170ff8b5617948fd66eb2a22b20eaba8584050 /src/gallium/state_trackers/egl_g3d/common
parent6664a6dd7fb701da26e04559bd8110703a61fd8f (diff)
st/egl_g3d: Always override flush_frontbuffer.
Instead of letting the native displays install their own version of flush_frontbuffer, always override the callback with a version that calls the flush_frontbuffer of the native surface.
Diffstat (limited to 'src/gallium/state_trackers/egl_g3d/common')
-rw-r--r--src/gallium/state_trackers/egl_g3d/common/egl_g3d.c10
-rw-r--r--src/gallium/state_trackers/egl_g3d/common/native.h17
2 files changed, 13 insertions, 14 deletions
diff --git a/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c b/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c
index 8b69a8cfcb..7da9300c20 100644
--- a/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c
+++ b/src/gallium/state_trackers/egl_g3d/common/egl_g3d.c
@@ -24,6 +24,7 @@
#include <assert.h>
#include <string.h>
+#include "pipe/p_screen.h"
#include "util/u_memory.h"
#include "egldriver.h"
#include "eglcurrent.h"
@@ -456,8 +457,8 @@ egl_g3d_add_configs(_EGLDriver *drv, _EGLDisplay *dpy, EGLint id)
* Flush the front buffer of the context's draw surface.
*/
static void
-egl_g3d_flush_frontbuffer(void *dummy, struct pipe_surface *surf,
- void *context_private)
+egl_g3d_flush_frontbuffer(struct pipe_screen *screen,
+ struct pipe_surface *surf, void *context_private)
{
struct egl_g3d_context *gctx = egl_g3d_context(context_private);
struct egl_g3d_surface *gsurf = egl_g3d_surface(gctx->base.DrawSurface);
@@ -509,13 +510,14 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
}
dpy->DriverData = gdpy;
- gdpy->native =
- native_create_display(dpy->NativeDisplay, egl_g3d_flush_frontbuffer);
+ gdpy->native = native_create_display(dpy->NativeDisplay);
if (!gdpy->native) {
_eglError(EGL_NOT_INITIALIZED, "eglInitialize(no usable display)");
goto fail;
}
+ gdpy->native->screen->flush_frontbuffer = egl_g3d_flush_frontbuffer;
+
dpy->ClientAPIsMask = gdrv->api_mask;
if (egl_g3d_add_configs(drv, dpy, 1) == 1) {
diff --git a/src/gallium/state_trackers/egl_g3d/common/native.h b/src/gallium/state_trackers/egl_g3d/common/native.h
index 4714e24b5c..1c3b016b98 100644
--- a/src/gallium/state_trackers/egl_g3d/common/native.h
+++ b/src/gallium/state_trackers/egl_g3d/common/native.h
@@ -114,7 +114,13 @@ struct native_display_modeset;
* the native display server.
*/
struct native_display {
+ /**
+ * The pipe screen of the native display.
+ *
+ * Note that the "flush_frontbuffer" callback will be overridden.
+ */
struct pipe_screen *screen;
+
void (*destroy)(struct native_display *ndpy);
/**
@@ -204,19 +210,10 @@ struct native_display_modeset {
const struct native_mode *nmode);
};
-/**
- * This function is called when the native display wants to display the front
- * buffer of the draw surface of the given context.
- */
-typedef void (*native_flush_frontbuffer)(void *dummy,
- struct pipe_surface *surf,
- void *context_private);
-
const char *
native_get_name(void);
struct native_display *
-native_create_display(EGLNativeDisplayType dpy,
- native_flush_frontbuffer flush_frontbuffer);
+native_create_display(EGLNativeDisplayType dpy);
#endif /* _NATIVE_H_ */