Use the direct render path for A1
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>
This commit is contained in:
parent
fa74a213ad
commit
8f31aed48c
|
@ -965,7 +965,7 @@ glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
|
||||||
#define GLAMOR_PIXMAP_DYNAMIC_UPLOAD
|
#define GLAMOR_PIXMAP_DYNAMIC_UPLOAD
|
||||||
#ifndef GLAMOR_GLES2
|
#ifndef GLAMOR_GLES2
|
||||||
#define GLAMOR_GRADIENT_SHADER
|
#define GLAMOR_GRADIENT_SHADER
|
||||||
#define GLAMOR_TRAPEZOID_SHADER
|
//#define GLAMOR_TRAPEZOID_SHADER
|
||||||
#endif
|
#endif
|
||||||
#define GLAMOR_TEXTURED_LARGE_PIXMAP 1
|
#define GLAMOR_TEXTURED_LARGE_PIXMAP 1
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -1409,15 +1409,34 @@ _glamor_trapezoids(CARD8 op,
|
||||||
stride = PixmapBytePad(width, mask_format->depth);
|
stride = PixmapBytePad(width, mask_format->depth);
|
||||||
|
|
||||||
#ifdef GLAMOR_TRAPEZOID_SHADER
|
#ifdef GLAMOR_TRAPEZOID_SHADER
|
||||||
picture = glamor_create_mask_picture(screen, dst, mask_format,
|
/* We seperate the render to two paths.
|
||||||
width, height, 1);
|
Some GL implemetation do not implement the Anti-Alias for triangles
|
||||||
if (!picture)
|
and polygen's filling. So when the edge is not vertical or horizontal,
|
||||||
return TRUE;
|
sawtooth will be obvious. The trapezoid is widely used to render wide
|
||||||
|
lines and circles. In these case, the line or circle will be divided
|
||||||
|
into a large number of small trapezoids to approximate it, so the sawtooth
|
||||||
|
at the edge will cause the result not be acceptable.
|
||||||
|
When the depth of the mask is 1, there is no Anti-Alias needed, so we
|
||||||
|
use the clip logic to generate the result directly(fast path).
|
||||||
|
When the depth is not 1, AA is needed and we use a shader to generate
|
||||||
|
a temp mask pixmap.
|
||||||
|
*/
|
||||||
|
if(mask_format->depth == 1) {
|
||||||
|
ret = _glamor_trapezoids_with_shader(op, src, dst, mask_format,
|
||||||
|
x_src, y_src, ntrap, traps);
|
||||||
|
if(ret)
|
||||||
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
picture = glamor_create_mask_picture(screen, dst, mask_format,
|
||||||
|
width, height, 1);
|
||||||
|
if (!picture)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
ret = _glamor_generate_trapezoid_with_shader(screen, picture, traps, ntrap, &bounds);
|
ret = _glamor_generate_trapezoid_with_shader(screen, picture, traps, ntrap, &bounds);
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
FreePicture(picture, 0);
|
FreePicture(picture, 0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
|
|
Loading…
Reference in New Issue