diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2010-01-17 09:35:20 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2010-01-17 09:35:59 +0800 |
commit | c3b4e6f8c1969418dfefd66ed5641ab6701e5397 (patch) | |
tree | c3b4dd8a6a509032b79c55d2d82561629a602ec6 | |
parent | 25fc118633c1b39d882c43f6ecc82be4c866463d (diff) |
Move st_api resources to st_context resouces.
The state tracker manager needs to peek the resources of the rendering
context, not the state tracker.
-rw-r--r-- | st_api.h | 82 |
1 files changed, 41 insertions, 41 deletions
@@ -85,18 +85,18 @@ enum st_manager_resource_type { ST_MANAGER_RESOURCE_EGL_IMAGE, /* return struct pipe_texture */ }; -enum st_resource_type { +enum st_context_resource_type { /* all of them return struct pipe_texture */ - ST_RESOURCE_OPENGL_TEXTURE_2D, - ST_RESOURCE_OPENGL_TEXTURE_3D, - ST_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_POSITIVE_X, - ST_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_NEGATIVE_X, - ST_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_POSITIVE_Y, - ST_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_NEGATIVE_Y, - ST_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_POSITIVE_Z, - ST_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_NEGATIVE_Z, - ST_RESOURCE_OPENGL_RENDERBUFFER, - ST_RESOURCE_OPENVG_PARENT_IMAGE, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_2D, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_3D, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_POSITIVE_X, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_NEGATIVE_X, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_POSITIVE_Y, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_NEGATIVE_Y, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_POSITIVE_Z, + ST_CONTEXT_RESOURCE_OPENGL_TEXTURE_CUBE_MAP_NEGATIVE_Z, + ST_CONTEXT_RESOURCE_OPENGL_RENDERBUFFER, + ST_CONTEXT_RESOURCE_OPENVG_PARENT_IMAGE, }; /** @@ -189,6 +189,25 @@ struct st_manager_api }; /** + * Represent a state tracker context resource. + * + * The input and output depend on the resource type. + */ +struct st_context_resource { + enum st_context_resource_type type; + + const union { + unsigned int u; + long l; + void *ptr; + } in; + + union { + struct pipe_texture *pipe_texture; + } out; +}; + +/** * Represent a rendering context. * * This entity is created from st_api and used by the state tracker manager. @@ -196,6 +215,17 @@ struct st_manager_api struct st_context { /** + * Lock and unlock a state tracker context resource. + * + * This gives access to the underlying data structure of a state tracker + * context resource. + */ + boolean (*lock_resource)(const struct st_manager_api *api, + struct st_manager_resource *res); + void (*unlock_resource)(const struct st_manager_api *api, + const struct st_manager_resource *res); + + /** * Invalidate the current textures that was taken from a framebuffer. * * The state tracker manager calls this function to let the rendering @@ -244,25 +274,6 @@ struct st_context typedef void (*st_proc_t)(void); /** - * Represent a state tracker resource. - * - * The input and output depend on the resource type. - */ -struct st_resource { - enum st_resource_type type; - - const union { - unsigned int u; - long l; - void *ptr; - } in; - - union { - struct pipe_texture *pipe_texture; - } out; -}; - -/** * Represent a rendering API such as OpenGL or OpenVG. * * Implemented by the state tracker and used by the state tracker manager. @@ -270,17 +281,6 @@ struct st_resource { struct st_api { /** - * Lock and unlock a state tracker resource. - * - * This gives access to the underlying data structure of a state tracker - * resource. - */ - boolean (*lock_resource)(const struct st_manager_api *api, - struct st_manager_resource *res); - void (*unlock_resource)(const struct st_manager_api *api, - const struct st_manager_resource *res); - - /** * Create a rendering context. * * XXX: The pipe argument should go away once |