summaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27Indentation: Change '& stuff' to '&stuff'Daniel Stone1-6/+6
If the typedef wasn't perfect, indent would get confused and change: foo = (SomePointlessTypedef *) &stuff[1]; to: foo = (SomePointlessTypedef *) & stuff[1]; Fix this up with a really naïve sed script, plus some hand-editing to change some false positives in XKB back. Signed-off-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit ab3a815a75ab5695753fa37a98b0ea5293d4cb91)
2012-03-27Introduce a consistent coding styleKeith Packard15-5232/+4829
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> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
2012-01-13render: don't bother with animated cursors on floating slaves (#39989)Peter Hutterer1-0/+3
X.Org Bug 39989 <http://bugs.freedesktop.org/show_bug.cgi?id=39989> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-12CompareISOLatin1Lowered: constify argumentsAlan Coopersmith1-1/+2
Allows callers to avoid deconstifying arguments when calling, fixing gcc warning: filter.c: In function 'PictureGetFilterId': filter.c:59:2: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-23Fix gcc -Wwrite-strings warnings in various extensionsAlan Coopersmith2-6/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Remove redundant redeclarations of functions in the same header fileAlan Coopersmith1-3/+0
Exposed by recent addition of -Wredundant-decls to default CWARNFLAGS Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-23Convert ProcRenderQueryFilters to use memcpy instead of strncpyAlan Coopersmith1-2/+2
We just got the string length with strlen, might as well use it to copy the whole string quickly instead of checking each character a second time to see if it's 0 or not. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-18render: export TriStrip and TriFan to the driversChris Wilson4-32/+114
Rather than perform an intermediate copy and expand the strip and the fan into a triangle list (thereby tripling the number of edges that the driver needs to process), allow the backend to hook directly into the appropriate Composite function. In order to extend the PictureScreen, without needlessly bumping the ABI, we move the existing copy implementations to mipict.c and assign those by default. To notify the ddx that the new entry points are available, we introduce PICTURE_SCREEN_VERSION. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
2011-09-23Unconditionally #include <stdint.h>Alan Coopersmith1-4/+0
The more recent inclusions of this file haven't been checking for HAVE_STDINT_H, so might as well make the older ones consistent. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-09-21Cast char* buffers to swap functionsMatt Turner1-3/+3
Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-09-21Use internal temp variable for swap macrosMatt Turner1-238/+204
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-08-31render: Replace __inline with inline.Cyril Brulebois1-5/+1
Also remove traces from the past. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-04-27Merge remote-tracking branch 'jeremyhu/master'Keith Packard1-1/+1
2011-04-25render: Silence warnings when building with clangJeremy Huddleston1-1/+1
picture.c:351:37: error: implicit conversion from 'unsigned int' to 'CARD16' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Werror,-Wconstant-conversion] pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ... fatal error: too many errors emitted, stopping now [-ferror-limit=] Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Suggested-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-22render: Remove unused TriStrip and TriFan typedefsSøren Sandmann Pedersen1-18/+0
Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22render: Remove unused fields in the source picture structsSøren Sandmann Pedersen2-38/+0
The fields class, stopRange, colorTable and colorTableSize are not used by any current code. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-22render: Delete PictureGradientColor()Søren Sandmann Pedersen2-50/+0
PictureGradientColor(), INTERPOLATE_PIXEL_256() and premultiply() are not used by anything. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-04-07dix: don't free stranger pointers inside AllocARGBCursorTiago Vignatti1-3/+9
This seems a good convention to follow: if pointers are allocate outside a given function, then free there as well when a failure occurs. AllocARGBCursor and its callers were mixing up the freeing of resources and causing a particular double free inside TileScreenSaver (srcbits and mskbits). Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
2011-04-04render: fix memory leaks in ProcRenderCompositeGlyphsTiago Vignatti1-13/+12
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Soren Sandmann <ssp@redhat.com>
2011-03-28render: warning fixesAdam Jackson1-3/+0
picture.c: In function 'CompositeTriStrip': picture.c:1777:25: warning: unused variable 'ps' picture.c: In function 'CompositeTriFan': picture.c:1807:16: warning: unused variable 'pScreen' Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-23Merge remote-tracking branch 'airlied/xinerama-cleanup'Keith Packard1-20/+5
2011-03-14Remove TriStrip and TriFan from the picture screenSøren Sandmann Pedersen4-48/+0
These functions no longer go through the screen vtable, so remove them and fix up the various wrappers. Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-03-14Absorb miTriStrip() into CompositeTriStrip()Søren Sandmann Pedersen2-23/+18
There is no need to virtualize this function that nobody cares about. Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-03-14Absorb miTriFan() into CompositeTriFan()Søren Sandmann Pedersen2-25/+19
There is no need to virtualize this function that nobody cares about. Reviewed-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-03-14Remove geometry arguments from miSourceValidate()Søren Sandmann Pedersen2-52/+17
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-10panoramiX: consolidate common id assignment code.Dave Airlie1-20/+5
This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first element and is a common idiom throughout panoramiX code. It then adds a new inline function to hide id assignment to a panoramiX resource and cleans up lots of common repeated code. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-08xinerama: Use RESTYPE consistentlyAdam Jackson1-1/+1
No functional change Reviewed-by: Soren Sandmann <ssp@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-26Move miTriangles to fb as fbTriangles()Søren Sandmann Pedersen4-126/+1
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-26Move miTrapezoids() into fb as fbTrapezoids()Søren Sandmann Pedersen3-72/+1
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-01-05Add subWindowMode parameter to SourceValidateVille Syrjälä1-1/+2
Pass the subWindowMode from the GC/source Picture to SourceValidate. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-31render: Enable animated cursor block handler only when neededPauli Nieminen1-5/+13
Calling BlockHandlers takes some time for each iteration in main loop which adds up quickly over multiple request. To reduce the round-trip costs to xserver BlockHandlers should be registered only when required. AnimCurScreenBlockHandler is the first victim for this optimization. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31render: Don't filter 0 return from GetTimeInMillisPauli Nieminen1-2/+6
In animate cursor block handler code assumes GetTimeInMillis returns always nonzero value. This isn't true when time wraps around. To prevent any problems in case GetTimeInMillis would return zero use activeDevice variable to track if we have received time. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-27Render: Fix 'comparing between distinct pointer types' warningDaniel Stone1-2/+4
Add the appropriate casts so that gcc shuts up, even if it doesn't matter. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-12-07Move inclusion of panoramiX headers to top of render.cAlan Coopersmith1-3/+5
Fixes compiler error from Sun compilers due to _X_EXPORT declaration being included after the unlabeled version: "../Xext/panoramiXsrv.h", line 29: redeclaration must have the same or more restrictive linker scoping: XRT_PICTURE Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-02render: Fix byteswapping of gradient stopsAndrea Canciani1-2/+2
The function swapStops repeatedly swaps the color components as CARD16, but incorrectly steps over them as if they were CARD32. This causes half of the stops not to be swapped at all and some unrelated data be swapped instead. Signed-off-by: Andrea Canciani <ranma42@gmail.com> Reviewed-by: Soren Sandmann <sandmann@daimi.au.dk> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-30render: Reshuffle and cull dead field from GlyphSetRecAdam Jackson1-2/+1
Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-30render: repack PictureRecAdam Jackson2-12/+9
Eliminate the unused dither field, move filter and stateChanges into the bitfield, and reorder elements to pack holes on LP64. sizeof(PictureRec) ILP32 LP64 before: 84 152 after: 72 120 Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-10Merge remote branch 'whot/for-keith'Keith Packard2-15/+6
2010-11-11Remove superfluous if(p!=NULL) checks around free(p); p=NULL;Cyril Brulebois2-15/+6
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) { - free(E); ( - E = NULL; | - E = 0; ) - } + free(E); + E = NULL; Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-01render: Delete renderedge.[ch]Søren Sandmann Pedersen3-199/+2
The functions in these files have not been used since trap rasterization was moved to pixman. They survived until now to preserve 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-08-19render: Bounds check for nglyphs in ProcRenderAddGlyphs (#28801)Adam Jackson1-0/+8
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-15/+15
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-06Place glyph privates at correct location within the allocate storageKeith Packard1-5/+5
A glyph allocation consists of : GlyphRec numScreens * PicturePtr glyph privates Tell the dix private bits to start past the picture pointers. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov1-2/+1
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-05Clean up after removal of screen parameters from region macros.Jamey Sharp2-7/+4
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-06-05Make GetPictureScreenIfSet check if Render is runningKeith Packard1-1/+1
This macro originally checked to see if the Render screen private index had been allocated. When the privates were changed the first time, there wasn't any need to check as dixLookupPrivate would simply return NULL in that case. Now that we care, check to see if the key has been initialized before asking for the value. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard6-45/+46
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05Rename region macros to eliminate screen argumentKeith Packard3-32/+32
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-03Move each screen's x/y origin into ScreenRec.Jamey Sharp1-22/+22
Many references to the dixScreenOrigins array already had the corresponding screen pointer handy, which meant they usually looked like "dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead of keeping this information in a parallel array simplifies those expressions, and eliminates a MAXSCREENS-sized array. Since dix declared the dixScreenOrigins array, I figure allocating a screen private for these values is overkill. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03Delete panoramiXdataPtr: it's redundant.Jamey Sharp1-22/+22
This eliminates a dynamically-allocated MAXSCREENS-sized array. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)