| @@ -439,36 +439,40 @@ ExaSrcValidate(DrawablePtr pDrawable, | | | @@ -439,36 +439,40 @@ ExaSrcValidate(DrawablePtr pDrawable, |
439 | int y, | | 439 | int y, |
440 | int width, | | 440 | int width, |
441 | int height, | | 441 | int height, |
442 | unsigned int subWindowMode) | | 442 | unsigned int subWindowMode) |
443 | { | | 443 | { |
444 | ScreenPtr pScreen = pDrawable->pScreen; | | 444 | ScreenPtr pScreen = pDrawable->pScreen; |
445 | ExaScreenPriv(pScreen); | | 445 | ExaScreenPriv(pScreen); |
446 | PixmapPtr pPix = exaGetDrawablePixmap (pDrawable); | | 446 | PixmapPtr pPix = exaGetDrawablePixmap (pDrawable); |
447 | BoxRec box; | | 447 | BoxRec box; |
448 | RegionRec reg; | | 448 | RegionRec reg; |
449 | RegionPtr dst; | | 449 | RegionPtr dst; |
450 | int xoff, yoff; | | 450 | int xoff, yoff; |
451 | | | 451 | |
| | | 452 | if (pExaScr->srcPix == pPix) |
| | | 453 | dst = &pExaScr->srcReg; |
| | | 454 | else if (pExaScr->maskPix == pPix) |
| | | 455 | dst = &pExaScr->maskReg; |
| | | 456 | else |
| | | 457 | return; |
| | | 458 | |
452 | exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff); | | 459 | exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff); |
453 | | | 460 | |
454 | box.x1 = x + xoff; | | 461 | box.x1 = x + xoff; |
455 | box.y1 = y + yoff; | | 462 | box.y1 = y + yoff; |
456 | box.x2 = box.x1 + width; | | 463 | box.x2 = box.x1 + width; |
457 | box.y2 = box.y1 + height; | | 464 | box.y2 = box.y1 + height; |
458 | | | 465 | |
459 | dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg : | | | |
460 | &pExaScr->maskReg; | | | |
461 | | | | |
462 | RegionInit(®, &box, 1); | | 466 | RegionInit(®, &box, 1); |
463 | RegionUnion(dst, dst, ®); | | 467 | RegionUnion(dst, dst, ®); |
464 | RegionUninit(®); | | 468 | RegionUninit(®); |
465 | | | 469 | |
466 | if (pExaScr->SavedSourceValidate) { | | 470 | if (pExaScr->SavedSourceValidate) { |
467 | swap(pExaScr, pScreen, SourceValidate); | | 471 | swap(pExaScr, pScreen, SourceValidate); |
468 | pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode); | | 472 | pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode); |
469 | swap(pExaScr, pScreen, SourceValidate); | | 473 | swap(pExaScr, pScreen, SourceValidate); |
470 | } | | 474 | } |
471 | } | | 475 | } |
472 | | | 476 | |
473 | static Bool | | 477 | static Bool |
474 | ExaPrepareCompositeReg(ScreenPtr pScreen, | | 478 | ExaPrepareCompositeReg(ScreenPtr pScreen, |
| @@ -497,37 +501,40 @@ ExaPrepareCompositeReg(ScreenPtr pScree | | | @@ -497,37 +501,40 @@ ExaPrepareCompositeReg(ScreenPtr pScree |
497 | | | 501 | |
498 | | | 502 | |
499 | RegionNull(®ion); | | 503 | RegionNull(®ion); |
500 | | | 504 | |
501 | if (pSrc->pDrawable) { | | 505 | if (pSrc->pDrawable) { |
502 | pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); | | 506 | pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); |
503 | RegionNull(&pExaScr->srcReg); | | 507 | RegionNull(&pExaScr->srcReg); |
504 | srcReg = &pExaScr->srcReg; | | 508 | srcReg = &pExaScr->srcReg; |
505 | pExaScr->srcPix = pSrcPix; | | 509 | pExaScr->srcPix = pSrcPix; |
506 | if (pSrc != pDst) | | 510 | if (pSrc != pDst) |
507 | RegionTranslate(pSrc->pCompositeClip, | | 511 | RegionTranslate(pSrc->pCompositeClip, |
508 | -pSrc->pDrawable->x, | | 512 | -pSrc->pDrawable->x, |
509 | -pSrc->pDrawable->y); | | 513 | -pSrc->pDrawable->y); |
510 | } | | 514 | } else |
| | | 515 | pExaScr->srcPix = NULL; |
511 | | | 516 | |
512 | if (pMask && pMask->pDrawable) { | | 517 | if (pMask && pMask->pDrawable) { |
513 | pMaskPix = exaGetDrawablePixmap(pMask->pDrawable); | | 518 | pMaskPix = exaGetDrawablePixmap(pMask->pDrawable); |
514 | RegionNull(&pExaScr->maskReg); | | 519 | RegionNull(&pExaScr->maskReg); |
515 | maskReg = &pExaScr->maskReg; | | 520 | maskReg = &pExaScr->maskReg; |
| | | 521 | pExaScr->maskPix = pMaskPix; |
516 | if (pMask != pDst && pMask != pSrc) | | 522 | if (pMask != pDst && pMask != pSrc) |
517 | RegionTranslate(pMask->pCompositeClip, | | 523 | RegionTranslate(pMask->pCompositeClip, |
518 | -pMask->pDrawable->x, | | 524 | -pMask->pDrawable->x, |
519 | -pMask->pDrawable->y); | | 525 | -pMask->pDrawable->y); |
520 | } | | 526 | } else |
| | | 527 | pExaScr->maskPix = NULL; |
521 | | | 528 | |
522 | RegionTranslate(pDst->pCompositeClip, | | 529 | RegionTranslate(pDst->pCompositeClip, |
523 | -pDst->pDrawable->x, | | 530 | -pDst->pDrawable->x, |
524 | -pDst->pDrawable->y); | | 531 | -pDst->pDrawable->y); |
525 | | | 532 | |
526 | pExaScr->SavedSourceValidate = ExaSrcValidate; | | 533 | pExaScr->SavedSourceValidate = ExaSrcValidate; |
527 | swap(pExaScr, pScreen, SourceValidate); | | 534 | swap(pExaScr, pScreen, SourceValidate); |
528 | ret = miComputeCompositeRegion (®ion, pSrc, pMask, pDst, | | 535 | ret = miComputeCompositeRegion (®ion, pSrc, pMask, pDst, |
529 | xSrc, ySrc, xMask, yMask, | | 536 | xSrc, ySrc, xMask, yMask, |
530 | xDst, | | 537 | xDst, |
531 | yDst, | | 538 | yDst, |
532 | width, height); | | 539 | width, height); |
533 | swap(pExaScr, pScreen, SourceValidate); | | 540 | swap(pExaScr, pScreen, SourceValidate); |