Commit Graph

108 Commits

Author SHA1 Message Date
Adam Jackson 8171d4c2d6 render: Store and use all 16bpc of precision for solid pixels (v2.1)
This plumbs the full width color for solid pictures through to fb, exa,
and glamor. External drivers and acceleration code may wish to make a
similar change for sufficiently new servers.

v2: Don't break ABI (Michel Dänzer)
v2.1: Use the (correct) full color in fb too (Michel Dänzer)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-26 16:46:34 -05:00
Arcady Goldmints-Orlov fbac451724 Fix alphamap interactions with wfb
Set a destructor function on pixman images and call fbFinishAccess()
from there, rather than directly from free_pixman_pict(). This ensures
that fbFinishAccess() gets called even if pixman still has a reference
to the image after free_pixman_pict(), as is the case for alphamaps.

[ajax: Squash an unused variable warning in the non-wfb build]

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Arcady Goldmints-Orlov <arcadyg@nvidia.com>
Reviewed-by: Søren Sandmann <ssp@redhat.com>
2015-09-29 12:21:34 -04:00
Alan Coopersmith 70f4a0e6bd Convert exa & fb to new *allocarray functions
v2: fixup whitespace

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-04-21 16:58:07 -07:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Adam Jackson 266cd552bd fb: Hide glyph implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:48 -04:00
Adam Jackson a198373685 fb: FB_SHIFT is 5 (and FB_UNIT is 32)
The other paths don't build or work, PCI and other buses are almost
always 32 bit data paths, and X doesn't really support pixels bigger
than that anyway.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:37 -04:00
Adam Jackson 462bf87c4d render: Always store client clip as a region
This does have one semantic change.  FixesCreateRegionFromPicture used to
throw BadImplementation if you tried to create a region from a picture
with no client clip.  I changed that to BadMatch here since that more
honestly describes what's going on.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-23 14:35:49 -07:00
Peter Harris 983e30361f fb: Fix origin of source picture in fbGlyphs
If a source picture doesn't repeat and a mask format is specified, the
incorrect calulation of the origin of the glyphs caused the glyphs to
not be drawn at all.

Noticed when running gtk-demo from RHEL 6.5 and selecting "Rotated
Text".

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>

/* Test for this bug

cc -std=c99 -o glyph glyph.c `pkg-config --cflags --libs xcb-render`

*/

// 16 x 16 pictfmt_a8 "glyph"
static const char glyph[] = {
    0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff,
    0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0,
    0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0,
    0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0,
    0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0xff, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0xff, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0, 0,
    0, 0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0, 0,
    0, 0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0, 0,
    0, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0,
    0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff,
};

static struct {
    uint8_t len;
    uint8_t pad[3];
    uint16_t deltax, deltay;
    uint8_t glyph;
    uint8_t pad2[3];
} elt = { len:1, glyph:1, deltax:WIN_SIZE/2 - GLYPH_SIZE/2, deltay:WIN_SIZE/2 - GLYPH_SIZE/2 };

