1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
27 **************************************************************************/
38 #include "trace/tr_screen.h"
39 #include "trace/tr_context.h"
41 #include "pipe/p_screen.h"
45 static struct pipe_screen
*
46 xlib_create_trace_screen( void )
48 struct pipe_screen
*screen
, *trace_screen
;
50 screen
= xlib_softpipe_driver
.create_pipe_screen();
56 trace_screen
= trace_screen_create(screen
);
57 if (trace_screen
== NULL
)
64 screen
->destroy( screen
);
68 static struct pipe_context
*
69 xlib_create_trace_context( struct pipe_screen
*screen
,
72 struct pipe_context
*pipe
, *trace_pipe
;
74 pipe
= xlib_softpipe_driver
.create_pipe_context( screen
, priv
);
80 trace_pipe
= trace_context_create(screen
, pipe
);
81 if (trace_pipe
== NULL
)
84 trace_pipe
->priv
= priv
;
93 xlib_trace_display_surface( struct xmesa_buffer
*buffer
,
94 struct pipe_surface
*surf
)
98 xlib_softpipe_driver
.display_surface( buffer
, surf
);
102 struct xm_driver xlib_trace_driver
=
104 .create_pipe_screen
= xlib_create_trace_screen
,
105 .create_pipe_context
= xlib_create_trace_context
,
106 .display_surface
= xlib_trace_display_surface
,