diff options
author | Eric Anholt <eric@anholt.net> | 2015-06-30 14:59:55 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2015-07-02 10:06:36 -0700 |
commit | 7b6edb52435f474c43130f6ac4c6b2d2b28814f5 (patch) | |
tree | 5b64caf8a3b35a140c48a7be3e259f6fa1796ecf | |
parent | 3fe6731b17ae953d49db4c1bf95e0022244513e1 (diff) |
glamor: Mark a bunch of single-file data static.
This gives the compiler a chance to optimize when the data is never
changed -- for example, with pict_format_combine_tab, the compiler
ends up inlining the 24 bytes of data into just 10 more bytes of code.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | glamor/glamor_core.c | 2 | ||||
-rw-r--r-- | glamor/glamor_program.c | 8 | ||||
-rw-r--r-- | glamor/glamor_render.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index 4f3526ccd..79f5981b1 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -283,7 +283,7 @@ glamor_init_finish_access_shaders(ScreenPtr screen) glUniform1i(glamor_priv->finish_access_swap_rb[1], 0); } -GCOps glamor_gc_ops = { +static GCOps glamor_gc_ops = { .FillSpans = glamor_fill_spans, .SetSpans = glamor_set_spans, .PutImage = glamor_put_image, diff --git a/glamor/glamor_program.c b/glamor/glamor_program.c index 1dc5f1983..5619216d0 100644 --- a/glamor/glamor_program.c +++ b/glamor/glamor_program.c @@ -499,7 +499,7 @@ use_source_solid(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog) return TRUE; } -const glamor_facet glamor_source_solid = { +static const glamor_facet glamor_source_solid = { .name = "render_solid", .fs_exec = " vec4 source = fg;\n", .locations = glamor_program_location_fg, @@ -517,7 +517,7 @@ use_source_picture(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *pro prog->fill_size_inv_uniform); } -const glamor_facet glamor_source_picture = { +static const glamor_facet glamor_source_picture = { .name = "render_picture", .vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;\n", .fs_exec = " vec4 source = texture2D(sampler, fill_pos);\n", @@ -533,14 +533,14 @@ use_source_1x1_picture(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program return glamor_set_texture_pixmap((PixmapPtr) src->pDrawable); } -const glamor_facet glamor_source_1x1_picture = { +static const glamor_facet glamor_source_1x1_picture = { .name = "render_picture", .fs_exec = " vec4 source = texture2D(sampler, vec2(0.5));\n", .locations = glamor_program_location_fillsamp, .use_render = use_source_1x1_picture, }; -const glamor_facet *glamor_facet_source[glamor_program_source_count] = { +static const glamor_facet *glamor_facet_source[glamor_program_source_count] = { [glamor_program_source_solid] = &glamor_source_solid, [glamor_program_source_picture] = &glamor_source_picture, [glamor_program_source_1x1_picture] = &glamor_source_1x1_picture, diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 509ebb821..78de8d7e7 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -660,7 +660,7 @@ glamor_flush_composite_rects(ScreenPtr screen) glamor_glDrawArrays_GL_QUADS(glamor_priv, glamor_priv->render_nr_quads); } -int pict_format_combine_tab[][3] = { +static const int pict_format_combine_tab[][3] = { {PICT_TYPE_ARGB, PICT_TYPE_A, PICT_TYPE_ARGB}, {PICT_TYPE_ABGR, PICT_TYPE_A, PICT_TYPE_ABGR}, }; |