Bug 92 - XftDrawSetClipRectangles early return
Summary: XftDrawSetClipRectangles early return
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xft (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Keith Packard
QA Contact:
Depends on:
Reported: 2003-06-08 10:38 UTC by Owen Taylor
Modified: 2011-10-15 17:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Proposed patch (699 bytes, patch)
2003-06-08 10:39 UTC, Owen Taylor
no flags Details | Splinter Review

Description Owen Taylor 2003-06-08 10:38:00 UTC
      * Check for quick exit
    if (draw->clip_type == XftClipTypeRectangles &&
        !memcmp (XftClipRects (draw->clip.rect), rects, n * sizeof (XRectangle)))

Exists without regard to n, xOrigin, yOrigin. This in, among other
things, means that setting to an empty region (n == 0) always 
returns immediately.

The attached (untested) patch should fix the problem ... the

 (n == 0 || (draw->clip.rect.xOrigin == xOrigin &&
             draw->clip.rect.yOrigin == yOrigin))

counts on xOrigin/yOrigin being irrelevant for empty clips
and on there being no way to change the clip region/rects
without setting the origin.
Comment 1 Owen Taylor 2003-06-08 10:39:24 UTC
Created attachment 47 [details] [review]
Proposed patch
Comment 2 Keith Packard 2003-06-08 12:41:56 UTC
I'll take a look at the patch tomorrow.
Comment 3 Keith Packard 2003-06-17 10:38:00 UTC
I've applied a working version of the submitted patch.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.