summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-03-17 10:31:57 -0600
committerBrian Paul <[email protected]>2010-03-17 10:31:59 -0600
commitc11d582411a999ed40db4c02143dd380113e0ffd (patch)
tree91fa0eafcf6fcb26a6ada94af62a502bfa9f9a4c /src/mesa/state_tracker/st_context.c
parenta196a5d3303a49c5f79a283f91f8e0cc8aa87f69 (diff)
st/mesa: plug in default for pipe_context::surface_copy() if needed
This lets us avoid conditionals and duplicated code in several places.
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 0885ad77c7c..72f5a9c1e0b 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -63,6 +63,7 @@
#include "st_program.h"
#include "pipe/p_context.h"
#include "util/u_inlines.h"
+#include "util/u_rect.h"
#include "draw/draw_context.h"
#include "cso_cache/cso_context.h"
@@ -97,6 +98,19 @@ st_get_msaa(void)
}
+/** Default method for pipe_context::surface_copy() */
+static void
+st_surface_copy(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ unsigned dst_x, unsigned dst_y,
+ struct pipe_surface *src,
+ unsigned src_x, unsigned src_y,
+ unsigned w, unsigned h)
+{
+ util_surface_copy(pipe, FALSE, dst, dst_x, dst_y, src, src_x, src_y, w, h);
+}
+
+
static struct st_context *
st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
{
@@ -166,6 +180,10 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
st_init_limits(st);
st_init_extensions(st);
+ /* plug in helper driver functions if needed */
+ if (!pipe->surface_copy)
+ pipe->surface_copy = st_surface_copy;
+
return st;
}