[PATCH] Track damage for fbTrapezoids() and fbTriangles().
Maarten Maathuis
madman2003 at gmail.com
Mon Mar 28 11:48:36 PDT 2011
On Mon, Mar 28, 2011 at 4:40 PM, Soeren Sandmann <sandmann at cs.au.dk> wrote:
> Michel Dänzer <michel at daenzer.net> writes:
>
>> On Mon, 2011-03-28 at 11:47 -0400, Søren Sandmann wrote:
>>> From: Søren Sandmann Pedersen <ssp at redhat.com>
>>>
>>> These calls no longer go through the miComposite(),
>>
>> I can't seem to find any reference to miComposite() in the Git history.
>> Do you mean miTriangles()?
>
> I meant CompositePicture() actually (which then calls
> screen->Composite()). This is the only composite call that is wrapped by
> damage.
>
>>> so damage was no longer generated for them. This patch simply damages
>>> the entire destination clip region.
>>
>> [...]
>>
>>> @@ -117,6 +118,8 @@ fbShapes (CompositeShapesFunc composite,
>>> {
>>> pixman_format_code_t format;
>>>
>>> + DamageRegionAppend (pDst->pDrawable, pDst->pCompositeClip);
>>> +
>>> if (!maskFormat)
>>> {
>>> int i;
>>
>> Don't you also need to call DamageRegionProcessPending() after the
>> operation?
>
> Yes, I think I do, thanks. New version below.
I think you should process pending after doing the rendering operation.
>
> Soren.
>
>
> From cbffefdd08bac059f7d9b2ca102f31282aabc5fe Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp at redhat.com>
> Date: Mon, 28 Mar 2011 11:38:11 -0400
> Subject: [PATCH] Track damage for fbTrapezoids() and fbTriangles().
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> These calls no longer go through the CompositePicture() hook, so
> damage was no longer generated for them. This patch simply damages the
> entire destination clip region.
>
> It would be possible to generate tighter damage for certain operators
> such as Over and Add, where blank source pixels have no effect on the
> destination, but given that virtually all trapezoid rendering takes
> place on pixmaps, it's unlikely that anybody would actually benefit
> from this optimization, and the miTrapezoidBounds function did
> sometimes show up on profiles, probably because it does several
> divisions per trapezoid.
>
> V2: Call DamageRegionProcessPending() - pointed out by Michel Dänzer.
>
> Signed-off-by: Søren Sandmann <ssp at redhat.com>
> ---
> fb/fbtrap.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fb/fbtrap.c b/fb/fbtrap.c
> index 2554fcc..1880a24 100644
> --- a/fb/fbtrap.c
> +++ b/fb/fbtrap.c
> @@ -29,6 +29,7 @@
> #include "picturestr.h"
> #include "mipict.h"
> #include "fbpict.h"
> +#include "damage.h"
>
> void
> fbAddTraps (PicturePtr pPicture,
> @@ -117,6 +118,9 @@ fbShapes (CompositeShapesFunc composite,
> {
> pixman_format_code_t format;
>
> + DamageRegionAppend (pDst->pDrawable, pDst->pCompositeClip);
> + DamageRegionProcessPending (pDst->pDrawable);
> +
> if (!maskFormat)
> {
> int i;
> --
> 1.7.4
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
--
Far away from the primal instinct, the song seems to fade away, the
river get wider between your thoughts and the things we do and say.
More information about the xorg-devel
mailing list