/*
* Mesa 3-D graphics library
- * Version: 7.8
*
* Copyright (C) 2009-2010 Chia-I Wu <olv@0xlab.org>
*
/**
* Return the maximum supported swap interval.
*/
- NATIVE_PARAM_MAX_SWAP_INTERVAL
+ NATIVE_PARAM_MAX_SWAP_INTERVAL,
+
+ /**
+ * Return TRUE if the display supports premultiplied alpha, regardless of
+ * the surface color format.
+ *
+ * Note that returning TRUE for this parameter will make
+ * EGL_VG_ALPHA_FORMAT_PRE_BIT to be set for all EGLConfig's with non-zero
+ * EGL_ALPHA_SIZE. EGL_VG_ALPHA_FORMAT attribute of a surface will affect
+ * how the surface is presented.
+ */
+ NATIVE_PARAM_PREMULTIPLIED_ALPHA,
+
+ /**
+ * Return TRUE if native_surface::present supports presenting a partial
+ * surface.
+ */
+ NATIVE_PARAM_PRESENT_REGION
+};
+
+/**
+ * Control how a surface presentation should happen.
+ */
+struct native_present_control {
+ /**< the attachment to present */
+ enum native_attachment natt;
+
+ /**< the contents of the presented attachment should be preserved */
+ boolean preserve;
+
+ /**< wait until the given vsyncs has passed since the last presentation */
+ uint swap_interval;
+
+ /**< pixels use premultiplied alpha */
+ boolean premultiplied_alpha;
+
+ /**< The region to present. y=0=top.
+ If num_rects is 0, the whole surface is to be presented */
+ int num_rects;
+ const int *rects; /* x, y, width, height */
};
struct native_surface {
* Present the given buffer to the native engine.
*/
boolean (*present)(struct native_surface *nsurf,
- enum native_attachment natt,
- boolean preserve,
- uint swap_interval);
+ const struct native_present_control *ctrl);
/**
* Validate the buffers of the surface. textures, if not NULL, points to an
int *num_configs);
/**
- * Test if a pixmap is supported by the given config. Required unless no
- * config has pixmap_bit set.
- *
- * This function is usually called to find a config that supports a given
- * pixmap. Thus, it is usually called with the same pixmap in a row.
+ * Get the color format of the pixmap. Required unless no config has
+ * pixmap_bit set.
*/
- boolean (*is_pixmap_supported)(struct native_display *ndpy,
- EGLNativePixmapType pix,
- const struct native_config *nconf);
+ boolean (*get_pixmap_format)(struct native_display *ndpy,
+ EGLNativePixmapType pix,
+ enum pipe_format *format);
+ /**
+ * Copy the contents of the resource to the pixmap's front-left attachment.
+ * This is used to implement eglCopyBuffers. Required unless no config has
+ * pixmap_bit set.
+ */
+ boolean (*copy_to_pixmap)(struct native_display *ndpy,
+ EGLNativePixmapType pix,
+ struct pipe_resource *src);
/**
* Create a window surface. Required unless no config has window_bit set.
const struct native_display_buffer *buffer;
const struct native_display_modeset *modeset;
- const struct native_display_wayland_bufmgr *wayland_bufmgr;
+ struct native_display_wayland_bufmgr *wayland_bufmgr;
};
/**
const struct native_platform *
native_get_fbdev_platform(const struct native_event_handler *event_handler);
+const struct native_platform *
+native_get_null_platform(const struct native_event_handler *event_handler);
+
+const struct native_platform *
+native_get_android_platform(const struct native_event_handler *event_handler);
+
#ifdef __cplusplus
}
#endif