int main(int argc, char *argv[])
{
    int screen;
    xcb_connection_t *c = xcb_connect(NULL, &screen);
    if (!c || xcb_connection_has_error(c)) {
	fprintf(stderr, "Cannot open default display \"%s\"\n", getenv("DISPLAY"));
	return EXIT_FAILURE;
    }

    // Find root window and depth
    const xcb_setup_t *setup = xcb_get_setup(c);
    if (screen >= setup->roots_len)
	screen = 0;
    xcb_screen_iterator_t si = xcb_setup_roots_iterator(setup);
    for (int i=0; i < screen; i++)
	xcb_screen_next(&si);
    xcb_window_t root = si.data->root;
    uint8_t depth = si.data->root_depth;
    xcb_visualid_t visual = si.data->root_visual;

    // Find picture formats
    xcb_render_query_pict_formats_reply_t *qpf;
    qpf = xcb_render_query_pict_formats_reply(c, xcb_render_query_pict_formats(c), NULL);
    if (!qpf) {
	fprintf(stderr, "Cannot query RENDER picture formats\n");
	return EXIT_FAILURE;
    }
    xcb_render_pictformat_t fmt_a8 = 0;
    xcb_render_pictforminfo_iterator_t pfi =
        xcb_render_query_pict_formats_formats_iterator(qpf);
    for (int i = 0; i < xcb_render_query_pict_formats_formats_length(qpf); i++) {

        if (pfi.data->depth == 8 &&
                pfi.data->type == XCB_RENDER_PICT_TYPE_DIRECT &&
                pfi.data->direct.alpha_mask == 0xFF) {
            fmt_a8 = pfi.data->id;
            break;
        }
        xcb_render_pictforminfo_next(&pfi);
    }
    if (!fmt_a8) {
	fprintf(stderr, "Cannot find a8 RENDER picture format\n");
	return EXIT_FAILURE;
    }

    xcb_render_pictformat_t fmt_visual = 0;
    xcb_render_pictscreen_iterator_t psi =
        xcb_render_query_pict_formats_screens_iterator(qpf);
    for (int i = 0; i < xcb_render_query_pict_formats_screens_length(qpf); i++) {
        xcb_render_pictdepth_iterator_t pdi =
            xcb_render_pictscreen_depths_iterator(psi.data);
        for (int j = 0; i < xcb_render_pictscreen_depths_length(psi.data); i++) {
            xcb_render_pictvisual_iterator_t pvi =
                xcb_render_pictdepth_visuals_iterator(pdi.data);
            for (int k = 0; k < xcb_render_pictdepth_visuals_length(pdi.data); i++) {
                if (pvi.data->visual == visual) {
                    fmt_visual = pvi.data->format;
                    goto found_visual;
                }
                xcb_render_pictvisual_next(&pvi);
            }
            xcb_render_pictdepth_next(&pdi);
        }
        xcb_render_pictscreen_next(&psi);
    }
found_visual:
    if (!fmt_visual) {
	fprintf(stderr, "Cannot find visual RENDER picture format\n");
	return EXIT_FAILURE;
    }

    xcb_render_glyphset_t glyphset = xcb_generate_id(c);
    xcb_render_create_glyph_set(c, glyphset, fmt_a8);
    uint32_t glyph_ids[] = {1};
    xcb_render_add_glyphs(c, glyphset, 1, glyph_ids,
            &(xcb_render_glyphinfo_t){width:GLYPH_SIZE, height:GLYPH_SIZE}, sizeof(glyph), glyph);

    // Create window, pixmap, and gc
    xcb_window_t window = xcb_generate_id(c);
    uint32_t list[] = { si.data->black_pixel, XCB_EVENT_MASK_EXPOSURE };
    xcb_create_window(c, XCB_COPY_FROM_PARENT, window, root, 0, 0, WIN_SIZE, WIN_SIZE,
	    0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT,
	    XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, list);
    xcb_map_window(c, window);
    xcb_render_picture_t winpic = xcb_generate_id(c);
    xcb_render_create_picture(c, winpic, window, fmt_visual, 0, NULL);

    xcb_pixmap_t pixmap = xcb_generate_id(c);
    xcb_create_pixmap(c, depth, pixmap, window, GLYPH_SIZE, GLYPH_SIZE);
    xcb_render_picture_t pixpic = xcb_generate_id(c);
    xcb_render_create_picture(c, pixpic, pixmap, fmt_visual, 0, NULL);
    xcb_render_fill_rectangles(c, XCB_RENDER_PICT_OP_SRC, pixpic,
            (xcb_render_color_t){green:0xFFFF, alpha:0xFFFF}, 1,
            &(xcb_rectangle_t){width:GLYPH_SIZE, height:GLYPH_SIZE} );

    xcb_flush(c);
    for (xcb_generic_event_t *ev = xcb_wait_for_event(c); ev; ev = xcb_wait_for_event(c)) {
	int type = ev->response_type;
	free(ev);
	if (type == XCB_EXPOSE) {
            xcb_clear_area(c, 0, window, 0, 0, 0, 0);
            xcb_render_composite_glyphs_8(c, XCB_RENDER_PICT_OP_SRC, pixpic, winpic, fmt_a8,
                    glyphset, 0, 0, sizeof(elt), (uint8_t *)&elt);
            xcb_flush(c);
        }
    }

    return EXIT_SUCCESS;
}
2014-04-21 20:48:34 -07:00
Keith Packard 3c2c59eed3 fb: Publish fbGlyphs and fbUnrealizeGlyph
This lets other code jump directly into the fb code for fallbacks

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-03 13:07:51 -07:00
Peter Hutterer 7b79a2e4a1 fb: drop two unneeded shadowing variables
fbpict.c: In function 'fbGlyphs':
fbpict.c:188:6: warning: declaration of 'x' shadows a previous local
[-Wshadow]
fbpict.c:111:9: warning: shadowed declaration is here [-Wshadow]
fbpict.c:188:9: warning: declaration of 'y' shadows a previous local
[-Wshadow]
fbpict.c:111:12: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2013-02-15 11:58:24 +10:00
Søren Sandmann Pedersen 9cbcb5bd6a Use new pixman_glyph_cache_t API that will be in pixman 0.28.0
This new API allows glyphs to be cached in a data structure in pixman,
and entire glyph strings to be composited in one go.

