summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace/tr_screen.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-02-15 17:17:30 +0000
committerJakob Bornecrantz <[email protected]>2010-03-01 16:05:24 +0000
commitb2e94d05c9602e2814a513a51eed67d014b338f3 (patch)
treeed1b442663384771a7060847dfdba85d439b7bb4 /src/gallium/drivers/trace/tr_screen.c
parentf54aecc4f2e83babd1883c2bbd0bba6906cdab07 (diff)
gallium: Expose a opaque winsys handle and functions on pipe_screen
Instead of having these functions on a side interface like on drm_api create a opaque winsys_handle that is to be passed down into the winsys. Currently the only thing ported to this new interface is drm_api, and of that only the components that builds by default is ported. All the drivers and any extra state trackers needs to be ported before this can go into master.
Diffstat (limited to 'src/gallium/drivers/trace/tr_screen.c')
-rw-r--r--src/gallium/drivers/trace/tr_screen.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c
index 388d83eb5c2..ac0876c3a80 100644
--- a/src/gallium/drivers/trace/tr_screen.c
+++ b/src/gallium/drivers/trace/tr_screen.c
@@ -236,6 +236,38 @@ trace_screen_texture_create(struct pipe_screen *_screen,
return result;
}
+static struct pipe_texture *
+trace_screen_texture_from_handle(struct pipe_screen *_screen,
+ const struct pipe_texture *templ,
+ struct winsys_handle *handle)
+{
+ struct trace_screen *tr_screen = trace_screen(_screen);
+ struct pipe_screen *screen = tr_screen->screen;
+ struct pipe_texture *result;
+
+ /* TODO trace call */
+
+ result = screen->texture_from_handle(screen, templ, handle);
+
+ result = trace_texture_create(trace_screen(_screen), result);
+
+ return result;
+}
+
+static boolean
+trace_screen_texture_get_handle(struct pipe_screen *_screen,
+ struct pipe_texture *_texture,
+ struct winsys_handle *handle)
+{
+ struct trace_screen *tr_screen = trace_screen(_screen);
+ struct trace_texture *tr_texture = trace_texture(_texture);
+ struct pipe_screen *screen = tr_screen->screen;
+ struct pipe_texture *texture = tr_texture->texture;
+
+ /* TODO trace call */
+
+ return screen->texture_get_handle(screen, texture, handle);
+}
static struct pipe_texture *
trace_screen_texture_blanket(struct pipe_screen *_screen,
@@ -931,6 +963,8 @@ trace_screen_create(struct pipe_screen *screen)
assert(screen->context_create);
tr_scr->base.context_create = trace_screen_context_create;
tr_scr->base.texture_create = trace_screen_texture_create;
+ tr_scr->base.texture_from_handle = trace_screen_texture_from_handle;
+ tr_scr->base.texture_get_handle = trace_screen_texture_get_handle;
tr_scr->base.texture_blanket = trace_screen_texture_blanket;
tr_scr->base.texture_destroy = trace_screen_texture_destroy;
tr_scr->base.get_tex_surface = trace_screen_get_tex_surface;