summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/common/native.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-02-24 12:59:41 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2011-03-01 10:36:18 +0100
commitd1e4117355f1db6ff87c837df6212bf6168e98a0 (patch)
tree04a254ee07a5574c2ba9c08e812e46e6554fc91d /src/gallium/state_trackers/egl/common/native.h
parent186d3bc7a3389b78a851e34d8f970c28b8db1608 (diff)
st/egl: Move the copy context to the native display structure
This makes it usable also for native helpers. Also add inline functions to access the context and to uninit the native display structure. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
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;