X pixel model (Was: Re: Xi2 clipping details)
simon.thum at gmx.de
Mon Sep 14 04:24:08 PDT 2009
I noticed a small glitch in current Xi2 sub-pixel handling. Right now,
root coordinates may become negative by half a pixel. Essentially,
sub-pixels need to be respected in clipping. Below is a incomplete fix I
However, it occurred to me there is a broader issue beneath: that of a
proper pixel model. Whatever we cook up here shouldn't be at odds with
core rendering(?), probably XRender, maybe composite, you name it.
Obvious choices (to me) are:
1) let a hypothetical 1x1 screen have [0..1[ coordinate space.
2) let a hypothetical 2x2 screen have [0..1] coordinate space,
neglecting the border half-pixel. This maintains the relation between
screen resolution and input coordinate space distance.
3) <fill in>
To me 1 sounds sane, 2 sounds compatible.
2) is codified below, but only for valuators; I guess we need to
properly confine screen limits as well. And it's untested, merely for
discussion. I'm also unsure about it since it modifies clipValuators(),
which is called every now and then.
Peter Hutterer wrote:
> On Sat, Sep 12, 2009 at 07:18:35PM +0200, Simon Thum wrote:
>> Hi Peter,
>> this is just a little reminder about a small issue I've noticed, since
>> 7.5 is on its way.
>> I've just checked against latest build and I still see that phenomenon:
>> EVENT type 6
>> device: 6 (6)
>> detail: 0
>>>>> root: -0.36/82.33
>> event: 7.64/64.33
>> modifiers: locked 0 latched 0 base 0 effective: 0
>> group: locked 0 latched 0 base 0 effective: 0
>> valuators: 0.64 81.33
>> windows: root 0x6c event 0x2a00001 child 0x0
>> Of course, event coords may also become negative due to subpixel
>> handling. If this could happen before, then ignore this email, but I
>> guess that will cause some headaches.
> event coords are allowed negative, they are relative to the window's origin
> after all. Root window coordinates must never be negative, AFAIK. So you're
> correct - this is a bug.
>> Basic problem: A hypothetical 1x1 window, which only contains the
>> integer coordinate (0,0) could now get everything from (-0.5, -0.5) to
>> (0.5, 0.5). In a sense, it got bigger.
>> I've searched the Xi spec a bit but I couldn't find any clarification
>> about the issue (the one in the X.org repo). I think it should at least
>> be stated explicitly in specs. If you somehow wanna fix it before 7.5,
>> I've attached a small but incomplete patch which lays out what I think
>> is proper clipping wrt subpixels.
> Patch looks good, what's the incomplete part about it? I'm happy to push
> this once you claim you have a complete patch :)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the xorg-devel