summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-06-25glamor_glyphs: Use glyph_to_dst as much as possible.glyphs-optZhigang Gong1-60/+288
To split a glyph's extent region to three sub-boxes as below. left box 2 x h center box (w-4) x h right box 2 x h Take a simple glyph A as an example: * __* *__ ***** * * ~~ ~~ The left box and right boxes are both 2 x 2. The center box is 2 x 4. And then we can check the inked area in left and right boxes. And then latter, when detect overlapping, we can use these three boxes to do the intersect cheking rather than a whole large box. And in practice, this way, we can avoid most of those faked overlapping case. And thus we can get much performance benefit by this patch. The aa10text boost fom 1660000 to 320000. Almost double the performance! I will try to apply this method to cairo's gl backend latter. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-21glamor_render: Don't fallback when rendering glyphs with OpOver.Zhigang Gong1-3/+25
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-21glamor_create_pixmap: Allocate glyphs pixmap in memory.Zhigang Gong1-0/+1
As we have glyphs atlas cache, we don't need to hold each glyphs on GPU. And for the subsequent optimization, we need to store the original glyphs pixmap on system memory. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-21glamor_fbo: fix a memory leak for large pixmap.Zhigang Gong1-1/+2
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-15Fix a bug for trapezoid clipJunyan He1-8/+107
We find in some cases the trapezoid will be render as a triangle and the left edge and right edge will cross with each other just bellow the top or over the bottom. The distance between the cross poind and the top or bottom is less than pixman_fixed_1_minus_e, so after the fixed converted to int, the cross point has the same value with the top or botton and the triangle should not be affected. But in our clip logic, the cross point will be clipped out. So add a logic to fix this problem. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2012-06-15gles2_largepixmap: force clip for a non-large pixmap.Zhigang Gong2-8/+32
One case we need force clip when download/upload a drm_texture pixmap. Actually, this is only meaningful for testing purpose. As we may set the max_fbo_size to a very small value, but the drm texture may exceed this value but the drm texture pixmap is not largepixmap. This is not a problem with OpenGL. But for GLES2, we may need to call glamor_es2_pixmap_read_prepare to create a temporary fbo to do the color conversion. Then we have to force clip the drm pixmap here to avoid large pixmap handling at glamor_es2_pixmap_read_prepare. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-15glamor_emit_composite_vert: Optimize to don't do two times vert coping.Zhigang Gong3-137/+216
We change some macros to put the vert to the vertex buffer directly when we cacluating it. This way, we can get about 4% performance gain. This commit also fixed one RepeatPad bug, when we RepeatPad a not eaxct size fbo. We need to calculate the edge. The edge should be 1.0 - half point, not 1.0. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-15glamor_glyphs: Before get upload to cache flush is needed.Zhigang Gong1-87/+139
When we can't get a cache hit and have to evict one cache entry to upload new picture, we need to flush the previous buffer. Otherwise, we may get corrupt glyphs rendering result. This is the reason why user-font-proxy may fail sometimes. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-15copyarea: Cleanup the error handling logic.Zhigang Gong1-6/+8
Should use ok rather than mixed ok or ret. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-14trapezoid: Fallback to sw-rasterize for largepixmap.Zhigang Gong1-4/+13
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-12Use the direct render path for A1Junyan He2-8/+27
Because when mask depth is 1, there is no Anti-Alias at all, in this case, the directly render can work well and it is faseter. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2012-06-12Add the trapezoid direct render logicJunyan He3-0/+806
We firstly get the render area by clipping the trapezoid with the clip rect, then split the clipped area into small triangles and use the composite logic to generate the result directly. This manner is fast but have the problem that some implementation of GL do not implement the Anti-Alias of triangles fill, so the edge sometimes has sawtooth. It is not acceptable when use trapezoid to approximate circles and wide lines. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2012-06-12Modilfy the composite logic to two phasesJunyan He4-81/+134
We seperate the composite to two phases, firstly to select the shader according to source type and logic op, setting the right parameters. Then we emit the vertex array to generate the dest result. The reason why we do this is that the shader may be used to composite no only rect, trapezoid and triangle render function can also use it to render triangles and polygens. The old function glamor_composite_with_shader do the whole two phases work and can not match the new request. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2012-06-12Add macro of vertex setting for triangle stripeJunyan He3-54/+81
Add macro of vertex setting for triangle stripe draw, and make the code clear. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2012-06-12Use shader to generate the temp trapezoid maskRobinHe3-47/+657
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>
2012-06-12Create the file glamor_triangles.cRobinHe4-149/+189
Create the file glamor_trapezoid.c, extract the logic relating to trapezoid from glamor_render.c to this file. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2012-06-11Enable large pixmap by default.for_large_pixmapZhigang Gong1-2/+2
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11largepixmap: Fix the selfcopy issue.Zhigang Gong6-44/+86
If the source and destination are the same pixmap/fbo, and we need to split the copy to small pieces. Then we do need to consider the sequence of the small pieces when the copy area has overlaps. This commit take the reverse/upsidedown into the clipping function, thus it can generate correct sequence and avoid corruption self copying. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11largepixmap: Support self composite for large pixmap.Zhigang Gong3-45/+57
The simplest way to support large pixmap's self compositing is to just clone a pixmap private data structure, and change the fbo and box to point to the correct postions. Don't need to copy a new box. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11largepixmap: Add transform/repeat/reflect/pad support.Zhigang Gong3-75/+981
This commit implement almost all the needed functions for the large pixmap support. It's almost complete. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11glamor_getimage: should call miGetimage if failed to get sub-image.Zhigang Gong1-1/+3
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11glamor_putimage: Correct the wrong stride value.Zhigang Gong1-1/+1
We should not use the destination pixmap's devkind as the input image data's stride. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11largepixmap: Enable glamor_composite.Zhigang Gong3-2/+195
Now we start to enable glamor_composite on large pixmap. We need to do a three layer clipping to split the dest/source/mask to small pieces. This commit only support non-transformation and repeat normal case. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11largepixmap: Implement infrastructure for large pixmap.Zhigang Gong11-453/+1711
Added infrastructure for largepixmap, this commit implemented: 1. Create/Destroy large pixmap. 2. Upload/Download large pixmap. 3. Implement basic repeat normal support. 3. tile/fill/copyarea large pixmap get supported. The most complicated part glamor_composite still not implemented. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-11glamor_largepixmap: first commit for large pixmap.Zhigang Gong15-170/+439
This is the first commit to add support for large pixmap. The large here means a pixmap is larger than the texutre's size limitation thus can't fit into one single texutre. The previous implementation will simply fallback to use a in memory pixmap to contain the large pixmap which is very slow in practice. The basic idea here is to use an array of texture to hold the large pixmap. And when we need to get a specific area of the pixmap, we just need to compute/clip the correct region and find the corresponding fbo. We need to implement some auxiliary routines to clip every rendering operations into small pieces which can fit into one texture. The complex part is the transformation/repeat/repeatReflect and repeat pad and their comination. We will support all of them step by step. This commit just add some necessary data structure to represent the large pixmap, and doesn't change any rendering process. This commit doesn't add real large pixmap support. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-16Fix the problem of x_source and y_source causing radial errorJunyan He2-67/+71
The x_source and y_source cause some problem in gradient. The old way to handle it by recaulate P1 P2 to minus the x_source and y_source, but this causes problem in radial shader. Now we modify the manner to set the texture coordinates: (x_source, y_source) --> (x_source + width, y_source + height) to handle all the cases. Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Junyan He <junyan.he@linux.intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-16Fix the problem of vertical and horizontal case error in linear gradient.Junyan He1-20/+4
1. The vertical and horizontal judgement in linear gradient have problem when p1 point and p2 point distance is very small but the gradient pict have a transform matrix which will convert the X Y coordinates to small values. So the judgement is not suitable. Because this judgement's purpose is to assure the divisor not to be zero, so we simply it to enter horizontal judgement when p1 and p2's Y is same. Vertical case is deleted. 2. Delete the unused p1 p2 uniform variable. Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Junyan He <junyan.he@linux.intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-16Fix the problem of set the same stop several times.Junyan He1-17/+8
Some gradient set the stops at the same position, for example: firstly 0.5 to red color and then set 0.5 to blue. This kind of setting will cause the shader work not correctly because the percentage caculating need to use the stop[i] - stop[i-1] as dividend. The previous patch we just kill some stop if the distance between them is 0. But this cause the problem that the color for next stop is wrong. We now modify to handle it in the shader to avoid the 0 as dividend. Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Junyan He <junyan.he@linux.intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-16Fix a bugy macro definition.Junyan He1-4/+4
The macro like "#define LINEAR_SMALL_STOPS 6 + 2" causes the problem. When use it to define like "GLfloat stop_colors_st[LINEAR_SMALL_STOPS*4];" The array is small than what we supposed it to be. Cause memory corruption problem and cause the bug of render wrong result. Fix it. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-16Extract the gradient related code out.Junyan He4-1581/+1653
1. Extract the logic of gradient from the glamor_render.c to the file glamor_gradient.c. 2. Modify the logic of gradient pixmap gl draw. Use the logic like composite before, but the gradient always just have one rect to render, so no need to set the VB and EB, replace it with just call glDrawArrays. 3.Kill all the warning in glamor_render.c Reviewed-by: Zhigang Gong<zhigang.gong@linux.intel.com> Signed-off-by: Junyan He <junyan.he@linux.intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-16glamor_set_destination_pixmap_priv_nc: set drawable's width x height.Zhigang Gong7-17/+22
Previous implementation set the whole fbo's width and height as the viewpoint. This may increase the numerical error as we may only has a partial region as the valid pixmap. So add a new marco pixmap_priv_get_dest_scale to get proper scale factor for the destination pixmap. For the source/mask pixmap, we still need to consider the whole fbo's size. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-15Remove the texture cache code.Zhigang Gong2-89/+6
Caching texture objects is not necessary based on previous testing. To keep the code simple, we remove it. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-05-15Added strict warning flags to CFLAGS.Zhigang Gong9-29/+30
We miss the strict warning flags for a long time, now add it back. This commit also fixed most of the warnings after enable the strict flags. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28We should not call gradient finalization code if we disable it.Zhigang Gong1-0/+2
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Release 0.4.0.4-rc1Zhigang Gong3-18/+84
Update Readme, and write a new ReleaseNote and bump the version to 0.4. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Fixed all unused variables warnings.Zhigang Gong12-44/+14
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Fixed an uninitialized problem at gradient shader functions.Zhigang Gong1-4/+3
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Fixed one typo bug when fixup a mask picture.Zhigang Gong1-15/+11
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Added some copyright and author information.Zhigang Gong17-1/+216
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Added --enable-debug configuration option.Zhigang Gong4-3/+14
For release version, we disable asserts. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Remove unecessary header file.Zhigang Gong1-1/+0
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28configure: Install glamor.conf to xorg.conf.d.Zhigang Gong4-3/+42
As we need to make sure load DRI2 first and then load glamoregl and then load GLX module, we create a new xorg configuration file here and install it to system configuration directory. Note: If you are building xserver at your local directory and set the prefix to your local directory rather than the system directory, then the glamor.conf may not be loaded when you run the X server you built locally. The reason is that currently xorg will search the following dir /usr/share/X11/xorg.conf.d if it exist , then will ignore your local configuration directory where the glamor.conf is at. Then you may fail to start Xserver. If this is the case, you may need to copy the glamor.conf to /usr/share/X11/xorg.conf.d manually. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_render: Fix the repeat none for GLES2.Zhigang Gong2-28/+71
As GLES2 doesn't support clamp to the border, we have to handle it seprately from the normal case. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_blockhandler: Don't do glFinish every time.Zhigang Gong1-2/+0
To do glfinish every time bring some performance overhead. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_copyarea: Return earlier if have zero nbox.Zhigang Gong1-6/+3
Almost all callers will check whether the regions is empty before call to this internal API, but it seems the glamor_composite_with_copy may call into here with a zero nbox. A little weird, as the miComputeCompositeRegion return a Non-NULL, but the region is empty. Also remove a unecessary glflush. So let's check it here. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_render: Have to use eaxct size pixmap for transformation.Zhigang Gong1-19/+30
Use partial texture as the pixmap for the transformation source/mask may introduce extra errors. have to use eaxct size. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_fbo: Added a threshold value for the fbo cache pool.Zhigang Gong2-6/+21
Currently set it to 256MB. If cache pool watermark increases to this value, then don't push any fbo to this pool, will purge the fbo directly. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27Fixed a1 bug.Zhigang Gong2-4/+29
It seems that mesa has bugs when uploading bitmap to texture. We switch to convert bitmap to a8 format and then upload the a8 texture. Also added a helper routine to dump 1bpp pixmap. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_render.c: Fixed repeatPad and repeatRelect.Zhigang Gong2-34/+87
We should use difference calculation for these two repeat mode when we are a sub region within one texture. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27gradient: Don't need fixup flag when creating pixmap.Zhigang Gong1-11/+11
Gradient can use a larger texture/fbo directly, don't need an eaxct size texture. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>