summaryrefslogtreecommitdiff
path: root/glamor/glamor.c
diff options
context:
space:
mode:
authorRobinHe <robinhe@robinhe-desktop.lan>2012-06-02 22:00:09 +0800
committerEric Anholt <eric@anholt.net>2013-12-18 11:23:52 -0800
commitbd180be619c2ef469ca40cf95023340c59960540 (patch)
treee2eadd8277f00baba11b03262e8615982ab55287 /glamor/glamor.c
parent6dd81c5939197eb51bc31ffbc3e6f359f2aad191 (diff)
Use shader to generate the temp trapezoid mask
The old manner of trapezoid render uses pixman to generate a mask pixmap and upload it to the GPU. This effect the performance. We now use shader to generate the temp trapezoid mask to avoid the uploading of this pixmap. We implement a anti-alias manner in the shader according to pixman, which will caculate the area inside the trapezoid dividing total area for every pixel and assign it to the alpha value of that pixel. The pixman use a int-to-fix manner to approximate but the shader use float, so the result may have some difference. Because the array in the shader has optimization problem, we need to emit the vertex of every trapezoid every time, which will effect the performance a lot. Need to improve it. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Diffstat (limited to 'glamor/glamor.c')
-rw-r--r--glamor/glamor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 74b22d39b..e4917836d 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -407,6 +407,9 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_init_pixmap_fbo(screen);
glamor_init_solid_shader(screen);
glamor_init_tile_shader(screen);
+#ifdef GLAMOR_TRAPEZOID_SHADER
+ glamor_init_trapezoid_shader(screen);
+#endif
glamor_init_putimage_shaders(screen);
glamor_init_finish_access_shaders(screen);
#ifdef GLAMOR_GRADIENT_SHADER
@@ -437,6 +440,9 @@ glamor_release_screen_priv(ScreenPtr screen)
glamor_fini_pixmap_fbo(screen);
glamor_fini_solid_shader(screen);
glamor_fini_tile_shader(screen);
+#ifdef GLAMOR_TRAPEZOID_SHADER
+ glamor_fini_trapezoid_shader(screen);
+#endif
glamor_fini_putimage_shaders(screen);
glamor_fini_finish_access_shaders(screen);
#ifdef GLAMOR_GRADIENT_SHADER