return surface;
}
+/**
+ * Pixmaps have will have the same name of fake front and front.
+ */
+static boolean
+dri2_check_if_pixmap(__DRIbuffer *buffers, int count)
+{
+ boolean found = FALSE;
+ boolean is_pixmap = FALSE;
+ unsigned name;
+ int i;
+
+ for (i = 0; i < count; i++) {
+ switch (buffers[i].attachment) {
+ case __DRI_BUFFER_FRONT_LEFT:
+ case __DRI_BUFFER_FAKE_FRONT_LEFT:
+ if (found) {
+ is_pixmap = buffers[i].name == name;
+ } else {
+ name = buffers[i].name;
+ found = TRUE;
+ }
+ default:
+ continue;
+ }
+ }
+
+ return is_pixmap;
+}
+
/**
* This will be called a drawable is known to have been resized.
*/
memcpy(drawable->old, buffers, sizeof(__DRIbuffer) * count);
}
+ drawable->is_pixmap = dri2_check_if_pixmap(buffers, count);
+
for (i = 0; i < count; i++) {
enum pipe_format format = 0;
int index = 0;
return;
}
+#if 0
+ /* TODO if rendering to pixmaps is slow enable this code. */
+ if (drawable->is_pixmap)
+ return;
+#endif
+
(*dri_screen->dri2.loader->flushFrontBuffer)(dri_drawable,
dri_drawable->loaderPrivate);
}