[Mesa-dev] [PATCH] SwapBuffersRegionNOK: invert rectangles on y axis

Matt Turner mattst88 at gmail.com
Wed Sep 19 09:01:28 PDT 2012


On Wed, Sep 19, 2012 at 7:46 AM, Robert Bragg <robert at sixbynine.org> wrote:
> On Tue, Sep 18, 2012 at 5:35 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> On Tue, Sep 18, 2012 at 8:10 AM, Robert Bragg <robert at sixbynine.org> wrote:
>>> From: Robert Bragg <robert at linux.intel.com>
>>>
>>> The EGL_NOK_swap_region2 spec states that the rectangles are specified
>>> with a bottom-left origin within a surface coordinate space also with a
>>> bottom left origin, so this patch ensures the rectangles are flipped
>>> before passing them on to dri2_copy_region.
>>> ---
>>>  src/egl/drivers/dri2/platform_x11.c |    3 +--
>>>  1 files changed, 1 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
>>> index 2533774..44e4373 100644
>>> --- a/src/egl/drivers/dri2/platform_x11.c
>>> +++ b/src/egl/drivers/dri2/platform_x11.c
>>> @@ -777,10 +777,9 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
>>>     if (numRects > (int)ARRAY_SIZE(rectangles))
>>>        return dri2_copy_region(drv, disp, draw, dri2_surf->region);
>>>
>>> -   /* FIXME: Invert y here? */
>>>     for (i = 0; i < numRects; i++) {
>>>        rectangles[i].x = rects[i * 4];
>>> -      rectangles[i].y = rects[i * 4 + 1];
>>> +      rectangles[i].y = dri2_surf->base.Height - rects[i * 4 + 1] - rects[i * 4 + 3];
>>>        rectangles[i].width = rects[i * 4 + 2];
>>>        rectangles[i].height = rects[i * 4 + 3];
>>>     }
>>> --
>>> 1.7.7.6
>>>
>>> _______________________________________________
>>> mesa-dev mailing list
>>> mesa-dev at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>> Does this fix the egl-nok-texture-from-pixmap piglit test?
>>
>> I notice that when I run it it says:
>>
>> EGL_Y_INVERTED_NOK: FALSE
>> Probe at (50,50)
>>   Expected: 0.500000 0.000000 0.500000 1.000000
>>   Observed: 0.000000 0.000000 0.000000 1.000000
>
> No, I'm afraid it doesn't interact with this so this extension and
> this test continue to fail for me with or without this patch.
>
> kind regards,
> - Robert

Too bad. In that case, it's probably a good idea to add a new piglit
test for this.


More information about the mesa-dev mailing list