Also bump pixman dependency to 0.27.2.

Results from the cairo peformance test suite running against Xvfb with
a screen size of 1680x1050@32bpp:

Speedups
========
 xlib          firefox-talos-gfx  12416.63 -> 3603.93   3.45x speedup
██▌
 xlib          xfce4-terminal-a1   1727.57 -> 1048.85:  1.65x speedup
▋
 xlib                  evolution   1370.49 -> 869.34:   1.58x speedup
▋
 xlib         gnome-terminal-vim   1832.83 -> 1251.94:  1.46x speedup
▌
 xlib                    poppler   1519.70 -> 1204.05:  1.26x speedup
▎
 xlib       firefox-planet-gnome   6982.55 -> 5598.16:  1.25x speedup
▎
 xlib                  ocitysmap   1142.77 -> 1071.53:  1.07x speedup
▏

No slowdowns were reported.

Results of x11perf -aa10text:

Before:

      8000000 reps @   0.0007 msec (1450000.0/sec)
      8000000 reps @   0.0007 msec (1460000.0/sec)
      8000000 reps @   0.0007 msec (1460000.0/sec)
      8000000 reps @   0.0007 msec (1470000.0/sec)
      8000000 reps @   0.0007 msec (1480000.0/sec)
     40000000 trep @   0.0007 msec (1460000.0/sec)

After:

     32000000 reps @   0.0002 msec (4910000.0/sec)
     32000000 reps @   0.0002 msec (4830000.0/sec)
     32000000 reps @   0.0002 msec (4890000.0/sec)
     32000000 reps @   0.0002 msec (4830000.0/sec)
     32000000 reps @   0.0002 msec (4900000.0/sec)
    160000000 trep @   0.0002 msec (4870000.0/sec)

Version 2: Destroy the glyph cache at server regen time

Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
2012-10-25 11:37:50 -04:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Kirill Elagin 5361121339 Fix server crash due to invalid images
See https://bugs.freedesktop.org/show_bug.cgi?id=39383

Signed-off-by: Kirill Elagin <kirelagin@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-04 20:18:17 -07:00
Jeremy Huddleston fd086f87cd fb: Silence warnings when building with clang
fbpict.c:163:8: warning: implicit conversion from enumeration type 'PictFormatShort' (aka 'enum _PictFormatShort') to different enumeration
      type 'pixman_format_code_t' [-Wconversion]
        pict->format,
        ~~~~~~^~~~~~

fbbltone.c:486:2: warning: shift result (281474959933440) requires 49 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
        C2_24( 0, 0), C2_24 ( 1, 0), C2_24 ( 2, 0), C2_24 ( 3, 0),
        ^~~~~~~~~~~~
fbbltone.c:474:6: note: instantiated from:
     SelMask24(b,1,r))
     ^
fbbltone.c:429:46: note: instantiated from:
                                                    ^
