summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/common/native.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl/common/native.h')
-rw-r--r--src/gallium/state_trackers/egl/common/native.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h
index 42889075a3..9246f8c32a 100644
--- a/src/gallium/state_trackers/egl/common/native.h
+++ b/src/gallium/state_trackers/egl/common/native.h
@@ -142,6 +142,11 @@ struct native_display {
struct pipe_screen *screen;
/**
+ * Context used for copy operations.
+ */
+ struct pipe_context *pipe;
+
+ /**
* Available for caller's use.
*/
void *user_data;
@@ -223,6 +228,29 @@ native_attachment_mask_test(uint mask, enum native_attachment att)
return !!(mask & (1 << att));
}
+/**
+ * Get the display copy context
+ */
+static INLINE struct pipe_context *
+ndpy_get_copy_context(struct native_display *ndpy)
+{
+ if (!ndpy->pipe)
+ ndpy->pipe = ndpy->screen->context_create(ndpy->screen, NULL);
+ return ndpy->pipe;
+}
+
+/**
+ * Free display screen and context resources
+ */
+static INLINE void
+ndpy_uninit(struct native_display *ndpy)
+{
+ if (ndpy->pipe)
+ ndpy->pipe->destroy(ndpy->pipe);
+ if (ndpy->screen)
+ ndpy->screen->destroy(ndpy->screen);
+}
+
struct native_platform {
const char *name;