summaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)AuthorFilesLines
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)
2010-06-03Move each screen's root-window pointer into ScreenRec.Jamey Sharp1-1/+1
Many references to the WindowTable array already had the corresponding screen pointer handy, which meant they usually looked like "WindowTable[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 uses this data, a screen private entry isn't appropriate. xf86-video-dummy currently uses WindowTable, so it needs to be updated to reflect this change. 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-05-19Merge remote branch 'vignatti/animcursor-state-fix'Keith Packard1-47/+19
2010-05-19Add typed resource-lookup errors for non-core resource types.Jamey Sharp3-19/+30
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19Return an appropriately-typed error from dixLookupResourceByType.Jamey Sharp2-2/+1
Rather than always returning BadValue, associate an error status like BadWindow with a resource type like RT_WINDOW, and return the appropriate one for the requested type. This patch only touches the core protocol resource types. Others still return BadValue and need to be mapped appropriately. dixLookupResourceByType can now return BadImplementation, if the caller asked for a resource type that has not been allocated in the server. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19render: set anim cursor state for pointer enabled devices onlyTiago Vignatti1-41/+18
The structure containing the state of animated cursor was amended within SpriteInfoRec, removing all previously privates logic to keep such state. API change: It was removed MAXDEVICES dependency \o/ Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-18render: remove unused animcursor fields from private recTiago Vignatti1-4/+0
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-18render: removed unused macro from animcursorTiago Vignatti1-2/+1
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-15Check pixmap allocation return value when creating glyphsKeith Packard1-0/+7
The driver may decide that the pixmap is too large or something and fail to allocate a pixmap; not checking would lead to a segfault. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-13Eliminate boilerplate around client->noClientException.Jamey Sharp1-30/+20
Just let Dispatch() check for a noClientException, rather than making every single dispatch procedure take care of it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13Quit using clientErrorValue in dix/colormap.c.Jamey Sharp1-1/+1
And that's it! No more clientErrorValue kludge. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace dixChangeGC with calls directly to the right variant.Jamey Sharp1-2/+2
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.Jamey Sharp1-11/+12
The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-12Kill ChangeGC in favor of dixChangeGC.Jamey Sharp1-2/+2
This doesn't change any behavior, but it isn't clear whether NullClient is correct in all cases. As ajax says, > For most of these changes, I think it's correct to use NullClient, > since they are server-initiated changes and should not fail for (eg) > xace reasons. ... At any rate, you're certainly not changing any > semantics by leaving them all as NullClient, so this patch can't be > more wrong than before. The call in CreateGC is particularly questionable. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov8-124/+124
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-07Return BadPicture, not BadPixmap, if alpha-map is invalid.Jamey Sharp1-1/+1
I believe this is what was intended. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07VERIFY_PICTURE always returns BadPicture. Don't bother specifying.Jamey Sharp2-90/+49
Same goes for VERIFY_ALPHA, VERIFY_XIN_PICTURE, and VERIFY_XIN_ALPHA. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-30Delete loop with no effect from GlyphUninitKeith Packard1-9/+0
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-03-24Fix crash when all glyphs of a given depth are freed, but not all glyphsetsPeter Harris1-0/+3
This is how the crash can be triggered with only two clients on the system: Client A: (already running) Client B: Connect Client B: CreateGlyphSet(depthN) Client A: Disconnect Server: free globalGlyphs(depthN) Client B: AddGlyphs(depthN) Server: SEGV This crash was introduced with the FindGlyphsByHash function in 516b96387b0e57b524a37a96da22dbeeeb041712. Before that revision, ResizeGlyphSet was always called before FindGlyphRef, which would re-create globalGlyphs(depthN) if necessary. X.Org Bug 20718 <http://bugs.freedesktop.org/show_bug.cgi?id=20718> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Harris <pharris@opentext.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-29RENDER: Fix gradient and solid fill pictures with Xinerama, and misc cleanupRobert Morell1-0/+137
If these aren't wrapped, then procs that are wrapped (such as RenderChangePicture) will fail in Xinerama when they see the resource type of a picture created through one of these interfaces is PictureType and not XRT_PICTURE like those allocated via RenderCreatePicture. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-29Render: Fix request size verificationRobert Morell1-2/+2
RenderSetPictureClipRectangles and the Xinerama version of RenderChangePicture were using the wrong structure types for request size verification. Signed-off-by: Robert Morell <rmorell@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18Add type name argument to CreateNewResourceTypeAlan Coopersmith2-12/+5
Convert all calls of CreateNewResourceType to pass name argument Breaks DIX ABI. ABI versions bumped: Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18Ensure all resource types created have names registeredAlan Coopersmith1-0/+4
Calls RegisterResourceName to record the type name for use by X-Resource, XACE/SELinux/XTsol, and DTrace. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-10-15Move SHA1 computation from render/glyph.c to os/Julien Cristau1-27/+9
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Rémi Cardona <remi@gentoo.org>
2009-10-06render: Fix clip region translation in miClipPictureSrc().Kim Woelders1-4/+4
Signed-off-by: Kim Woelders <kim@woelders.dk> Reviewed-by: Soren Sandmann Pedersen <sandmann@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-10-01render: Fix crash in RenderAddGlyphs (#23645)Peter Hutterer1-1/+5
This patch fixes two bugs: size is calculated as glyph height * padded_width. If the client submits garbage, this may get above INT_MAX, resulting in a negative size if size is unsigned. The sanity checks don't trigger for negative sizes and the server goes and writes into random memory locations. If the client submits glyphs with a width or height 0, the destination pixmap is NULL, causing a null-pointer dereference. Since there's nothing to composite if the width/height is 0, we might as well skip the whole thing anyway. Tested with Xvfb, Xephyr and Xorg. X.Org Bug 23645 <http://bugs.freedesktop.org/show_bug.cgi?id=23645> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-10-01render: set the glyph picture to NULL by default.Peter Hutterer1-26/+31
In a follow-up patch we may have glyphs with a NULL picture. To cope with that, always set the pictures for glyphs to NULL at creation time and cope with cleaning up such glyphs. Also, since compositing a NULL source doesn't do a lot anyway, skip trying to do so. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2009-09-28render: Plug a memory leak in AddGlyph. (#23286)Peter Hutterer1-21/+21
AddGlyph was missing the FreePicture() call that DeleteGlyph used, resulting in a memory leak when more than one Glyph was added in a RenderAddGlyphs request. Since the code in AddGlyph and DeleteGlyph is identical, move into a static function to avoid such mistakes in the future. X.Org Bug 23286 <http://bugs.freedesktop.org/show_bug.cgi?id=23286>
2009-09-23render: Don't add b8g8r8x8 format for depth 24.Michel Dänzer1-4/+1
The components are required to be packed in the bottom of the pixel, so this format can't fit in depth 24. Also fix up a comment for the addition of BGRA formats.
2009-09-21input: define server-supported protocol versions in one single file.Peter Hutterer1-3/+4
include/protocol-versions.h specifies each extension version as supported by the server and sent back on the wire to the client. This fixes up several issues with the server potentially reporting a higher version of the protocol if recompiled against a newer version of the protocol. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Rémi Cardona <remi@gentoo.org> Acked-by: Julien Cristau <jcristau@debian.org>
2009-09-21render: reply with the server or client version, whichever is lower.Peter Hutterer1-2/+12
Protocol requires that the lower of [server version, client version] is returned to the client. The other part of the issue discussed in reply to [1] remains. [1] http://lists.freedesktop.org/archives/xorg-devel/2009-September/001990.html Reported-by: Julien Cristau Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-08-28render: delete unused headers declarationTiago Vignatti1-11/+0
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-08-28render: AnimCurInit and AnimCursorCreate shouldn't be _X_EXPORTTiago Vignatti1-2/+2
Pointed by Peter Hutterer on xorg-devel ml. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2009-08-13Add 4 missing 10bpc picture formats to the server format list.Pierre-Loup A. Griffais2-0/+16
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2009-08-04Add support for RENDER BGRA formats.Michel Dänzer2-1/+38
2009-07-15Render: Add support for the PDF blend mode operators.Fredrik Höglund1-0/+2
2009-07-14render: switch to byte counting functionsPeter Hutterer1-8/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-18Fix miComputeCompositeRegion() to follow new clip rules.Søren Sandmann Pedersen1-24/+16
Ignore the hierarchy clip, and always apply any client clip after transformation and repeating.
2009-05-27Fix alpha map computation in miComputeCompositeRegion()Søren Sandmann Pedersen1-4/+4
According to the RENDER spec, the origin of the alpha map is interpreted relative to the origin of the drawable of the image, not the origin of the drawable of the alpha map. This commit fixes that and adds an alpha-test.c test program. The only use of alpha maps I have been able to find is in Qt and they don't use a non-zero alpha origin.
2009-05-10Make compositing with transformed windows work again.Søren Sandmann Pedersen1-2/+2
The coordinate translation was broken in pretty much every way imaginable.