Merge branch '7.8'
[mesa.git] / src / mesa / state_tracker / st_context.c
index ce1a2ea33cde10ab10e32bbd8e3e85fa703464f7..83580591fc3e5722a3bc2995a440c5f9b12b4b6d 100644 (file)
@@ -30,9 +30,9 @@
 #include "vbo/vbo.h"
 #include "shader/shader_api.h"
 #include "glapi/glapi.h"
+#include "st_context.h"
 #include "st_public.h"
 #include "st_debug.h"
-#include "st_context.h"
 #include "st_cb_accum.h"
 #include "st_cb_bitmap.h"
 #include "st_cb_blit.h"
@@ -46,6 +46,7 @@
 #if FEATURE_OES_draw_texture
 #include "st_cb_drawtex.h"
 #endif
+#include "st_cb_eglimage.h"
 #include "st_cb_fbo.h"
 #if FEATURE_feedback
 #include "st_cb_feedback.h"
@@ -63,6 +64,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 +99,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 +181,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;
 }
 
@@ -341,6 +360,8 @@ void st_init_driver_functions(struct dd_function_table *functions)
    st_init_drawtex_functions(functions);
 #endif
 
+   st_init_eglimage_functions(functions);
+
    st_init_fbo_functions(functions);
 #if FEATURE_feedback
    st_init_feedback_functions(functions);