#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_state.h"
+#include "state_tracker/sw_winsys.h"
-#include "native_probe.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "native_buffer.h"
#include "native_modeset.h"
/**
* Return TRUE if window/pixmap surfaces use the buffers of the native
* types.
*/
- NATIVE_PARAM_USE_NATIVE_BUFFER
+ NATIVE_PARAM_USE_NATIVE_BUFFER,
+
+ /**
+ * Return TRUE if native_surface::present can preserve the buffer.
+ */
+ NATIVE_PARAM_PRESERVE_BUFFER,
+
+ /**
+ * Return the maximum supported swap interval.
+ */
+ NATIVE_PARAM_MAX_SWAP_INTERVAL
};
struct native_surface {
void (*destroy)(struct native_surface *nsurf);
/**
- * Swap the front and back buffers so that the back buffer is visible. It
- * is no-op if the surface is single-buffered. The contents of the back
- * buffer after swapping may or may not be preserved.
- */
- boolean (*swap_buffers)(struct native_surface *nsurf);
-
- /**
- * Make the front buffer visible. In some native displays, changes to the
- * front buffer might not be visible immediately and require manual flush.
+ * Present the given buffer to the native engine.
*/
- boolean (*flush_frontbuffer)(struct native_surface *nsurf);
+ boolean (*present)(struct native_surface *nsurf,
+ enum native_attachment natt,
+ boolean preserve,
+ uint swap_interval);
/**
* Validate the buffers of the surface. textures, if not NULL, points to an
int native_visual_id;
int native_visual_type;
int level;
- int samples;
- boolean slow_config;
boolean transparent_rgb;
int transparent_rgb_values[3];
};
const struct native_config *nconf);
/**
- * Create a pixmap surface. Required unless no config has pixmap_bit set.
+ * Create a pixmap surface. The native config may be NULL. In that case, a
+ * "best config" will be picked. Required unless no config has pixmap_bit
+ * set.
*/
struct native_surface *(*create_pixmap_surface)(struct native_display *ndpy,
EGLNativePixmapType pix,
const struct native_config *nconf);
+ const struct native_display_buffer *buffer;
const struct native_display_modeset *modeset;
};
void (*invalid_surface)(struct native_display *ndpy,
struct native_surface *nsurf,
unsigned int seq_num);
+
+ struct pipe_screen *(*new_drm_screen)(struct native_display *ndpy,
+ const char *name, int fd);
+ struct pipe_screen *(*new_sw_screen)(struct native_display *ndpy,
+ struct sw_winsys *ws);
};
/**
return !!(mask & (1 << att));
}
-const char *
-native_get_name(void);
+struct native_platform {
+ const char *name;
+
+ void (*set_event_handler)(struct native_event_handler *handler);
+ struct native_display *(*create_display)(void *dpy,
+ boolean use_sw,
+ void *user_data);
+};
+
+const struct native_platform *
+native_get_gdi_platform(void);
-struct native_display *
-native_create_display(EGLNativeDisplayType dpy,
- struct native_event_handler *handler);
+const struct native_platform *
+native_get_x11_platform(void);
+
+const struct native_platform *
+native_get_drm_platform(void);
+
+const struct native_platform *
+native_get_fbdev_platform(void);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* _NATIVE_H_ */