Just use the shader to generate trapezoid if PolyMode == Imprecise
The precise mode of trapezoid rendering need to sample the trapezoid on the centre points of an (2*n+1)x(2*n-1) subpixel grid. It is computationally expensive in shader, and we use inside area ratio to replace it. The result has some difference, and we just use it if the polymode == Imprecise. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
This commit is contained in:
parent
fe024a7822
commit
9f78e22fa6
|
@ -1664,15 +1664,20 @@ _glamor_trapezoids(CARD8 op,
|
||||||
if(ret)
|
if(ret)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
picture = glamor_create_mask_picture(screen, dst, mask_format,
|
/* The precise mode is that we sample the trapezoid on the centre points of
|
||||||
width, height, 1);
|
an (2*n+1)x(2*n-1) subpixel grid. It is computationally expensive in shader
|
||||||
if (!picture)
|
and we use inside area ratio to replace it if the polymode == Imprecise. */
|
||||||
return TRUE;
|
if(dst->polyMode == PolyModeImprecise) {
|
||||||
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue