Bug 92

Summary: XftDrawSetClipRectangles early return
Product: xorg Reporter: Owen Taylor <otaylor>
Component: Lib/XftAssignee: Keith Packard <keithp>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Proposed patch none

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
check:

 (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.