Fix several cases where optimized paths were hit when they shouldn't be.
This fixes a number of rendercheck cases.
This commit is contained in:
parent
40f84793bc
commit
6fdfd9dad9
15
fb/fbpict.c
15
fb/fbpict.c
|
@ -930,9 +930,8 @@ fbComposite (CARD8 op,
|
||||||
case PictOpOver:
|
case PictOpOver:
|
||||||
if (pMask)
|
if (pMask)
|
||||||
{
|
{
|
||||||
if (srcRepeat &&
|
if (fbCanGetSolid(pSrc) &&
|
||||||
pSrc->pDrawable->width == 1 &&
|
!maskRepeat)
|
||||||
pSrc->pDrawable->height == 1)
|
|
||||||
{
|
{
|
||||||
srcRepeat = FALSE;
|
srcRepeat = FALSE;
|
||||||
if (PICT_FORMAT_COLOR(pSrc->format)) {
|
if (PICT_FORMAT_COLOR(pSrc->format)) {
|
||||||
|
@ -1044,7 +1043,7 @@ fbComposite (CARD8 op,
|
||||||
{
|
{
|
||||||
if (pSrc->pDrawable == pMask->pDrawable &&
|
if (pSrc->pDrawable == pMask->pDrawable &&
|
||||||
xSrc == xMask && ySrc == yMask &&
|
xSrc == xMask && ySrc == yMask &&
|
||||||
!pMask->componentAlpha)
|
!pMask->componentAlpha && !maskRepeat)
|
||||||
{
|
{
|
||||||
/* source == mask: non-premultiplied data */
|
/* source == mask: non-premultiplied data */
|
||||||
switch (pSrc->format) {
|
switch (pSrc->format) {
|
||||||
|
@ -1108,9 +1107,7 @@ fbComposite (CARD8 op,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* non-repeating source, repeating mask => translucent window */
|
/* non-repeating source, repeating mask => translucent window */
|
||||||
if (maskRepeat &&
|
if (fbCanGetSolid(pMask))
|
||||||
pMask->pDrawable->width == 1 &&
|
|
||||||
pMask->pDrawable->height == 1)
|
|
||||||
{
|
{
|
||||||
if (pSrc->format == PICT_x8r8g8b8 &&
|
if (pSrc->format == PICT_x8r8g8b8 &&
|
||||||
pDst->format == PICT_x8r8g8b8 &&
|
pDst->format == PICT_x8r8g8b8 &&
|
||||||
|
@ -1127,9 +1124,7 @@ fbComposite (CARD8 op,
|
||||||
}
|
}
|
||||||
else /* no mask */
|
else /* no mask */
|
||||||
{
|
{
|
||||||
if (srcRepeat &&
|
if (fbCanGetSolid(pSrc))
|
||||||
pSrc->pDrawable->width == 1 &&
|
|
||||||
pSrc->pDrawable->height == 1)
|
|
||||||
{
|
{
|
||||||
/* no mask and repeating source */
|
/* no mask and repeating source */
|
||||||
switch (pSrc->format) {
|
switch (pSrc->format) {
|
||||||
|
|
47
fb/fbpict.h
47
fb/fbpict.h
|
@ -30,6 +30,13 @@
|
||||||
|
|
||||||
#include "renderedge.h"
|
#include "renderedge.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#define INLINE __inline__
|
||||||
|
#else
|
||||||
|
#define INLINE
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
|
#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
|
||||||
#define FbIntDiv(a,b) (((CARD16) (a) * 255) / (b))
|
#define FbIntDiv(a,b) (((CARD16) (a) * 255) / (b))
|
||||||
|
|
||||||
|
@ -67,6 +74,40 @@
|
||||||
#define Green(x) (((x) >> 8) & 0xff)
|
#define Green(x) (((x) >> 8) & 0xff)
|
||||||
#define Blue(x) ((x) & 0xff)
|
#define Blue(x) ((x) & 0xff)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if the fbComposeGetSolid can be used to get a single solid
|
||||||
|
* color representing every source sampling location of the picture.
|
||||||
|
*/
|
||||||
|
static INLINE Bool
|
||||||
|
fbCanGetSolid(PicturePtr pict)
|
||||||
|
{
|
||||||
|
if (pict->pDrawable == NULL ||
|
||||||
|
pict->pDrawable->width != 1 ||
|
||||||
|
pict->pDrawable->height != 1)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (pict->repeat != RepeatNormal)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
switch (pict->format) {
|
||||||
|
case PICT_a8r8g8b8:
|
||||||
|
case PICT_x8r8g8b8:
|
||||||
|
case PICT_a8b8g8r8:
|
||||||
|
case PICT_x8b8g8r8:
|
||||||
|
case PICT_r8g8b8:
|
||||||
|
case PICT_b8g8r8:
|
||||||
|
case PICT_r5g6b5:
|
||||||
|
case PICT_b5g6r5:
|
||||||
|
return TRUE;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define fbCanGetSolid(pict) \
|
||||||
|
(pict->pDrawable != NULL && pict->pDrawable->width == 1 && pict->pDrawable->height == 1)
|
||||||
|
|
||||||
#define fbComposeGetSolid(pict, bits, fmt) { \
|
#define fbComposeGetSolid(pict, bits, fmt) { \
|
||||||
FbBits *__bits__; \
|
FbBits *__bits__; \
|
||||||
FbStride __stride__; \
|
FbStride __stride__; \
|
||||||
|
@ -322,12 +363,6 @@
|
||||||
#define FASTCALL
|
#define FASTCALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#define INLINE __inline__
|
|
||||||
#else
|
|
||||||
#define INLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _FbComposeData {
|
typedef struct _FbComposeData {
|
||||||
CARD8 op;
|
CARD8 op;
|
||||||
PicturePtr src;
|
PicturePtr src;
|
||||||
|
|
Loading…
Reference in New Issue