Mesa (master): st/hgl: Move st_api creation to st and extern "C" it

Alexander von Gluck IV kallisti5 at kemper.freedesktop.org
Fri May 15 17:56:35 UTC 2015


Module: Mesa
Branch: master
Commit: 9b5da7f06a4052b1298e4684d992a319fb4153ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9b5da7f06a4052b1298e4684d992a319fb4153ba

Author: Alexander von Gluck IV <kallisti5 at unixzen.com>
Date:   Thu May 14 17:29:00 2015 -0500

st/hgl: Move st_api creation to st and extern "C" it

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/state_trackers/hgl/hgl.c         |   16 ++++++++++++----
 src/gallium/state_trackers/hgl/hgl_context.h |   14 ++++++++++----
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/src/gallium/state_trackers/hgl/hgl.c b/src/gallium/state_trackers/hgl/hgl.c
index 77f7c22..1e804c0 100644
--- a/src/gallium/state_trackers/hgl/hgl.c
+++ b/src/gallium/state_trackers/hgl/hgl.c
@@ -7,8 +7,7 @@
  *      Alexander von Gluck IV, kallisti5 at unixzen.com
  */
 
-
-#include "GLView.h"
+#include "hgl_context.h"
 
 #include <stdio.h>
 
@@ -17,8 +16,9 @@
 #include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_inlines.h"
+#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
 
-#include "hgl_context.h"
+#include "GLView.h"
 
 
 #ifdef DEBUG
@@ -93,7 +93,7 @@ hgl_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
 		for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
 			pipe_resource_reference(&buffer->textures[i], NULL);
 	}
-	
+
 	memset(&templat, 0, sizeof(templat));
 	templat.target = buffer->target;
 	templat.width0 = width;
@@ -258,6 +258,14 @@ hgl_create_st_framebuffer(struct hgl_context* context)
 }
 
 
+struct st_api*
+hgl_create_st_api()
+{
+	CALLED();
+	return st_gl_api_create();
+}
+
+
 struct st_manager *
 hgl_create_st_manager(struct hgl_context* context)
 {
diff --git a/src/gallium/state_trackers/hgl/hgl_context.h b/src/gallium/state_trackers/hgl/hgl_context.h
index 4840d9e..d2ec7fb 100644
--- a/src/gallium/state_trackers/hgl/hgl_context.h
+++ b/src/gallium/state_trackers/hgl/hgl_context.h
@@ -9,9 +9,6 @@
 #define HGL_CONTEXT_H
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 #include "state_tracker/st_api.h"
 #include "state_tracker/st_manager.h"
 #include "pipe/p_compiler.h"
@@ -20,8 +17,10 @@ extern "C" {
 #include "os/os_thread.h"
 
 #include "bitmap_wrapper.h"
+
+
 #ifdef __cplusplus
-}
+extern "C" {
 #endif
 
 
@@ -82,6 +81,9 @@ struct hgl_context
 };
 
 
+// hgl state_tracker api
+struct st_api* hgl_create_st_api(void);
+
 // hgl state_tracker framebuffer
 struct hgl_buffer* hgl_create_st_framebuffer(struct hgl_context* context);
 
@@ -94,4 +96,8 @@ struct st_visual* hgl_create_st_visual(ulong options);
 void hgl_destroy_st_visual(struct st_visual* visual);
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* HGL_CONTEXT_H */




More information about the mesa-commit mailing list