[PATCH] damageext: Make DamageSubtract actually work for raw-rects mode

Adam Jackson ajax at redhat.com
Wed Jul 15 12:17:48 PDT 2015


On Tue, 2015-07-14 at 16:58 -0700, Eric Anholt wrote:
> Adam Jackson <ajax at redhat.com> writes:
> 
> > I swear this has come up before, but I have no idea why this isn't
> > implemented.  This basically makes the raw mode unusable since you can
> > never subtract damage, your only recourse is to destroy the old damage
> > and make a new one as the old one saturates in area.  I can't see a good
> > reason to leave it broken.
> 
> We report the new rectangles arriving, regardless:
> 
>     case DamageReportRawRegion:
>         RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion);
>         (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure);

Oh, true. Okay, so not useless, just inconsistent with the spec. That's
familiar territory at least.

> The question I have is why we're bothering to track pDamage->damage for
> RawRegion.  It was introduced in:
> 
> commit 454cb0802eec3c2c2cdbcc17971bced868462b83
> Author: Maarten Maathuis <madman2003 at gmail.com>
> Date:   Fri Aug 29 22:28:02 2008 +0200
> 
>     damage: DamageReportRawRegion should set pDamage->damage
>     
>     - I found no evidence in the protocol, that it should be differently from all the other modes.
>     - It seems to have been like this from day 1.
>     - If anyone has evidence to the contrary, please enlighten me.
> 
> but I don't see any reason for it.

I can't see one either really.  shadowfb and misprite create raw
listeners, but they only ever refer to the current region and never
bother with the tracked damage.  sna does currently look like it relies
on the damage being tracked, but the report hook has all the callee
needs to track damage itself.

> The point of RawRectangles is that you don't need to do any subtraction
> stuff because the client is just processing the rects as they come in.
> I think we should clarify the spec that Subtract is pointless for
> RawRectangles.

Yeah, I can't even really see a point in the "subtract for an event"
behavior for raw rects.  Any remnant region from the subtract would
already be in flight to you, I don't know why you'd want to hear about
it twice.

- ajax


More information about the xorg-devel mailing list