st/egl: Add native_surface::present callback.
[mesa.git] / src / gallium / state_trackers / egl / common / native.h
index 3c3f57e2670e3124f30f3f1ca8d6a063c022cdb4..446c6b45a926b287dd737b26e5fabfcc50865026 100644 (file)
@@ -54,7 +54,17 @@ enum native_param_type {
     * 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 {
@@ -78,6 +88,14 @@ struct native_surface {
     */
    boolean (*flush_frontbuffer)(struct native_surface *nsurf);
 
+   /**
+    * Present the given buffer to the native engine.
+    */
+   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
     * array of size NUM_NATIVE_ATTACHMENTS and the returned textures are owned