fbbltone.c:427:18: note: instantiated from:
                      0xffffff << Mask24Check(x,r)) : 0)
                      ~~~~~~~~ ^

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-25 10:45:34 -07:00
Søren Sandmann Pedersen 57b35adaed Remove geometry arguments from miSourceValidate()
The only user of the geometry coordinates is the software sprite code,
which uses them to remove the pointer whenever the window beneath is
being used as a source. However, using Window pictures as a source is
extremely rare (let alone *partial* windows), so there is no harm done
in just validating all of the drawable.

Additionally, the miSourceValidate() function was buggy in at least
three respects:

(a) It added drawable->{x,y} before calling down, which is wrong since
    the misprite code already adds them in its check. (Alternatively,
    the misprite code is wrong, but there are actual users who would
    notice if that code was broken).

(b) It didn't account for the width of the interpolation filter, so if
    the Picture had a bilinear or convolution filter, the edges
    surrounding the source area would not be validated.

(c) It didn't validate alpha maps.

Finally, computing the bounding box of the transform on every
composite request was a real performance issue in pixman, so
presumably it could be one here as well.

This patch changes miSourceValidate() to simply validate all of the
underlying drawable.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-03-14 13:57:42 -04:00
Søren Sandmann Pedersen 566f1931ee Move miTriangles to fb as fbTriangles()
The fb version simply calls the new pixman_composite_triangles(). This
allows us to get rid of miCreateAlphaPicture().

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-02-26 13:58:54 -05:00
Søren Sandmann Pedersen 788ccb9a8b Move miTrapezoids() into fb as fbTrapezoids()
The main consumer of trapezoids, cairo, is using the Trapezoids
request, which is currently implemented in the miTrapezoids()
function. That function splits the request into smaller bits and calls
lower level functions such as AddTrap.

By moving the implementation of the whole request into fb, we can
instead call pixman_composite_trapezoids() to do the whole request in
one step.

There are no callers of miTrapezoids in any of the open source
drivers, although exa and uxa have their own copies of the function.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-02-26 13:58:53 -05:00
Søren Sandmann Pedersen 0dae479e16 fb: Delete fbCompositeGeneral()
This function was an unused and trivial wrapper around fbComposite().

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-02 03:36:45 -04:00
Søren Sandmann Pedersen 6118346d64 Delete unused fbWalkCompositeRegion()
This function has not been used since most of the compositing was
moved to pixman. The only reason it has survived until now is that it
was part of the server ABI.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-01 22:04:49 -04:00
Keith Packard ff70848e62 Don't let alpha maps recurse in fb. Bug 23581.
Recursive alpha maps (where one picture's alpha map is set to a
picture with an external alpha map) would be all fine and dandy,
except for the case where the client constructs a loop. Detecting this
case when setting the alpha map values would be difficult as any time
an alpha map is set, the server would have to check for the looping
case.

Instead, a far simpler fix is to simply disallow recursive alpha maps
in the rendering code, the Render spec is ambiguous in this area and
allows us to to ignore the recursive case.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-08-10 09:18:22 -07:00
Keith Packard 2dc138922b Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05 18:59:00 -07:00
Keith Packard 28b7b2b8d0 unifdef -B -DRENDER to always include RENDER code
This patch was created with:

git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done

Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19 09:26:10 -07:00
Pierre-Loup A. Griffais a6bd5d2e48 Fix source pictures getting random transforms after 2d6a8f6683.
*xoff and *yoff were uninitialized for source-only pictures.x

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27 14:03:03 -08:00
Keith Packard a72c65e917 fb: Adjust transform or composite coordinates for pixman operations
Windows (or even pixmaps, in some cases) may not sit at the origin of
the containing pixmap, so any coordinates relative to the drawable
must be adjusted. For destinations and untransformed sources, the
operation coordinates are adjusted. For transformed sources, the
transform matrix is adjusted.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:45 -08:00
Keith Packard 6133505297 Revert "Fix clipping when windows are used as sources"
This reverts commit e9aa61e9f0.

Conflicts:

	fb/fbpict.c

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:22 -08:00
Keith Packard 071b3c1810 Revert "Use IncludeInferiors when copying windows before compositing."
This reverts commit 7c7f0c2c6a.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:14 -08:00
Keith Packard 8e640d6b13 Revert "Reserve space for two GC values in copy_drawable()."
This reverts commit 08df24555c.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:51:00 -08:00
Keith Packard 0816c5482c Revert "fb: Don't crash if copy_drawable() returns NULL."
This reverts commit 66a9616d64.

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11 11:49:38 -08:00
Michel Dänzer 66a9616d64 fb: Don't crash if copy_drawable() returns NULL.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24634 .

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-30 08:37:12 -08:00
Soeren Sandmann f450be9992 Add xoff and yoff to drawable->x and drawable->y in create_bits_picture().
These are 0, except when the drawable is a redirected window.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-14 16:09:37 +10:00
Soren Sandmann Pedersen 08df24555c Reserve space for two GC values in copy_drawable().
Pointed out by Pierre Willenbrock.
2009-07-09 17:23:04 -04:00
Søren Sandmann Pedersen 7c7f0c2c6a Use IncludeInferiors when copying windows before compositing.
Part of bug 22484.
2009-07-06 13:06:50 -04:00
Søren Sandmann Pedersen e9aa61e9f0 Fix clipping when windows are used as sources
The new clipping rules:

	- client clips happen after transformation
	- pixels unavailable due to the hierarchy are undefined

The first one is implemented in pixman; the second one is realized by
making a copy of window sources (to prevent out-of-bounds access).
2009-06-18 12:36:11 -04:00
Søren Sandmann Pedersen ebfd6688d1 Make compositing with transformed windows work again.
The coordinate translation was broken in pretty much every way
imaginable.
2009-05-10 23:27:56 -04:00
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Paulo Cesar Pereira de Andrade d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Peter Hutterer e73a03d589 fb: shut up two compiler warnings. 2008-05-20 10:54:32 +09:30
Søren Sandmann Pedersen 943dd6ad99 Revert "Revert "Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fix"" since the pixman changes have been pushed now.
This reverts commit 57f7f2a532.
2007-08-23 12:15:03 -04:00
Eric Anholt 57f7f2a532 Revert "Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fix"
The corresponding pixman code hasn't been pushed, so revert until the code is
ready.

This reverts commit 53941c8e68.
2007-08-22 09:02:03 -07:00
Søren Sandmann Pedersen 53941c8e68 Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fix
bug 11620 (reported by Jens Stroebel.
2007-08-21 14:26:14 -04:00
Aaron Plattner 6a32a96d8d stride is in FbBits-sized chunks, but xoff is not.
Fixes corruption problems with composite rendering to redirected windows in
depth 16.
2007-08-16 17:43:29 -07:00
Aaron Plattner 74feba4d77 Don't unwrap too early in libwfb for Composite.
Don't call fbFinishWrap until the pixman_image_t that stores the pointer is
actually freed.  This prevents corruption or crashes caused by accessing a
wrapped pointer after the wrapping is torn down.
2007-08-06 14:22:49 -07:00
Alan Coopersmith 7c0ca27f6d "fbpict.c", line 215: void function cannot return value 2007-07-11 17:16:59 -07:00
Søren Sandmann Pedersen eb2d7fe02f Replace fbFillmmx() with pixman_fill() and remove fbmmx.[ch] 2007-06-11 22:43:01 -04:00
Søren Sandmann Pedersen 54e023cec0 Don't pass regions to pixman_image_composite() anymore. 2007-06-11 09:43:15 -04:00
Benjamin Herrenschmidt e5ce982381 Include pixman.h from fb.h or compile of some files will fail
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2007-06-03 09:40:37 +10:00
Soren Sandmann Pedersen 9d87ef4e0d - Make image_from_pict() non-static
- Delete fbedge.c and fbedgeimp.h
- Use pixman_rasterize_edges() in fbtrap.c
2007-05-23 15:50:25 -04:00
Soren Sandmann Pedersen 3ba3ede9bb Add missing offsets for window coordinates - reported by Colin Harrison 2007-05-23 12:56:04 -04:00
Soren Sandmann Pedersen 56fd927155 Remove fast path code from fbpict.c
Remove the various fast path functions from fbpict, and instead use
pixman_image_composite().
2007-05-21 20:00:25 -04:00
Soren Sandmann Pedersen 756acea23a Use pixman_image_set_indexed() to make 8 bit work 2007-05-18 14:06:21 -04:00