summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-06-24 12:12:39 +0900
committerChia-I Wu <[email protected]>2011-06-24 12:18:52 +0900
commitcb29ee91a27054714e589cf29ecf5025b7140813 (patch)
tree09c1fbdb3b6aac2d6e1a8e605cd9b7a54787055a /src
parentca7510bbf9bdff35f813f970e3120a9c7f728cca (diff)
st/egl: use a helper to get st_api from the loader
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d.h8
-rw-r--r--src/gallium/state_trackers/egl/common/egl_g3d_api.c14
2 files changed, 9 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.h b/src/gallium/state_trackers/egl/common/egl_g3d.h
index 301db3128ff..5989a023573 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d.h
+++ b/src/gallium/state_trackers/egl/common/egl_g3d.h
@@ -126,4 +126,12 @@ _EGL_DRIVER_TYPECAST(egl_g3d_screen, _EGLScreen, obj)
#endif /* EGL_MESA_screen_surface */
+static INLINE struct st_api *
+egl_g3d_get_st_api(_EGLDriver *drv, enum st_api_type api)
+{
+ struct egl_g3d_driver *gdrv = egl_g3d_driver(drv);
+
+ return gdrv->loader->get_st_api(api);
+}
+
#endif /* _EGL_G3D_H_ */
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
index 8b1821e0055..1d49c30a61e 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
@@ -37,7 +37,6 @@
#include "egl_g3d_image.h"
#include "egl_g3d_sync.h"
#include "egl_g3d_st.h"
-#include "egl_g3d_loader.h"
#include "native.h"
/**
@@ -47,7 +46,6 @@ static struct st_api *
egl_g3d_choose_st(_EGLDriver *drv, _EGLContext *ctx,
enum st_profile_type *profile)
{
- struct egl_g3d_driver *gdrv = egl_g3d_driver(drv);
struct st_api *stapi;
EGLint api = -1;
@@ -81,17 +79,7 @@ egl_g3d_choose_st(_EGLDriver *drv, _EGLContext *ctx,
break;
}
- switch (api) {
- case ST_API_OPENGL:
- stapi = gdrv->loader->guess_gl_api(*profile);
- break;
- case ST_API_OPENVG:
- stapi = gdrv->loader->get_st_api(api);
- break;
- default:
- stapi = NULL;
- break;
- }
+ stapi = egl_g3d_get_st_api(drv, api);
if (stapi && !(stapi->profile_mask & (1 << *profile)))
stapi = NULL;