diff options
author | Eric Anholt <eric@anholt.net> | 2013-12-18 13:10:24 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-02-14 18:29:56 -0800 |
commit | 781c692cf970642865f0e537f4905c43192f9935 (patch) | |
tree | 6418b0b0fb02b62af1a6d1f70832599f25915ee5 /glamor | |
parent | 0373b3f4f7c7aec633468b37f9236a2734dbcc74 (diff) |
glamor: Rename glamor_get/put_dispatch to glamor_get/put_context.
It used to be the thing that returned your dispatch table and happeend
to set up the context, but now it just sets up the context.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor')
-rw-r--r-- | glamor/glamor.c | 8 | ||||
-rw-r--r-- | glamor/glamor_copyarea.c | 18 | ||||
-rw-r--r-- | glamor/glamor_core.c | 12 | ||||
-rw-r--r-- | glamor/glamor_fbo.c | 16 | ||||
-rw-r--r-- | glamor/glamor_fill.c | 18 | ||||
-rw-r--r-- | glamor/glamor_glyphs.c | 4 | ||||
-rw-r--r-- | glamor/glamor_gradient.c | 30 | ||||
-rw-r--r-- | glamor/glamor_pixmap.c | 26 | ||||
-rw-r--r-- | glamor/glamor_render.c | 32 | ||||
-rw-r--r-- | glamor/glamor_tile.c | 18 | ||||
-rw-r--r-- | glamor/glamor_trapezoid.c | 24 | ||||
-rw-r--r-- | glamor/glamor_utils.h | 4 | ||||
-rw-r--r-- | glamor/glamor_xv.c | 12 |
13 files changed, 111 insertions, 111 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c index 74ae150d0..410ebd296 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -219,11 +219,11 @@ glamor_block_handler(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_priv->tick++; glFlush(); glamor_fbo_expire(glamor_priv); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); if (glamor_priv->state == RENDER_STATE && glamor_priv->render_idle_cnt++ > RENDER_IDEL_MAX) { glamor_priv->state = IDLE_STATE; @@ -236,9 +236,9 @@ _glamor_block_handler(void *data, OSTimePtr timeout, void *last_select_mask) { glamor_screen_private *glamor_priv = data; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glFlush(); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static void diff --git a/glamor/glamor_copyarea.c b/glamor/glamor_copyarea.c index 6eb0d986f..7279d3495 100644 --- a/glamor/glamor_copyarea.c +++ b/glamor/glamor_copyarea.c @@ -71,7 +71,7 @@ glamor_copy_n_to_n_fbo_blit(DrawablePtr src, pixmap_priv_get_fbo_off(dst_pixmap_priv, &fbo_x_off, &fbo_y_off); pixmap_priv_get_fbo_off(src_pixmap_priv, &src_fbo_x_off, &src_fbo_y_off); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT, src_pixmap_priv->base.fbo->fb); glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); glamor_get_drawable_deltas(src, src_pixmap, &src_x_off, &src_y_off); @@ -113,7 +113,7 @@ glamor_copy_n_to_n_fbo_blit(DrawablePtr src, GL_COLOR_BUFFER_BIT, GL_NEAREST); } } - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); glamor_priv->state = BLIT_STATE; return TRUE; } @@ -157,7 +157,7 @@ glamor_copy_n_to_n_textured(DrawablePtr src, glamor_get_drawable_deltas(dst, dst_pixmap, &dst_x_off, &dst_y_off); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, @@ -213,7 +213,7 @@ glamor_copy_n_to_n_textured(DrawablePtr src, #endif glUseProgram(0); /* The source texture is bound to a fbo, we have to flush it here. */ - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; return TRUE; @@ -374,12 +374,12 @@ _glamor_copy_n_to_n(DrawablePtr src, if (gc) { if (!glamor_set_planemask(dst_pixmap, gc->planemask)) goto fall_back; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (!glamor_set_alu(gc->alu)) { - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); goto fail; } - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } if (!src_pixmap_priv) { @@ -552,9 +552,9 @@ _glamor_copy_n_to_n(DrawablePtr src, } fail: - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_set_alu(GXcopy); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); if (ok) return TRUE; diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index fe49cb38d..58838095b 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -215,7 +215,7 @@ glamor_init_finish_access_shaders(ScreenPtr screen) char *source; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_priv->finish_access_prog[0] = glCreateProgram(); glamor_priv->finish_access_prog[1] = glCreateProgram(); @@ -274,7 +274,7 @@ glamor_init_finish_access_shaders(ScreenPtr screen) glUniform1i(sampler_uniform_location, 0); glUniform1i(glamor_priv->finish_access_swap_rb[1], 0); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -283,10 +283,10 @@ glamor_fini_finish_access_shaders(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glDeleteProgram(glamor_priv->finish_access_prog[0]); glDeleteProgram(glamor_priv->finish_access_prog[1]); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -307,11 +307,11 @@ glamor_finish_access(DrawablePtr drawable, glamor_access_t access_mode) if (pixmap_priv->base.fbo->pbo != 0 && pixmap_priv->base.fbo->pbo_valid) { assert(glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); glDeleteBuffers(1, &pixmap_priv->base.fbo->pbo); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); pixmap_priv->base.fbo->pbo_valid = FALSE; pixmap_priv->base.fbo->pbo = 0; diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c index bb7af2c87..281cf830e 100644 --- a/glamor/glamor_fbo.c +++ b/glamor/glamor_fbo.c @@ -129,7 +129,7 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv, void glamor_purge_fbo(glamor_pixmap_fbo *fbo) { - glamor_get_dispatch(fbo->glamor_priv); + glamor_get_context(fbo->glamor_priv); if (fbo->fb) glDeleteFramebuffers(1, &fbo->fb); @@ -137,7 +137,7 @@ glamor_purge_fbo(glamor_pixmap_fbo *fbo) glDeleteTextures(1, &fbo->tex); if (fbo->pbo) glDeleteBuffers(1, &fbo->pbo); - glamor_put_dispatch(fbo->glamor_priv); + glamor_put_context(fbo->glamor_priv); free(fbo); } @@ -180,7 +180,7 @@ glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo) { int status; - glamor_get_dispatch(fbo->glamor_priv); + glamor_get_context(fbo->glamor_priv); if (fbo->fb == 0) glGenFramebuffers(1, &fbo->fb); @@ -219,7 +219,7 @@ glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo) FatalError("destination is framebuffer incomplete: %s [%x]\n", str, status); } - glamor_put_dispatch(fbo->glamor_priv); + glamor_put_context(fbo->glamor_priv); } glamor_pixmap_fbo * @@ -241,9 +241,9 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, fbo->glamor_priv = glamor_priv; if (flag == GLAMOR_CREATE_PIXMAP_MAP) { - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glGenBuffers(1, &fbo->pbo); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); goto done; } @@ -341,14 +341,14 @@ _glamor_create_tex(glamor_screen_private *glamor_priv, w, h); } if (!tex) { - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, format, GL_UNSIGNED_BYTE, NULL); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } return tex; } diff --git a/glamor/glamor_fill.c b/glamor/glamor_fill.c index e98fc5bbb..c9bd519c7 100644 --- a/glamor/glamor_fill.c +++ b/glamor/glamor_fill.c @@ -153,7 +153,7 @@ glamor_init_solid_shader(ScreenPtr screen) GLint fs_prog, vs_prog; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_priv->solid_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, solid_vs); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, solid_fs); @@ -166,7 +166,7 @@ glamor_init_solid_shader(ScreenPtr screen) glamor_priv->solid_color_uniform_location = glGetUniformLocation(glamor_priv->solid_prog, "color"); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -175,9 +175,9 @@ glamor_fini_solid_shader(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glDeleteProgram(glamor_priv->solid_prog); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static void @@ -193,7 +193,7 @@ _glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color) glamor_set_destination_pixmap_priv_nc(pixmap_priv); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glUseProgram(glamor_priv->solid_prog); glUniform4fv(glamor_priv->solid_color_uniform_location, 1, color); @@ -256,7 +256,7 @@ _glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color) glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; } @@ -327,13 +327,13 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, return FALSE; } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (!glamor_set_alu(alu)) { if (alu == GXclear) fg_pixel = 0; else { glamor_fallback("unsupported alu %x\n", alu); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return FALSE; } } @@ -344,7 +344,7 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height, glamor_solid_boxes(pixmap, &box, 1, fg_pixel); glamor_set_alu(GXcopy); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return TRUE; } diff --git a/glamor/glamor_glyphs.c b/glamor/glamor_glyphs.c index c118f34ac..caafa4348 100644 --- a/glamor/glamor_glyphs.c +++ b/glamor/glamor_glyphs.c @@ -1278,9 +1278,9 @@ glamor_buffer_glyph(glamor_screen_private *glamor_priv, * thus we have to composite from the cache picture * to the cache picture, we need a flush here to make * sure latter we get the corret glyphs data.*/ - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glFlush(); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } } else { diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c index 08df9968a..4ea441e10 100644 --- a/glamor/glamor_gradient.c +++ b/glamor/glamor_gradient.c @@ -176,7 +176,7 @@ _glamor_create_getcolor_fs_program(ScreenPtr screen, int stops_count, "}\n"; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (use_array) { XNFasprintf(&gradient_fs, @@ -353,7 +353,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, return; } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][2]) { glDeleteShader(glamor_priv->radial_gradient_shaders @@ -422,7 +422,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count, radial_gradient_shaders[SHADER_GRADIENT_FS_GETCOLOR_PROG][index] = fs_getcolor_prog; - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static void @@ -586,7 +586,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, return; } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (dyn_gen && glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][2]) { glDeleteShader(glamor_priv->linear_gradient_shaders [SHADER_GRADIENT_VS_PROG][2]); @@ -652,7 +652,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, linear_gradient_shaders[SHADER_GRADIENT_FS_GETCOLOR_PROG][index] = fs_getcolor_prog; - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -695,7 +695,7 @@ glamor_fini_gradient_shader(ScreenPtr screen) int i = 0; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); for (i = 0; i < 3; i++) { /* Linear Gradient */ @@ -737,7 +737,7 @@ glamor_fini_gradient_shader(ScreenPtr screen) [SHADER_GRADIENT_RADIAL][i]); } - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static void @@ -868,7 +868,7 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen, tex_vertices[0], tex_vertices[1], tex_vertices[2], tex_vertices[3], tex_vertices[4], tex_vertices[5], tex_vertices[6], tex_vertices[7]); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 0, vertices); @@ -878,7 +878,7 @@ _glamor_gradient_set_pixmap_destination(ScreenPtr screen, glEnableVertexAttribArray(GLAMOR_VERTEX_POS); glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return 1; } @@ -1021,7 +1021,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, GLint r2_uniform_location = 0; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); /* Create a pixmap with VBO. */ pixmap = glamor_create_pixmap(screen, @@ -1258,7 +1258,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return dst_picture; GRADIENT_FAIL: @@ -1279,7 +1279,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return NULL; } @@ -1343,7 +1343,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, GLint pt_distance_uniform_location = 0; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); /* Create a pixmap with VBO. */ pixmap = glamor_create_pixmap(screen, @@ -1611,7 +1611,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return dst_picture; GRADIENT_FAIL: @@ -1632,7 +1632,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return NULL; } diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index 7f152fc75..4012755de 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -66,7 +66,7 @@ void glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo *fbo, int x0, int y0, int width, int height) { - glamor_get_dispatch(fbo->glamor_priv); + glamor_get_context(fbo->glamor_priv); glBindFramebuffer(GL_FRAMEBUFFER, fbo->fb); #ifndef GLAMOR_GLES2 @@ -77,7 +77,7 @@ glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo *fbo, int x0, int y0, #endif glViewport(x0, y0, width, height); - glamor_put_dispatch(fbo->glamor_priv); + glamor_put_context(fbo->glamor_priv); } void @@ -400,7 +400,7 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, int non_sub = 0; unsigned int iformat = 0; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (*tex == 0) { glGenTextures(1, tex); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) @@ -425,7 +425,7 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex, if (bits == NULL) glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static Bool @@ -522,7 +522,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, x + w, y + h, glamor_priv->yInverted, vertices); /* Slow path, we need to flip y or wire alpha to 1. */ - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), vertices); glEnableVertexAttribArray(GLAMOR_VERTEX_POS); @@ -556,7 +556,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, glDeleteTextures(1, &tex); glBindFramebuffer(GL_FRAMEBUFFER, 0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); if (need_free_bits) free(bits); @@ -838,7 +838,7 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, if (temp_fbo == NULL) return NULL; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); temp_xscale = 1.0 / w; temp_yscale = 1.0 / h; @@ -876,7 +876,7 @@ glamor_es2_pixmap_read_prepare(PixmapPtr source, int x, int y, int w, int h, glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return temp_fbo; } @@ -956,7 +956,7 @@ _glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, GLenum format, fbo_y_off = 0; } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glPixelStorei(GL_PACK_ALIGNMENT, 4); if (glamor_priv->has_pack_invert || glamor_priv->yInverted) { @@ -987,7 +987,7 @@ _glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, GLenum format, unsigned int temp_pbo; int yy; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glGenBuffers(1, &temp_pbo); glBindBuffer(GL_PIXEL_PACK_BUFFER, temp_pbo); glBufferData(GL_PIXEL_PACK_BUFFER, stride * h, NULL, GL_STREAM_READ); @@ -1002,7 +1002,7 @@ _glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, GLenum format, } glBindFramebuffer(GL_FRAMEBUFFER, 0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); if (need_post_conversion) { /* As OpenGL desktop version never enters here. @@ -1176,10 +1176,10 @@ glamor_download_pixmap_to_cpu(PixmapPtr pixmap, glamor_access_t access) data = malloc(stride * pixmap->drawable.height); } else { - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (pixmap_priv->base.fbo->pbo == 0) glGenBuffers(1, &pixmap_priv->base.fbo->pbo); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); pbo = pixmap_priv->base.fbo->pbo; } diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 760af837c..34530f395 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -316,7 +316,7 @@ glamor_create_composite_shader(ScreenPtr screen, struct shader_key *key, GLint source_sampler_uniform_location, mask_sampler_uniform_location; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); vs = glamor_create_composite_vs(key); if (vs == 0) goto out; @@ -365,7 +365,7 @@ glamor_create_composite_shader(ScreenPtr screen, struct shader_key *key, } out: - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static glamor_composite_shader * @@ -407,7 +407,7 @@ glamor_init_composite_shaders(ScreenPtr screen) int eb_size; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glGenBuffers(1, &glamor_priv->vbo); glGenBuffers(1, &glamor_priv->ebo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ebo); @@ -448,7 +448,7 @@ glamor_init_composite_shaders(ScreenPtr screen) glamor_priv->vb = (char *) vb; } - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -459,7 +459,7 @@ glamor_fini_composite_shaders(ScreenPtr screen) int i, j, k; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glDeleteBuffers(1, &glamor_priv->vbo); glDeleteBuffers(1, &glamor_priv->ebo); @@ -473,7 +473,7 @@ glamor_fini_composite_shaders(ScreenPtr screen) if (glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP && glamor_priv->vb) free(glamor_priv->vb); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static Bool @@ -529,7 +529,7 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, float wh[4]; int repeat_type; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glActiveTexture(GL_TEXTURE0 + unit); glBindTexture(GL_TEXTURE_2D, pixmap_priv->base.fbo->tex); repeat_type = picture->repeatType; @@ -598,7 +598,7 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, repeat_type -= RepeatFix; } glUniform1i(repeat_location, repeat_type); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static void @@ -717,7 +717,7 @@ glamor_setup_composite_vbo(ScreenPtr screen, int n_verts) vert_size = n_verts * glamor_priv->vb_stride; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glBindBuffer(GL_ARRAY_BUFFER, glamor_priv->vbo); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { if (glamor_priv->vbo_size < (glamor_priv->vbo_offset + vert_size)) { @@ -764,7 +764,7 @@ glamor_setup_composite_vbo(ScreenPtr screen, int n_verts) 4 : 2) * sizeof(float))); glEnableVertexAttribArray(GLAMOR_VERTEX_MASK); } - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -797,7 +797,7 @@ glamor_flush_composite_rects(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) glUnmapBuffer(GL_ARRAY_BUFFER); else { @@ -818,7 +818,7 @@ glamor_flush_composite_rects(ScreenPtr screen) glDrawElements(GL_TRIANGLES, (glamor_priv->render_nr_verts * 3) / 2, GL_UNSIGNED_SHORT, NULL); #endif - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } int pict_format_combine_tab[][3] = { @@ -1194,7 +1194,7 @@ glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv, glamor_priv = dest_priv->base.glamor_priv; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glUseProgram(shader->prog); if (key->source == SHADER_SOURCE_SOLID) { @@ -1229,7 +1229,7 @@ glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv, glBlendFunc(op_info->source_blend, op_info->dest_blend); } - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static Bool @@ -1286,7 +1286,7 @@ glamor_composite_with_shader(CARD8 op, glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv); glamor_composite_set_shader_blend(dest_pixmap_priv, &key, shader, &op_info); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_priv->has_source_coords = key.source != SHADER_SOURCE_SOLID; glamor_priv->has_mask_coords = (key.mask != SHADER_MASK_NONE && @@ -1421,7 +1421,7 @@ glamor_composite_with_shader(CARD8 op, glamor_priv->render_idle_cnt = 0; if (saved_source_format) source->format = saved_source_format; - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); ret = TRUE; return ret; diff --git a/glamor/glamor_tile.c b/glamor/glamor_tile.c index 8ceb54962..5b58e80cd 100644 --- a/glamor/glamor_tile.c +++ b/glamor/glamor_tile.c @@ -62,7 +62,7 @@ glamor_init_tile_shader(ScreenPtr screen) GLint sampler_uniform_location; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_priv->tile_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, tile_vs); fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, tile_fs); @@ -83,7 +83,7 @@ glamor_init_tile_shader(ScreenPtr screen) glamor_priv->tile_wh = glGetUniformLocation(glamor_priv->tile_prog, "wh"); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -92,9 +92,9 @@ glamor_fini_tile_shader(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glDeleteProgram(glamor_priv->tile_prog); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static void @@ -124,7 +124,7 @@ _glamor_tile(PixmapPtr pixmap, PixmapPtr tile, glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv); pixmap_priv_get_dest_scale(dst_pixmap_priv, &dst_xscale, &dst_yscale); pixmap_priv_get_scale(src_pixmap_priv, &src_xscale, &src_yscale); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glUseProgram(glamor_priv->tile_prog); glamor_pixmap_fbo_fix_wh_ratio(wh, src_pixmap_priv); @@ -163,7 +163,7 @@ _glamor_tile(PixmapPtr pixmap, PixmapPtr tile, #endif glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); glamor_priv->state = RENDER_STATE; glamor_priv->render_idle_cnt = 0; @@ -201,10 +201,10 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile, goto fail; } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (!glamor_set_alu(alu)) { glamor_fallback("unsupported alu %x\n", alu); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); goto fail; } @@ -298,7 +298,7 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile, _glamor_tile(pixmap, tile, x, y, width, height, tile_x, tile_y); glamor_set_alu(GXcopy); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return TRUE; fail: return FALSE; diff --git a/glamor/glamor_trapezoid.c b/glamor/glamor_trapezoid.c index b39821396..6ef0c1ded 100644 --- a/glamor/glamor_trapezoid.c +++ b/glamor/glamor_trapezoid.c @@ -205,7 +205,7 @@ glamor_flush_composite_triangles(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) glUnmapBuffer(GL_ARRAY_BUFFER); else { @@ -219,7 +219,7 @@ glamor_flush_composite_triangles(ScreenPtr screen) return; glDrawArrays(GL_TRIANGLES, 0, glamor_priv->render_nr_verts); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static Bool @@ -602,7 +602,7 @@ glamor_setup_composite_vbo_for_trapezoid(ScreenPtr screen, int n_verts) vert_size = n_verts * glamor_priv->vb_stride; - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); @@ -669,7 +669,7 @@ glamor_setup_composite_vbo_for_trapezoid(ScreenPtr screen, int n_verts) stride * sizeof(float))); glEnableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static Bool @@ -811,7 +811,7 @@ _glamor_trapezoids_with_shader(CARD8 op, goto TRAPEZOID_OUT; } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); box = REGION_RECTS(®ion); nbox = REGION_NUM_RECTS(®ion); @@ -983,7 +983,7 @@ _glamor_trapezoids_with_shader(CARD8 op, glDisable(GL_TEXTURE_2D); #endif glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); TRAPEZOID_OUT: if (box) { @@ -1336,7 +1336,7 @@ glamor_init_trapezoid_shader(ScreenPtr screen) "}\n"; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_priv->trapezoid_prog = glCreateProgram(); @@ -1361,7 +1361,7 @@ glamor_init_trapezoid_shader(ScreenPtr screen) glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -1370,9 +1370,9 @@ glamor_fini_trapezoid_shader(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glDeleteProgram(glamor_priv->trapezoid_prog); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } static Bool @@ -1413,7 +1413,7 @@ _glamor_generate_trapezoid_with_shader(ScreenPtr screen, PicturePtr picture, return FALSE; } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_set_destination_pixmap_priv_nc(pixmap_priv); @@ -1582,7 +1582,7 @@ _glamor_generate_trapezoid_with_shader(ScreenPtr screen, PicturePtr picture, glDisableVertexAttribArray(GLAMOR_VERTEX_LEFT_PARAM); glDisableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); return TRUE; } diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h index d427360a2..b82517a83 100644 --- a/glamor/glamor_utils.h +++ b/glamor/glamor_utils.h @@ -1829,14 +1829,14 @@ glamor_restore_current(ScreenPtr screen) } static inline void -glamor_get_dispatch(glamor_screen_private * glamor_priv) +glamor_get_context(glamor_screen_private * glamor_priv) { if (glamor_priv->flags & GLAMOR_USE_EGL_SCREEN) glamor_make_current(glamor_priv->screen); } static inline void -glamor_put_dispatch(glamor_screen_private * glamor_priv) +glamor_put_context(glamor_screen_private * glamor_priv) { if (glamor_priv->flags & GLAMOR_USE_EGL_SCREEN) glamor_restore_current(glamor_priv->screen); diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c index 89787a419..dc39476b5 100644 --- a/glamor/glamor_xv.c +++ b/glamor/glamor_xv.c @@ -93,7 +93,7 @@ glamor_init_xv_shader(ScreenPtr screen) GLint fs_prog, vs_prog; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glamor_priv->xv_prog = glCreateProgram(); vs_prog = glamor_compile_glsl_prog(GL_VERTEX_SHADER, xv_vs); @@ -107,7 +107,7 @@ glamor_init_xv_shader(ScreenPtr screen) GLAMOR_VERTEX_SOURCE, "v_texcoord0"); glamor_link_glsl_prog(glamor_priv->xv_prog); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } void @@ -116,10 +116,10 @@ glamor_fini_xv_shader(ScreenPtr screen) glamor_screen_private *glamor_priv; glamor_priv = glamor_get_screen_private(screen); - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glDeleteProgram(glamor_priv->xv_prog); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); } #define ClipValue(v,min,max) ((v) < (min) ? (min) : (v) > (max) ? (max) : (v)) @@ -324,7 +324,7 @@ glamor_display_textured_video(glamor_port_private *port_priv) &src_yscale[i]); } } - glamor_get_dispatch(glamor_priv); + glamor_get_context(glamor_priv); glUseProgram(glamor_priv->xv_prog); uloc = glGetUniformLocation(glamor_priv->xv_prog, "offsetyco"); @@ -413,7 +413,7 @@ glamor_display_textured_video(glamor_port_private *port_priv) glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); glUseProgram(0); - glamor_put_dispatch(glamor_priv); + glamor_put_context(glamor_priv); DamageDamageRegion(port_priv->pDraw, &port_priv->clip); } |