From 5ff1ff2b551821ccd90e85c4b8e7f32f60177adc Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 2 Nov 2007 13:10:31 -0600 Subject: move intelScreenContext() to intel_swapbuffers.c and make static --- .../drivers/dri/intel_winsys/intel_swapbuffers.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c') diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c index f6e7e16000..a80b5a4198 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c @@ -38,6 +38,28 @@ #include "state_tracker/st_cb_fbo.h" +static struct intel_context * +intelScreenContext(intelScreenPrivate *intelScreen) +{ + /* + * This should probably change to have the screen allocate a dummy + * context at screen creation. For now just use the current context. + */ + + GET_CURRENT_CONTEXT(ctx); + if (ctx == NULL) { + /* need a context for the first time makecurrent is called (for hw lock + when allocating priv buffers) */ + if (intelScreen->dummyctxptr == NULL) { + _mesa_problem(NULL, "No current context in intelScreenContext\n"); + return NULL; + } + return intelScreen->dummyctxptr; + } + + return intel_context(ctx); +} + /** * Return the pipe_surface for the given renderbuffer. -- cgit v1.2.3