From e399356ed17baf7b50da393a3f13682b01bd14a9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 2 Feb 2015 15:04:01 +0100 Subject: drop .original files from the current code base --- .../Xserver/render/renderedge.c.NX.original | 202 --------------------- .../Xserver/render/renderedge.c.X.original | 201 -------------------- 2 files changed, 403 deletions(-) delete mode 100644 nx-X11/programs/Xserver/render/renderedge.c.NX.original delete mode 100644 nx-X11/programs/Xserver/render/renderedge.c.X.original (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/renderedge.c.NX.original b/nx-X11/programs/Xserver/render/renderedge.c.NX.original deleted file mode 100644 index f095038e5..000000000 --- a/nx-X11/programs/Xserver/render/renderedge.c.NX.original +++ /dev/null @@ -1,202 +0,0 @@ -/* - * $Id: renderedge.c,v 1.4 2005/07/03 07:02:08 daniels Exp $ - * - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor(y); - - f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f > Y_FRAC_LAST(n)) - { - f = Y_FRAC_FIRST(n); - i += xFixed1; - } - return (i | f); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor (y); - - f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f < Y_FRAC_FIRST(n)) - { - f = Y_FRAC_LAST(n); - i -= xFixed1; - } - return (i | f); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - xFixed_48_16 ne; - - e->x += n * e->stepx; - - ne = e->e + n * (xFixed_48_16) e->dx; - - if (n >= 0) - { - if (ne > 0) - { - int nx = (ne + e->dy - 1) / e->dy; - e->e = ne - nx * (xFixed_48_16) e->dy; - e->x += nx * e->signdx; - } - } - else - { - if (ne <= -e->dy) - { - int nx = (-ne) / e->dy; - e->e = ne + nx * (xFixed_48_16) e->dy; - e->x -= nx * e->signdx; - } - } -} - -/* - * A private routine to initialize the multi-step - * elements of an edge structure - */ -static void -_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p) -{ - xFixed stepx; - xFixed_48_16 ne; - - ne = n * (xFixed_48_16) e->dx; - stepx = n * e->stepx; - if (ne > 0) - { - int nx = ne / e->dy; - ne -= nx * e->dy; - stepx += nx * e->signdx; - } - *dx_p = ne; - *stepx_p = stepx; -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - xFixed dx, dy; - - e->x = x_top; - e->e = 0; - dx = x_bot - x_top; - dy = y_bot - y_top; - e->dy = dy; - e->dx = 0; - if (dy) - { - if (dx >= 0) - { - e->signdx = 1; - e->stepx = dx / dy; - e->dx = dx % dy; - e->e = -dy; - } - else - { - e->signdx = -1; - e->stepx = -(-dx / dy); - e->dx = -dx % dy; - e->e = 0; - } - - _RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small); - _RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big); - } - RenderEdgeStep (e, y_start - y_top); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - xFixed x_off_fixed = IntToxFixed(x_off); - xFixed y_off_fixed = IntToxFixed(y_off); - xPointFixed *top, *bot; - - if (line->p1.y <= line->p2.y) - { - top = &line->p1; - bot = &line->p2; - } - else - { - top = &line->p2; - bot = &line->p1; - } - RenderEdgeInit (e, n, y, - top->x + x_off_fixed, - top->y + y_off_fixed, - bot->x + x_off_fixed, - bot->y + y_off_fixed); -} - diff --git a/nx-X11/programs/Xserver/render/renderedge.c.X.original b/nx-X11/programs/Xserver/render/renderedge.c.X.original deleted file mode 100644 index b4031944d..000000000 --- a/nx-X11/programs/Xserver/render/renderedge.c.X.original +++ /dev/null @@ -1,201 +0,0 @@ -/* - * $Id: renderedge.c,v 1.4 2005/07/03 07:02:08 daniels Exp $ - * - * Copyright © 2004 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor(y); - - f = ((f + Y_FRAC_FIRST(n)) / STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f > Y_FRAC_LAST(n)) - { - f = Y_FRAC_FIRST(n); - i += xFixed1; - } - return (i | f); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - xFixed f = xFixedFrac(y); - xFixed i = xFixedFloor (y); - - f = _div(f - Y_FRAC_FIRST(n), STEP_Y_SMALL(n)) * STEP_Y_SMALL(n) + Y_FRAC_FIRST(n); - if (f < Y_FRAC_FIRST(n)) - { - f = Y_FRAC_LAST(n); - i -= xFixed1; - } - return (i | f); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - xFixed_48_16 ne; - - e->x += n * e->stepx; - - ne = e->e + n * (xFixed_48_16) e->dx; - - if (n >= 0) - { - if (ne > 0) - { - int nx = (ne + e->dy - 1) / e->dy; - e->e = ne - nx * (xFixed_48_16) e->dy; - e->x += nx * e->signdx; - } - } - else - { - if (ne <= -e->dy) - { - int nx = (-ne) / e->dy; - e->e = ne + nx * (xFixed_48_16) e->dy; - e->x -= nx * e->signdx; - } - } -} - -/* - * A private routine to initialize the multi-step - * elements of an edge structure - */ -static void -_RenderEdgeMultiInit (RenderEdge *e, int n, xFixed *stepx_p, xFixed *dx_p) -{ - xFixed stepx; - xFixed_48_16 ne; - - ne = n * (xFixed_48_16) e->dx; - stepx = n * e->stepx; - if (ne > 0) - { - int nx = ne / e->dy; - ne -= nx * e->dy; - stepx += nx * e->signdx; - } - *dx_p = ne; - *stepx_p = stepx; -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - xFixed dx, dy; - - e->x = x_top; - e->e = 0; - dx = x_bot - x_top; - dy = y_bot - y_top; - e->dy = dy; - if (dy) - { - if (dx >= 0) - { - e->signdx = 1; - e->stepx = dx / dy; - e->dx = dx % dy; - e->e = -dy; - } - else - { - e->signdx = -1; - e->stepx = -(-dx / dy); - e->dx = -dx % dy; - e->e = 0; - } - - _RenderEdgeMultiInit (e, STEP_Y_SMALL(n), &e->stepx_small, &e->dx_small); - _RenderEdgeMultiInit (e, STEP_Y_BIG(n), &e->stepx_big, &e->dx_big); - } - RenderEdgeStep (e, y_start - y_top); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - xFixed x_off_fixed = IntToxFixed(x_off); - xFixed y_off_fixed = IntToxFixed(y_off); - xPointFixed *top, *bot; - - if (line->p1.y <= line->p2.y) - { - top = &line->p1; - bot = &line->p2; - } - else - { - top = &line->p2; - bot = &line->p1; - } - RenderEdgeInit (e, n, y, - top->x + x_off_fixed, - top->y + y_off_fixed, - bot->x + x_off_fixed, - bot->y + y_off_fixed); -} - -- cgit v1.2.3 From 6c820648ba4be98c94f61516e83f13edf5ed98db Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Tue, 28 Oct 2014 10:30:04 +0100 Subject: render: check request size before reading it [CVE-2014-8100 1/2] Otherwise we may be reading outside of the client request. v2: backport to nx-libs 3.6.x (Mike DePaulo) Signed-off-by: Julien Cristau Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith Conflicts: render/render.c --- nx-X11/programs/Xserver/render/render.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index d25d49756..ebbce813b 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -283,10 +283,11 @@ ProcRenderQueryVersion (ClientPtr client) register int n; REQUEST(xRenderQueryVersionReq); + REQUEST_SIZE_MATCH(xRenderQueryVersionReq); + pRenderClient->major_version = stuff->majorVersion; pRenderClient->minor_version = stuff->minorVersion; - REQUEST_SIZE_MATCH(xRenderQueryVersionReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; -- cgit v1.2.3 From 9c3842a4f72b4cca28ac1d5c14441787c7dd6e6a Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 26 Jan 2014 19:51:29 -0800 Subject: render: unvalidated lengths in Render extn. swapped procs [CVE-2014-8100 2/2] v2: backport to nx-libs 3.6.x (Mike DePaulo) Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer Conflicts: render/render.c --- nx-X11/programs/Xserver/render/render.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index ebbce813b..eee21db84 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -2014,6 +2014,7 @@ SProcRenderQueryVersion (ClientPtr client) { register int n; REQUEST(xRenderQueryVersionReq); + REQUEST_SIZE_MATCH(xRenderQueryVersionReq); swaps(&stuff->length, n); swapl(&stuff->majorVersion, n); @@ -2026,6 +2027,7 @@ SProcRenderQueryPictFormats (ClientPtr client) { register int n; REQUEST(xRenderQueryPictFormatsReq); + REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); swaps(&stuff->length, n); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2035,6 +2037,7 @@ SProcRenderQueryPictIndexValues (ClientPtr client) { register int n; REQUEST(xRenderQueryPictIndexValuesReq); + REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); swaps(&stuff->length, n); swapl(&stuff->format, n); return (*ProcRenderVector[stuff->renderReqType]) (client); @@ -2051,6 +2054,7 @@ SProcRenderCreatePicture (ClientPtr client) { register int n; REQUEST(xRenderCreatePictureReq); + REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); swaps(&stuff->length, n); swapl(&stuff->pid, n); swapl(&stuff->drawable, n); @@ -2065,6 +2069,7 @@ SProcRenderChangePicture (ClientPtr client) { register int n; REQUEST(xRenderChangePictureReq); + REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); swaps(&stuff->length, n); swapl(&stuff->picture, n); swapl(&stuff->mask, n); @@ -2077,6 +2082,7 @@ SProcRenderSetPictureClipRectangles (ClientPtr client) { register int n; REQUEST(xRenderSetPictureClipRectanglesReq); + REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); swaps(&stuff->length, n); swapl(&stuff->picture, n); SwapRestS(stuff); @@ -2088,6 +2094,7 @@ SProcRenderFreePicture (ClientPtr client) { register int n; REQUEST(xRenderFreePictureReq); + REQUEST_SIZE_MATCH(xRenderFreePictureReq); swaps(&stuff->length, n); swapl(&stuff->picture, n); return (*ProcRenderVector[stuff->renderReqType]) (client); @@ -2098,6 +2105,7 @@ SProcRenderComposite (ClientPtr client) { register int n; REQUEST(xRenderCompositeReq); + REQUEST_SIZE_MATCH(xRenderCompositeReq); swaps(&stuff->length, n); swapl(&stuff->src, n); swapl(&stuff->mask, n); @@ -2118,6 +2126,7 @@ SProcRenderScale (ClientPtr client) { register int n; REQUEST(xRenderScaleReq); + REQUEST_SIZE_MATCH(xRenderScaleReq); swaps(&stuff->length, n); swapl(&stuff->src, n); swapl(&stuff->dst, n); @@ -2223,6 +2232,7 @@ SProcRenderCreateGlyphSet (ClientPtr client) { register int n; REQUEST(xRenderCreateGlyphSetReq); + REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); swaps(&stuff->length, n); swapl(&stuff->gsid, n); swapl(&stuff->format, n); @@ -2234,6 +2244,7 @@ SProcRenderReferenceGlyphSet (ClientPtr client) { register int n; REQUEST(xRenderReferenceGlyphSetReq); + REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); swaps(&stuff->length, n); swapl(&stuff->gsid, n); swapl(&stuff->existing, n); @@ -2245,6 +2256,7 @@ SProcRenderFreeGlyphSet (ClientPtr client) { register int n; REQUEST(xRenderFreeGlyphSetReq); + REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); swaps(&stuff->length, n); swapl(&stuff->glyphset, n); return (*ProcRenderVector[stuff->renderReqType]) (client); @@ -2259,6 +2271,7 @@ SProcRenderAddGlyphs (ClientPtr client) void *end; xGlyphInfo *gi; REQUEST(xRenderAddGlyphsReq); + REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); swaps(&stuff->length, n); swapl(&stuff->glyphset, n); swapl(&stuff->nglyphs, n); @@ -2295,6 +2308,7 @@ SProcRenderFreeGlyphs (ClientPtr client) { register int n; REQUEST(xRenderFreeGlyphsReq); + REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); swaps(&stuff->length, n); swapl(&stuff->glyphset, n); SwapRestL(stuff); @@ -2313,7 +2327,8 @@ SProcRenderCompositeGlyphs (ClientPtr client) int size; REQUEST(xRenderCompositeGlyphsReq); - + REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); + switch (stuff->renderReqType) { default: size = 1; break; case X_RenderCompositeGlyphs16: size = 2; break; -- cgit v1.2.3 From 0d56c45a7fc6350879377f368944a5832783764c Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Sun, 29 Mar 2015 04:26:10 +0200 Subject: nx-X11: handle source pictures (those without a Drawable surface) gracefully. Cherry-picked from branch 3.5.0.x. This is basically a merge of the most current xorg-server (1.17.1) code into nx-X11. It makes sure that for source pictures, which do not have a drawable surface, a filter is selected that is supported on the "main" and all other screens. Alternatively, if the requested filter is not available on all screens and the picture is a source picture, this function fails gracefully. Additionally, the ChangePictureFilter hook is now called for non-source pictures. This also needs an implementation in mipict.{c,h}. The default hook does nothing and returns a success value. --- nx-X11/programs/Xserver/render/filter.c | 76 +++++++++++++++++++++-------- nx-X11/programs/Xserver/render/mipict.c | 18 +++++++ nx-X11/programs/Xserver/render/mipict.h | 9 ++++ nx-X11/programs/Xserver/render/picturestr.h | 6 +++ 4 files changed, 89 insertions(+), 20 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 919d599f2..a9028e028 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -271,33 +271,69 @@ PictureResetFilters (ScreenPtr pScreen) int SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams) { - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictFilterPtr pFilter = PictureFindFilter (pScreen, name, len); - xFixed *new_params; - int i; + ScreenPtr pScreen; + PictFilterPtr pFilter; + xFixed *new_params; + int i; + + if (pPicture->pDrawable) { + pScreen = pPicture->pDrawable->pScreen; + } + else { + pScreen = screenInfo.screens[0]; + } + + pFilter = PictureFindFilter (pScreen, name, len); if (!pFilter) - return BadName; - if (pFilter->ValidateParams) - { - if (!(*pFilter->ValidateParams) (pPicture, pFilter->id, params, nparams)) - return BadMatch; + return BadName; + + if (!pPicture->pDrawable) { + int s; + + /* For source pictures, the picture isn't tied to a screen. So, ensure + * that all screens can handle a filter we set for the picture. + */ + for (s = 1; s < screenInfo.numScreens; s++) { + PictFilterPtr pScreenFilter; + + pScreenFilter = PictureFindFilter(screenInfo.screens[s], name, len); + if (!pScreenFilter || pScreenFilter->id != pFilter->id) + return BadMatch; + } } - else if (nparams) - return BadMatch; - if (nparams != pPicture->filter_nparams) - { - new_params = xalloc (nparams * sizeof (xFixed)); - if (!new_params) - return BadAlloc; - xfree (pPicture->filter_params); - pPicture->filter_params = new_params; - pPicture->filter_nparams = nparams; + if (pFilter->ValidateParams) { + if (!(*pFilter->ValidateParams) (pPicture, pFilter->id, params, nparams)) + return BadMatch; + } + else if (nparams) { + return BadMatch; + } + + if (nparams != pPicture->filter_nparams) { + new_params = xalloc (nparams * sizeof (xFixed)); + + if (!new_params && nparams) + return BadAlloc; + xfree (pPicture->filter_params); + pPicture->filter_params = new_params; + pPicture->filter_nparams = nparams; } for (i = 0; i < nparams; i++) - pPicture->filter_params[i] = params[i]; + pPicture->filter_params[i] = params[i]; pPicture->filter = pFilter->id; + + if (pPicture->pDrawable) { + PictureScreenPtr ps = GetPictureScreen (pscreen); + int result; + + result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter, + params, nparams); + + return result; + } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; + return Success; } diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index 81c775832..59707ea70 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -250,6 +250,22 @@ miValidatePicture (PicturePtr pPicture, } } +int +miChangePictureTransform (PicturePtr pPicture, + PictTransform *transform) +{ + return Success; +} + +int +miChangePictureFilter (PicturePtr pPicture, + int filter, + xFixed *params, + int nparams) +{ + return Success; +} + #define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v)) static __inline Bool @@ -611,6 +627,8 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps->InitIndexed = miInitIndexed; ps->CloseIndexed = miCloseIndexed; ps->UpdateIndexed = miUpdateIndexed; + ps->ChangePictureTransform = miChangePictureTransform; + ps->ChangePictureFilter = miChangePictureFilter; /* MI rendering routines */ ps->Composite = 0; /* requires DDX support */ diff --git a/nx-X11/programs/Xserver/render/mipict.h b/nx-X11/programs/Xserver/render/mipict.h index e6e8b70fa..0c2ed04d5 100644 --- a/nx-X11/programs/Xserver/render/mipict.h +++ b/nx-X11/programs/Xserver/render/mipict.h @@ -71,6 +71,15 @@ void miValidatePicture (PicturePtr pPicture, Mask mask); +int +miChangePictureTransform (PicturePtr pPicture, + PictTransform *transform); + +int +miChangePictureFilter (PicturePtr pPicture, + int filter, + xFixed *params, + int nparams); Bool miClipPicture (RegionPtr pRegion, diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 4775793ab..561625766 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -344,7 +344,13 @@ typedef struct _PictureScreen { int nfilterAliases; ChangePictureTransformProcPtr ChangePictureTransform; + + /** + * Called immediately after a picture's transform is changed through the + * SetPictureFilter request. Not called for source-only pictures. + */ ChangePictureFilterProcPtr ChangePictureFilter; + DestroyPictureFilterProcPtr DestroyPictureFilter; TrapezoidsProcPtr Trapezoids; -- cgit v1.2.3 From f1ab3f27bd319d60c63be69aa21c45e2582ebdc9 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Sun, 29 Mar 2015 04:53:52 +0200 Subject: nx-X11: fix typo in previous commit. Cherry-picked from branch 3.5.0.x. --- nx-X11/programs/Xserver/render/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index a9028e028..776bd4237 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -325,7 +325,7 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int pPicture->filter = pFilter->id; if (pPicture->pDrawable) { - PictureScreenPtr ps = GetPictureScreen (pscreen); + PictureScreenPtr ps = GetPictureScreen (pScreen); int result; result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter, -- cgit v1.2.3 From 70b77a0fc329e2e205a596a738c7307d354e7b1c Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 14 Apr 2015 09:24:55 +0200 Subject: library clean-up: Don't build and link libXfont.a anymore. Use system's libXfont shared library and link dynamically. --- nx-X11/programs/Xserver/render/Imakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 0d7ad152f..1331b1fb4 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -27,9 +27,9 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 render.o \ renderedge.o - INCLUDES = -I. -I../include -I../mi -I../../../include/fonts \ + INCLUDES = -I. -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I../Xext + -I../Xext LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryTarget(render,$(OBJS)) -- cgit v1.2.3 From d088698324d5e71cb93ccd429f084729ba07872c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C3=85strand?= Date: Fri, 13 Feb 2009 10:23:28 +0100 Subject: Backport: xserver: Avoid sending uninitialized padding data over the network Signed-off-by: Peter Hutterer --- nx-X11/programs/Xserver/render/render.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index eee21db84..6a65631ea 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -288,6 +288,7 @@ ProcRenderQueryVersion (ClientPtr client) pRenderClient->major_version = stuff->majorVersion; pRenderClient->minor_version = stuff->minorVersion; + memset(&rep, 0, sizeof(xRenderQueryVersionReply)); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -410,6 +411,8 @@ ProcRenderQueryPictFormats (ClientPtr client) reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); if (!reply) return BadAlloc; + memset(reply, 0, rlength); + reply->type = X_Reply; reply->sequenceNumber = client->sequence; reply->length = (rlength - sizeof(xGenericReply)) >> 2; -- cgit v1.2.3 From 68dd0b52e13c844d662192654fb10cb993257a59 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 22 Jun 2015 09:36:08 +0200 Subject: Replace 'pointer' type with 'void *' This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Rebased against NX: Mike Gabriel --- nx-X11/programs/Xserver/render/animcur.c | 8 ++++---- nx-X11/programs/Xserver/render/glyph.c | 24 ++++++++++++------------ nx-X11/programs/Xserver/render/glyphstr.h | 8 ++++---- nx-X11/programs/Xserver/render/miglyph.c | 8 ++++---- nx-X11/programs/Xserver/render/mipict.c | 8 ++++---- nx-X11/programs/Xserver/render/mipict.h | 2 +- nx-X11/programs/Xserver/render/mirect.c | 2 +- nx-X11/programs/Xserver/render/picture.c | 24 ++++++++++++------------ nx-X11/programs/Xserver/render/picturestr.h | 12 ++++++------ nx-X11/programs/Xserver/render/render.c | 26 +++++++++++++------------- 10 files changed, 61 insertions(+), 61 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index e3915b2b8..15293af64 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -95,7 +95,7 @@ int AnimCurGeneration; #define GetAnimCur(c) ((AnimCurPtr) ((c) + 1)) #define GetAnimCurScreen(s) ((AnimCurScreenPtr) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr)) #define GetAnimCurScreenIfSet(s) ((AnimCurScreenPrivateIndex != -1) ? GetAnimCurScreen(s) : NULL) -#define SetAnimCurScreen(s,p) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr = (pointer) (p)) +#define SetAnimCurScreen(s,p) ((s)->devPrivates[AnimCurScreenPrivateIndex].ptr = (void *) (p)) #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) @@ -164,9 +164,9 @@ AnimCurCursorLimits (ScreenPtr pScreen, static void AnimCurScreenBlockHandler (int screenNum, - pointer blockData, - pointer pTimeout, - pointer pReadmask) + void * blockData, + void * pTimeout, + void * pReadmask) { ScreenPtr pScreen = screenInfo.screens[screenNum]; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 9f4d1c87b..900cf9844 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -114,30 +114,30 @@ ResetGlyphSetPrivateIndex (void) } Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr) +_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) { - pointer *new; + void **new; if (n > glyphSet->maxPrivate) { if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) { - new = (pointer *) xrealloc (glyphSet->devPrivates, - (n + 1) * sizeof (pointer)); + glyphSet->devPrivates != (void *)(&glyphSet[1])) { + new = (void **) xrealloc (glyphSet->devPrivates, + (n + 1) * sizeof (void *)); if (!new) return FALSE; } else { - new = (pointer *) xalloc ((n + 1) * sizeof (pointer)); + new = (void **) xalloc ((n + 1) * sizeof (void *)); if (!new) return FALSE; if (glyphSet->devPrivates) memcpy (new, glyphSet->devPrivates, - (glyphSet->maxPrivate + 1) * sizeof (pointer)); + (glyphSet->maxPrivate + 1) * sizeof (void *)); } glyphSet->devPrivates = new; /* Zero out new, uninitialize privates */ while (++glyphSet->maxPrivate < n) - glyphSet->devPrivates[glyphSet->maxPrivate] = (pointer)0; + glyphSet->devPrivates[glyphSet->maxPrivate] = (void *)0; } glyphSet->devPrivates[n] = ptr; return TRUE; @@ -430,14 +430,14 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } size = (sizeof (GlyphSetRec) + - (sizeof (pointer) * _GlyphSetPrivateAllocateIndex)); + (sizeof (void *) * _GlyphSetPrivateAllocateIndex)); glyphSet = xalloc (size); if (!glyphSet) return FALSE; bzero((char *)glyphSet, size); glyphSet->maxPrivate = _GlyphSetPrivateAllocateIndex - 1; if (_GlyphSetPrivateAllocateIndex) - glyphSet->devPrivates = (pointer)(&glyphSet[1]); + glyphSet->devPrivates = (void *)(&glyphSet[1]); if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) { @@ -451,7 +451,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } int -FreeGlyphSet (pointer value, +FreeGlyphSet (void *value, XID gid) { GlyphSetPtr glyphSet = (GlyphSetPtr) value; @@ -479,7 +479,7 @@ FreeGlyphSet (pointer value, xfree (table); if (glyphSet->devPrivates && - glyphSet->devPrivates != (pointer)(&glyphSet[1])) + glyphSet->devPrivates != (void *)(&glyphSet[1])) xfree(glyphSet->devPrivates); xfree (glyphSet); diff --git a/nx-X11/programs/Xserver/render/glyphstr.h b/nx-X11/programs/Xserver/render/glyphstr.h index f4777a248..e9bbd19b0 100644 --- a/nx-X11/programs/Xserver/render/glyphstr.h +++ b/nx-X11/programs/Xserver/render/glyphstr.h @@ -69,12 +69,12 @@ typedef struct _GlyphSet { int fdepth; GlyphHashRec hash; int maxPrivate; - pointer *devPrivates; + void **devPrivates; } GlyphSetRec, *GlyphSetPtr; #define GlyphSetGetPrivate(pGlyphSet,n) \ ((n) > (pGlyphSet)->maxPrivate ? \ - (pointer) 0 : \ + (void *) 0 : \ (pGlyphSet)->devPrivates[n]) #define GlyphSetSetPrivate(pGlyphSet,n,ptr) \ @@ -101,7 +101,7 @@ void ResetGlyphSetPrivateIndex (void); Bool -_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, pointer ptr); +_GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr); Bool GlyphInit (ScreenPtr pScreen); @@ -140,7 +140,7 @@ GlyphSetPtr AllocateGlyphSet (int fdepth, PictFormatPtr format); int -FreeGlyphSet (pointer value, +FreeGlyphSet (void *value, XID gid); diff --git a/nx-X11/programs/Xserver/render/miglyph.c b/nx-X11/programs/Xserver/render/miglyph.c index 237ec13a4..8b046bd46 100644 --- a/nx-X11/programs/Xserver/render/miglyph.c +++ b/nx-X11/programs/Xserver/render/miglyph.c @@ -168,7 +168,7 @@ miGlyphs (CARD8 op, pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, list->format->depth, list->format->depth, - 0, (pointer) (glyph + 1)); + 0, (void *) (glyph + 1)); if (!pPixmap) return; component_alpha = NeedsComponent(list->format->format); @@ -183,7 +183,7 @@ miGlyphs (CARD8 op, } (*pScreen->ModifyPixmapHeader) (pPixmap, glyph->info.width, glyph->info.height, - 0, 0, -1, (pointer) (glyph + 1)); + 0, 0, -1, (void *) (glyph + 1)); pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (maskFormat) { @@ -219,7 +219,7 @@ miGlyphs (CARD8 op, if (pPicture) { FreeScratchPixmapHeader (pPixmap); - FreePicture ((pointer) pPicture, 0); + FreePicture ((void *) pPicture, 0); pPicture = 0; pPixmap = 0; } @@ -237,7 +237,7 @@ miGlyphs (CARD8 op, 0, 0, x, y, width, height); - FreePicture ((pointer) pMask, (XID) 0); + FreePicture ((void *) pMask, (XID) 0); (*pScreen->DestroyPixmap) (pMaskPixmap); } } diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index 59707ea70..cf9c27f01 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -75,18 +75,18 @@ miDestroyPictureClip (PicturePtr pPicture) int miChangePictureClip (PicturePtr pPicture, int type, - pointer value, + void * value, int n) { ScreenPtr pScreen = pPicture->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); - pointer clientClip; + void * clientClip; int clientClipType; switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ - clientClip = (pointer) BITMAP_TO_REGION(pScreen, (PixmapPtr) value); + clientClip = (void *) BITMAP_TO_REGION(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; clientClipType = CT_REGION; @@ -101,7 +101,7 @@ miChangePictureClip (PicturePtr pPicture, clientClipType = CT_NONE; break; default: - clientClip = (pointer) RECTS_TO_REGION(pScreen, n, + clientClip = (void *) RECTS_TO_REGION(pScreen, n, (xRectangle *) value, type); if (!clientClip) diff --git a/nx-X11/programs/Xserver/render/mipict.h b/nx-X11/programs/Xserver/render/mipict.h index 0c2ed04d5..726d8be65 100644 --- a/nx-X11/programs/Xserver/render/mipict.h +++ b/nx-X11/programs/Xserver/render/mipict.h @@ -60,7 +60,7 @@ miDestroyPictureClip (PicturePtr pPicture); int miChangePictureClip (PicturePtr pPicture, int type, - pointer value, + void * value, int n); void diff --git a/nx-X11/programs/Xserver/render/mirect.c b/nx-X11/programs/Xserver/render/mirect.c index 096bb5cb2..c4aeb9aba 100644 --- a/nx-X11/programs/Xserver/render/mirect.c +++ b/nx-X11/programs/Xserver/render/mirect.c @@ -174,7 +174,7 @@ miCompositeRects (CARD8 op, rects++; } - FreePicture ((pointer) pSrc, 0); + FreePicture ((void *) pSrc, 0); bail4: FreeScratchGC (pGC); bail3: diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 3ed60310e..754d468bb 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -114,7 +114,7 @@ PictureDestroyWindow (WindowPtr pWindow) SetPictureWindow(pWindow, pPicture->pNext); if (pPicture->id) FreeResource (pPicture->id, PictureType); - FreePicture ((pointer) pPicture, pPicture->id); + FreePicture ((void *) pPicture, pPicture->id); } pScreen->DestroyWindow = ps->DestroyWindow; ret = (*pScreen->DestroyWindow) (pWindow); @@ -653,7 +653,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) } for (n = 0; n < nformats; n++) { - if (!AddResource (formats[n].id, PictFormatType, (pointer) (formats+n))) + if (!AddResource (formats[n].id, PictFormatType, (void *) (formats+n))) { xfree (formats); return FALSE; @@ -789,11 +789,11 @@ AllocatePicture (ScreenPtr pScreen) { if ( (size = *sizes) ) { - ppriv->ptr = (pointer)ptr; + ppriv->ptr = (void *)ptr; ptr += size; } else - ppriv->ptr = (pointer)NULL; + ppriv->ptr = (void *)NULL; } return pPicture; } @@ -1223,7 +1223,7 @@ ChangePicture (PicturePtr pPicture, if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP) pAlpha->refcnt++; if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); + FreePicture ((void *) pPicture->alphaMap, (XID) 0); pPicture->alphaMap = pAlpha; } } @@ -1295,7 +1295,7 @@ ChangePicture (PicturePtr pPicture, } } error = (*ps->ChangePictureClip)(pPicture, clipType, - (pointer)pPixmap, 0); + (void *)pPixmap, 0); break; } case CPGraphicsExposure: @@ -1395,7 +1395,7 @@ SetPictureClipRects (PicturePtr pPicture, if (!clientClip) return BadAlloc; result =(*ps->ChangePictureClip) (pPicture, CT_REGION, - (pointer) clientClip, 0); + (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; @@ -1439,7 +1439,7 @@ SetPictureClipRegion (PicturePtr pPicture, } result =(*ps->ChangePictureClip) (pPicture, type, - (pointer) clientClip, 0); + (void *) clientClip, 0); if (result == Success) { pPicture->clipOrigin.x = xOrigin; @@ -1511,7 +1511,7 @@ CopyPicture (PicturePtr pSrc, if (pSrc->alphaMap && pSrc->alphaMap->pDrawable->type == DRAWABLE_PIXMAP) pSrc->alphaMap->refcnt++; if (pDst->alphaMap) - FreePicture ((pointer) pDst->alphaMap, (XID) 0); + FreePicture ((void *) pDst->alphaMap, (XID) 0); pDst->alphaMap = pSrc->alphaMap; break; case CPAlphaXOrigin: @@ -1593,7 +1593,7 @@ ValidatePicture(PicturePtr pPicture) } int -FreePicture (pointer value, +FreePicture (void * value, XID pid) { PicturePtr pPicture = (PicturePtr) value; @@ -1613,7 +1613,7 @@ FreePicture (pointer value, PictureScreenPtr ps = GetPictureScreen(pScreen); if (pPicture->alphaMap) - FreePicture ((pointer) pPicture->alphaMap, (XID) 0); + FreePicture ((void *) pPicture->alphaMap, (XID) 0); (*ps->DestroyPicture) (pPicture); (*ps->DestroyPictureClip) (pPicture); if (pPicture->pDrawable->type == DRAWABLE_WINDOW) @@ -1643,7 +1643,7 @@ FreePicture (pointer value, } int -FreePictFormat (pointer pPictFormat, +FreePictFormat (void * pPictFormat, XID pid) { return Success; diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 561625766..96c2b8abc 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -149,7 +149,7 @@ typedef struct _Picture { DDXPointRec alphaOrigin; DDXPointRec clipOrigin; - pointer clientClip; + void *clientClip; Atom dither; @@ -195,7 +195,7 @@ typedef int (*CreatePictureProcPtr) (PicturePtr pPicture); typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture); typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture, int clipType, - pointer value, + void *value, int n); typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture); @@ -374,9 +374,9 @@ extern RESTYPE GlyphSetType; #define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr)) #define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL) -#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p)) +#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (void *) (p)) #define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr)) -#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p)) +#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (void *) (p)) #define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ @@ -516,11 +516,11 @@ void ValidatePicture(PicturePtr pPicture); int -FreePicture (pointer pPicture, +FreePicture (void *pPicture, XID pid); int -FreePictFormat (pointer pPictFormat, +FreePictFormat (void *pPictFormat, XID pid); void diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 6a65631ea..8d644b35e 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -230,8 +230,8 @@ typedef struct _RenderClient { static void RenderClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) + void * closure, + void * data) { NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; ClientPtr pClient = clientinfo->client; @@ -660,7 +660,7 @@ ProcRenderCreatePicture (ClientPtr client) &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1031,7 +1031,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) glyphSet = AllocateGlyphSet (f, format); if (!glyphSet) return BadAlloc; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) + if (!AddResource (stuff->gsid, GlyphSetType, (void *)glyphSet)) return BadAlloc; return Success; } @@ -1056,7 +1056,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) return RenderErrBase + BadGlyphSet; } glyphSet->refcnt++; - if (!AddResource (stuff->gsid, GlyphSetType, (pointer)glyphSet)) + if (!AddResource (stuff->gsid, GlyphSetType, (void *)glyphSet)) return BadAlloc; return client->noClientException; } @@ -1540,7 +1540,7 @@ ProcRenderCreateCursor (ClientPtr client) { (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); } else { @@ -1580,7 +1580,7 @@ ProcRenderCreateCursor (ClientPtr client) 0, 0, 0, 0, 0, 0, width, height); (*pScreen->GetImage) (pPicture->pDrawable, 0, 0, width, height, ZPixmap, - 0xffffffff, (pointer) argbbits); + 0xffffffff, (void *) argbbits); FreePicture (pPicture, 0); } /* @@ -1673,7 +1673,7 @@ ProcRenderCreateCursor (ClientPtr client) GetColor(twocolor[1], 16), GetColor(twocolor[1], 8), GetColor(twocolor[1], 0)); - if (pCursor && AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (pCursor && AddResource(stuff->cid, RT_CURSOR, (void *)pCursor)) return (client->noClientException); return BadAlloc; } @@ -1864,7 +1864,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) if (ret != Success) return ret; - if (AddResource (stuff->cid, RT_CURSOR, (pointer)pCursor)) + if (AddResource (stuff->cid, RT_CURSOR, (void *)pCursor)) return client->noClientException; return BadAlloc; } @@ -1905,7 +1905,7 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1936,7 +1936,7 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1966,7 +1966,7 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } @@ -1995,7 +1995,7 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) + if (!AddResource (stuff->pid, PictureType, (void *)pPicture)) return BadAlloc; return Success; } -- cgit v1.2.3 From 433d8186588698ce6a435fbff5e9d40a37b78be9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 8 Jul 2015 16:16:40 +0200 Subject: Clear header file namespace separation ( vs. ). In the process of building nxagent against more and more system-wide installed X.org libraries, we come to the limit of including structs from this (bundled nx-X11) and that (system-wide X.Org) library. This commit introduces a clear namespace separation of headers provided by nx-X11 and headers provided by X.Org. This approach is only temporary as we want to drop all nx-X11 bundled libraries from nx-libs. However, for a while we need to make this separation clear and also ship some reduced fake X.Org headers that avoid pulling in libX* and libNX_X* symbols at the same time. This patch has been tested on Debian jessie and unstable and requires no overall testing on various distros and distro versions, as we finally will drop all libNX_X* libraries and build against X.org's client libs. For now, this hack eases our development / cleanup process. --- nx-X11/programs/Xserver/render/animcur.c | 4 ++-- nx-X11/programs/Xserver/render/glyphstr.h | 2 +- nx-X11/programs/Xserver/render/render.c | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 15293af64..27e5ab949 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -36,8 +36,8 @@ #include #endif -#include -#include +#include +#include #include "servermd.h" #include "scrnintstr.h" #include "dixstruct.h" diff --git a/nx-X11/programs/Xserver/render/glyphstr.h b/nx-X11/programs/Xserver/render/glyphstr.h index e9bbd19b0..f27a73fbb 100644 --- a/nx-X11/programs/Xserver/render/glyphstr.h +++ b/nx-X11/programs/Xserver/render/glyphstr.h @@ -26,7 +26,7 @@ #ifndef _GLYPHSTR_H_ #define _GLYPHSTR_H_ -#include +#include #include "picture.h" #include "screenint.h" diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 8d644b35e..2dedbc9c4 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -30,8 +30,8 @@ #include #endif -#include -#include +#include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -42,11 +42,11 @@ #include "colormapst.h" #include "extnsionst.h" #include "servermd.h" -#include -#include +#include +#include #include "picturestr.h" #include "glyphstr.h" -#include +#include #include "cursorstr.h" #ifdef EXTMODULE #include "xf86_ansic.h" -- cgit v1.2.3 From 63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 16 Mar 2016 11:11:43 +0100 Subject: Rename region macros to eliminate screen argument This is 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 nx-X11/programs/Xserver tree: $ cd nx-X11/programs/Xserver && ( 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. v1: Keith Packard (X.Org xserver commit: 2dc138922b7588515d5f2447e4b9dcdc0bef15e0) v2: Mike Gabriel (apply fix-region script to nx-libs) --- nx-X11/programs/Xserver/render/mipict.c | 80 ++++++++++++++++---------------- nx-X11/programs/Xserver/render/mirect.c | 4 +- nx-X11/programs/Xserver/render/picture.c | 18 +++---- 3 files changed, 51 insertions(+), 51 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index cf9c27f01..ae7cf5a6d 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -48,7 +48,7 @@ void miDestroyPicture (PicturePtr pPicture) { if (pPicture->freeCompClip) - REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->pCompositeClip); + RegionDestroy(pPicture->pCompositeClip); } void @@ -65,7 +65,7 @@ miDestroyPictureClip (PicturePtr pPicture) * we know we'll never have a list of rectangles, since ChangeClip * immediately turns them into a region */ - REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->clientClip); + RegionDestroy(pPicture->clientClip); break; } pPicture->clientClip = NULL; @@ -86,7 +86,7 @@ miChangePictureClip (PicturePtr pPicture, switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ - clientClip = (void *) BITMAP_TO_REGION(pScreen, (PixmapPtr) value); + clientClip = (void *) BitmapToRegion(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; clientClipType = CT_REGION; @@ -101,7 +101,7 @@ miChangePictureClip (PicturePtr pPicture, clientClipType = CT_NONE; break; default: - clientClip = (void *) RECTS_TO_REGION(pScreen, n, + clientClip = (void *) RegionFromRects(n, (xRectangle *) value, type); if (!clientClip) @@ -162,7 +162,7 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pPicture->pCompositeClip); + RegionDestroy(pPicture->pCompositeClip); pPicture->pCompositeClip = pregWin; pPicture->freeCompClip = freeTmpClip; } @@ -177,30 +177,30 @@ miValidatePicture (PicturePtr pPicture, * clip. if neither is real, create a new region. */ - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); if (freeCompClip) { - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pPicture->clientClip); + RegionIntersect(pregWin, pregWin, pPicture->clientClip); pPicture->pCompositeClip = pregWin; } else { - pPicture->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + pPicture->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); } pPicture->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } @@ -218,31 +218,31 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->freeCompClip) { - REGION_RESET(pScreen, pPicture->pCompositeClip, &pixbounds); + RegionReset(pPicture->pCompositeClip, &pixbounds); } else { pPicture->freeCompClip = TRUE; - pPicture->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1); + pPicture->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pPicture->clientClipType == CT_REGION) { if(pDrawable->x || pDrawable->y) { - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } else { - REGION_TRANSLATE(pScreen, pPicture->pCompositeClip, + RegionTranslate(pPicture->pCompositeClip, -pPicture->clipOrigin.x, -pPicture->clipOrigin.y); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); - REGION_TRANSLATE(pScreen, pPicture->pCompositeClip, + RegionTranslate(pPicture->pCompositeClip, pPicture->clipOrigin.x, pPicture->clipOrigin.y); } } @@ -274,11 +274,11 @@ miClipPictureReg (RegionPtr pRegion, int dx, int dy) { - if (REGION_NUM_RECTS(pRegion) == 1 && - REGION_NUM_RECTS(pClip) == 1) + if (RegionNumRects(pRegion) == 1 && + RegionNumRects(pClip) == 1) { - BoxPtr pRbox = REGION_RECTS(pRegion); - BoxPtr pCbox = REGION_RECTS(pClip); + BoxPtr pRbox = RegionRects(pRegion); + BoxPtr pCbox = RegionRects(pClip); int v; if (pRbox->x1 < (v = pCbox->x1 + dx)) @@ -292,21 +292,21 @@ miClipPictureReg (RegionPtr pRegion, if (pRbox->x1 >= pRbox->x2 || pRbox->y1 >= pRbox->y2) { - REGION_EMPTY(pScreen, pRegion); + RegionEmpty(pRegion); } } - else if (!REGION_NOTEMPTY (pScreen, pClip)) + else if (!RegionNotEmpty(pClip)) return FALSE; else { if (dx || dy) - REGION_TRANSLATE(pScreen, pRegion, -dx, -dy); - if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip)) + RegionTranslate(pRegion, -dx, -dy); + if (!RegionIntersect(pRegion, pRegion, pClip)) return FALSE; if (dx || dy) - REGION_TRANSLATE(pScreen, pRegion, dx, dy); + RegionTranslate(pRegion, dx, dy); } - return REGION_NOTEMPTY(pScreen, pRegion); + return RegionNotEmpty(pRegion); } static __inline Bool @@ -322,13 +322,13 @@ miClipPictureSrc (RegionPtr pRegion, { if (pPicture->clientClipType != CT_NONE) { - REGION_TRANSLATE(pScreen, pRegion, + RegionTranslate(pRegion, dx - pPicture->clipOrigin.x, dy - pPicture->clipOrigin.y); - if (!REGION_INTERSECT (pScreen, pRegion, pRegion, + if (!RegionIntersect(pRegion, pRegion, (RegionPtr) pPicture->clientClip)) return FALSE; - REGION_TRANSLATE(pScreen, pRegion, + RegionTranslate(pRegion, - (dx - pPicture->clipOrigin.x), - (dy - pPicture->clipOrigin.y)); } @@ -432,13 +432,13 @@ miComputeCompositeRegion (RegionPtr pRegion, if (pRegion->extents.x1 >= pRegion->extents.x2 || pRegion->extents.y1 >= pRegion->extents.y2) { - REGION_EMPTY (pDst->pDrawable->pScreen, pRegion); + RegionEmpty(pRegion); return FALSE; } /* clip against dst */ if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } if (pDst->alphaMap) @@ -447,14 +447,14 @@ miComputeCompositeRegion (RegionPtr pRegion, -pDst->alphaOrigin.x, -pDst->alphaOrigin.y)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } } /* clip against src */ if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } if (pSrc->alphaMap) @@ -463,7 +463,7 @@ miComputeCompositeRegion (RegionPtr pRegion, xDst - (xSrc + pSrc->alphaOrigin.x), yDst - (ySrc + pSrc->alphaOrigin.y))) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } } @@ -472,7 +472,7 @@ miComputeCompositeRegion (RegionPtr pRegion, { if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } if (pMask->alphaMap) @@ -481,7 +481,7 @@ miComputeCompositeRegion (RegionPtr pRegion, xDst - (xMask + pMask->alphaOrigin.x), yDst - (yMask + pMask->alphaOrigin.y))) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } } diff --git a/nx-X11/programs/Xserver/render/mirect.c b/nx-X11/programs/Xserver/render/mirect.c index c4aeb9aba..3ce7a7f4c 100644 --- a/nx-X11/programs/Xserver/render/mirect.c +++ b/nx-X11/programs/Xserver/render/mirect.c @@ -65,8 +65,8 @@ miColorRects (PicturePtr pDst, tmpval[4] = pDst->clipOrigin.y - yoff; mask |= GCClipXOrigin|GCClipYOrigin; - pClip = REGION_CREATE (pScreen, NULL, 1); - REGION_COPY (pScreen, pClip, + pClip = RegionCreate(NULL, 1); + RegionCopy(pClip, (RegionPtr) pClipPict->clientClip); (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0); } diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 754d468bb..5d8496610 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1390,7 +1390,7 @@ SetPictureClipRects (PicturePtr pPicture, RegionPtr clientClip; int result; - clientClip = RECTS_TO_REGION(pScreen, + clientClip = RegionFromRects( nRect, rects, CT_UNSORTED); if (!clientClip) return BadAlloc; @@ -1421,14 +1421,14 @@ SetPictureClipRegion (PicturePtr pPicture, if (pRegion) { type = CT_REGION; - clientClip = REGION_CREATE (pScreen, - REGION_EXTENTS(pScreen, pRegion), - REGION_NUM_RECTS(pRegion)); + clientClip = RegionCreate( + RegionExtents(pRegion), + RegionNumRects(pRegion)); if (!clientClip) return BadAlloc; - if (!REGION_COPY (pSCreen, clientClip, pRegion)) + if (!RegionCopy(clientClip, pRegion)) { - REGION_DESTROY (pScreen, clientClip); + RegionDestroy(clientClip); return BadAlloc; } } @@ -1538,9 +1538,9 @@ CopyPicture (PicturePtr pSrc, RegionPtr clientClip; RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip; - clientClip = REGION_CREATE(pSrc->pDrawable->pScreen, - REGION_EXTENTS(pSrc->pDrawable->pScreen, srcClientClip), - REGION_NUM_RECTS(srcClientClip)); + clientClip = RegionCreate( + RegionExtents(srcClientClip), + RegionNumRects(srcClientClip)); (*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0); } break; -- cgit v1.2.3 From d9e7f6ae42b30e32619e1d0979598c2ba2288a3e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 18 Mar 2016 05:13:43 +0100 Subject: pixman-devel: Build against shared library pkg-config(pixman-1). --- nx-X11/programs/Xserver/render/Imakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 1331b1fb4..23f9476ea 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -29,7 +29,8 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 INCLUDES = -I. -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I../Xext + -I../Xext \ + `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln NormalLibraryTarget(render,$(OBJS)) -- cgit v1.2.3 From ce8fb1f93f71246462d5692c42c88989eb32b1d2 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 21 Mar 2016 16:11:46 +0100 Subject: HAVE_STDINT_H: Always include . We don't define HAVE_STDINT_H anywhere and it should be more safe using the system's definition of UINT32_MAX. --- nx-X11/programs/Xserver/render/glyph.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 900cf9844..f15b199b5 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -43,11 +43,7 @@ #include "picturestr.h" #include "glyphstr.h" -#if HAVE_STDINT_H #include -#elif !defined(UINT32_MAX) -#define UINT32_MAX 0xffffffffU -#endif /* * From Knuth -- a good choice for hash/rehash values is p, p-2 where -- cgit v1.2.3 From cad9f4ef87ddf4e2865783ce7ea7e772d7b196b7 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan <ïonic@ionic.de> Date: Mon, 30 May 2016 16:10:32 +0000 Subject: nx-X11/programs/Xserver/{hw/nxagent/NX,render/}picture.c: add and use new function ReduceCompositeOp(). More or less just an optimization for more "trivial" composite operations requiring less work, but syncs up the newer X.Org Server and nx-libs a bit more. --- nx-X11/programs/Xserver/render/picture.c | 98 ++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 5d8496610..ddb21a07c 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1649,6 +1649,99 @@ FreePictFormat (void * pPictFormat, return Success; } +/** + * ReduceCompositeOp is used to choose simpler ops for cases where alpha + * channels are always one and so math on the alpha channel per pixel becomes + * unnecessary. It may also avoid destination reads sometimes if apps aren't + * being careful to avoid these cases. + */ +static CARD8 +ReduceCompositeOp (CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst) +{ + Bool no_src_alpha, no_dst_alpha; + + no_src_alpha = PICT_FORMAT_COLOR(pSrc->format) && + PICT_FORMAT_A(pSrc->format) == 0 && + pSrc->alphaMap == NULL && + pMask == NULL; + no_dst_alpha = PICT_FORMAT_COLOR(pDst->format) && + PICT_FORMAT_A(pDst->format) == 0 && + pDst->alphaMap == NULL; + + /* TODO, maybe: Conjoint and Disjoint op reductions? */ + + /* Deal with simplifications where the source alpha is always 1. */ + if (no_src_alpha) + { + switch (op) { + case PictOpOver: + op = PictOpSrc; + break; + case PictOpInReverse: + op = PictOpDst; + break; + case PictOpOutReverse: + op = PictOpClear; + break; + case PictOpAtop: + op = PictOpIn; + break; + case PictOpAtopReverse: + op = PictOpOverReverse; + break; + case PictOpXor: + op = PictOpOut; + break; + default: + break; + } + } + + /* Deal with simplifications when the destination alpha is always 1 */ + if (no_dst_alpha) + { + switch (op) { + case PictOpOverReverse: + op = PictOpDst; + break; + case PictOpIn: + op = PictOpSrc; + break; + case PictOpOut: + op = PictOpClear; + break; + case PictOpAtop: + op = PictOpOver; + break; + case PictOpXor: + op = PictOpOutReverse; + break; + default: + break; + } + } + + /* Reduce some con/disjoint ops to the basic names. */ + switch (op) { + case PictOpDisjointClear: + case PictOpConjointClear: + op = PictOpClear; + break; + case PictOpDisjointSrc: + case PictOpConjointSrc: + op = PictOpSrc; + break; + case PictOpDisjointDst: + case PictOpConjointDst: + op = PictOpDst; + break; + default: + break; + } + + return op; +} + void CompositePicture (CARD8 op, PicturePtr pSrc, @@ -1669,6 +1762,11 @@ CompositePicture (CARD8 op, if (pMask) ValidatePicture (pMask); ValidatePicture (pDst); + + op = ReduceCompositeOp (op, pSrc, pMask, pDst); + if (op == PictOpDst) + return; + (*ps->Composite) (op, pSrc, pMask, -- cgit v1.2.3 From c61bb8cc59bf645f1bf4dbc5fd5464d559b3ecad Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 12:18:53 +0200 Subject: Move each screen's root-window pointer into ScreenRec. Backported from X.org: commit e7fae9ecc42ab5e73b89117722dbf4117d928f9a Author: Jamey Sharp Date: Sat May 22 00:26:28 2010 -0700 Move each screen's root-window pointer into ScreenRec. 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 Reviewed-by: Tiago Vignatti Tested-by: Tiago Vignatti (i686 GNU/Linux) Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/render/render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 2dedbc9c4..b165cf549 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -2663,7 +2663,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) newPict->info[0].id = stuff->pid; if (refDraw->type == XRT_WINDOW && - stuff->drawable == WindowTable[0]->drawable.id) + stuff->drawable == screenInfo.screens[0]->root->drawable.id) { newPict->u.pict.root = TRUE; } -- cgit v1.2.3 From 21c3d20fb3e425206b0af228e9ebca6d0566afa4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 13:19:08 +0200 Subject: [render] Split out filter finding from filter setting. Backported from X.org: commit acda790e430b2a18c7c35379f6e538f3d01ff221 Author: Keith Packard Date: Fri Mar 14 13:46:30 2008 -0700 [render] Split out filter finding from filter setting. To prepare for RandR using filters in transforms, split out code paths so that the RandR code can validate the filter name and parameters during the transform set operation so that use of the filter later will not have unreportable errors. Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/render/filter.c | 51 +++++++++++++++++++++-------- nx-X11/programs/Xserver/render/picturestr.h | 13 ++++++-- 2 files changed, 48 insertions(+), 16 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 776bd4237..57a21a8c0 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -215,21 +215,30 @@ PictureFindFilter (ScreenPtr pScreen, char *name, int len) } static Bool -convolutionFilterValidateParams (PicturePtr pPicture, +convolutionFilterValidateParams (ScreenPtr pScreen, int filter, xFixed *params, - int nparams) + int nparams, + int* width, + int* height) { + int w, h; + if (nparams < 3) return FALSE; if (xFixedFrac (params[0]) || xFixedFrac (params[1])) return FALSE; + w = xFixedToInt (params[0]); + h = xFixedToInt (params[1]); + nparams -= 2; - if ((xFixedToInt (params[0]) * xFixedToInt (params[1])) > nparams) + if (w * h > nparams) return FALSE; + *width = w; + *height = h; return TRUE; } @@ -271,10 +280,8 @@ PictureResetFilters (ScreenPtr pScreen) int SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams) { - ScreenPtr pScreen; PictFilterPtr pFilter; - xFixed *new_params; - int i; + ScreenPtr pScreen; if (pPicture->pDrawable) { pScreen = pPicture->pDrawable->pScreen; @@ -288,7 +295,7 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int if (!pFilter) return BadName; - if (!pPicture->pDrawable) { + if (pPicture->pDrawable == NULL) { int s; /* For source pictures, the picture isn't tied to a screen. So, ensure @@ -303,8 +310,25 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int } } + return SetPicturePictFilter (pPicture, pFilter, params, nparams); +} + +int +SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, + xFixed *params, int nparams) +{ + ScreenPtr pScreen; + int i; + + if (pPicture->pDrawable) + pScreen = pPicture->pDrawable->pScreen; + else + pScreen = screenInfo.screens[0]; + if (pFilter->ValidateParams) { - if (!(*pFilter->ValidateParams) (pPicture, pFilter->id, params, nparams)) + int width, height; + + if (!(*pFilter->ValidateParams) (pScreen, pFilter->id, params, nparams, &width, &height)) return BadMatch; } else if (nparams) { @@ -312,7 +336,7 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int } if (nparams != pPicture->filter_nparams) { - new_params = xalloc (nparams * sizeof (xFixed)); + xFixed *new_params = xalloc (nparams * sizeof (xFixed)); if (!new_params && nparams) return BadAlloc; @@ -324,9 +348,10 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int pPicture->filter_params[i] = params[i]; pPicture->filter = pFilter->id; - if (pPicture->pDrawable) { - PictureScreenPtr ps = GetPictureScreen (pScreen); - int result; + if (pPicture->pDrawable) + { + PictureScreenPtr ps = GetPictureScreen(pScreen); + int result; result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter, params, nparams); @@ -335,5 +360,5 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - return Success; + return ; } diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 96c2b8abc..38d2cc5ec 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -168,12 +168,14 @@ typedef struct _Picture { SourcePictPtr pSourcePict; } PictureRec; -typedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id, - xFixed *params, int nparams); +typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id, + xFixed *params, int nparams, + int *width, int *height); typedef struct { char *name; int id; PictFilterValidateParamsProcPtr ValidateParams; + int width, height; } PictFilterRec, *PictFilterPtr; #define PictFilterNearest 0 @@ -457,7 +459,12 @@ PictFilterPtr PictureFindFilter (ScreenPtr pScreen, char *name, int len); int -SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams); +SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, + xFixed *params, int nparams); + +int +SetPictureFilter (PicturePtr pPicture, char *name, int len, + xFixed *params, int nparams); Bool PictureFinishInit (void); -- cgit v1.2.3 From f9dbc64f0e3c558f9313c3cb87ebee01fe3287cd Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 15:43:35 +0200 Subject: Move matrix operations from X server to pixman 0.13.2, handle RandR transform matrices in floating point. Backported from X.org, inspired by: commit 9ffc6719390df8fdd0a5295a7a7a0eaea792be45 Author: Keith Packard Date: Mon Nov 24 13:08:48 2008 -0800 Move matrix operations from X server to pixman 0.13.2 pixman 0.13.2 now holds all of the matrix operations. This leaves the protocol conversion routines and some ABI stubs in place Signed-off-by: Keith Packard commit c4b9ab6bf56139fdd8c7c584a6f523c6766cddd6 Author: Keith Packard Date: Tue Apr 29 08:29:42 2008 -0700 Handle transform failure when computing shadow damage area. PictureTransformBounds can fail, when this happens, damage the entire screen so that the shadow gets repainted correctly. commit fa6a1df209bd74da1d545982cca437afc2198cc1 Author: Keith Packard Date: Fri Mar 21 02:35:28 2008 -0700 Avoid overflow in PictureTransformPoint. Fix PictureTransformIsIdentity. PictureTransformPoint computes homogeneous coordinates internally, but fails to handle intermediate values larger than 16.16. Use 64 bit intermediate values while computing the final result at 16.16 and only complain if that result is too large. PictureTransformIsIdentity was completely wrong -- it was not checking for identity transforms at all. commit 49db14e4ac26070ed86088419483888dda18b603 Author: Keith Packard Date: Wed Mar 19 00:46:35 2008 -0700 Handle RandR transform matrices in floating point. RandR matrix computations lose too much precision in fixed point; computations using the inverted matrix can be as much as 10 pixels off. Convert them to double precision values and pass those around. These API changes are fairly heavyweight; the official Render interface remains fixed point, so the fixed point matrix comes along for the ride everywhere. commit 97ab0c6eff870b52c0383b63a78cec49059b2545 Author: Keith Packard Date: Tue Mar 18 15:15:40 2008 -0700 When converting from double to fixed, round carefully. This reduces the matrix representation error after inverting a transformation matrix (although it doesn't eliminate it entirely). Perhaps we should extend Render to include 64-bit floating point transforms... commit 160252d94f04acc95f0a4e0f884ff565a5aa0744 Author: Keith Packard Date: Mon Mar 17 23:03:56 2008 -0700 Add matrix inversion function (uses doubles) The obvious matrix inversion function, coded using doubles to avoid fiddling with fixed point precision adventures. commit ff9d1cd843a9b0aba69a3d788b21d5f6af702590 Author: Keith Packard Date: Thu Mar 13 21:30:18 2008 -0700 Add funcs to convert between protocol and pixman matrices commit f547650328287545a7a4d96df8d6a6c606dd95a9 Author: Keith Packard Date: Thu Mar 13 14:50:13 2008 -0700 Export a bunch of matrix operations from render. The render extension uses many matrix operations internally, this change exposes those functions to other parts of the server, drivers and extensions. The change is motivated by the 'transform' additions to the RandR extension but will likely be useful elsewhere. Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/render/Imakefile | 2 + nx-X11/programs/Xserver/render/matrix.c | 86 +++++++++++++++++++++++++++++ nx-X11/programs/Xserver/render/picture.c | 68 ----------------------- nx-X11/programs/Xserver/render/picturestr.h | 27 +++++++-- 4 files changed, 109 insertions(+), 74 deletions(-) create mode 100644 nx-X11/programs/Xserver/render/matrix.c (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 23f9476ea..ff272ecbd 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -4,6 +4,7 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 SRCS = animcur.c \ filter.c \ glyph.c \ + matrix.c \ miglyph.c \ miindex.c \ mipict.c \ @@ -17,6 +18,7 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 OBJS = animcur.o \ filter.o \ glyph.o \ + matrix.o \ miglyph.o \ miindex.o \ mipict.o \ diff --git a/nx-X11/programs/Xserver/render/matrix.c b/nx-X11/programs/Xserver/render/matrix.c new file mode 100644 index 000000000..83cd66c43 --- /dev/null +++ b/nx-X11/programs/Xserver/render/matrix.c @@ -0,0 +1,86 @@ +/* + * Copyright © 2007 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "misc.h" +#include "scrnintstr.h" +#include "os.h" +#include "regionstr.h" +#include "validate.h" +#include "windowstr.h" +#include "input.h" +#include "resource.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "dixstruct.h" +#include "gcstruct.h" +#include "servermd.h" +#include "picturestr.h" + +void +PictTransform_from_xRenderTransform(PictTransformPtr pict, + xRenderTransform * render) +{ + pict->matrix[0][0] = render->matrix11; + pict->matrix[0][1] = render->matrix12; + pict->matrix[0][2] = render->matrix13; + + pict->matrix[1][0] = render->matrix21; + pict->matrix[1][1] = render->matrix22; + pict->matrix[1][2] = render->matrix23; + + pict->matrix[2][0] = render->matrix31; + pict->matrix[2][1] = render->matrix32; + pict->matrix[2][2] = render->matrix33; +} + +void +xRenderTransform_from_PictTransform(xRenderTransform * render, + PictTransformPtr pict) +{ + render->matrix11 = pict->matrix[0][0]; + render->matrix12 = pict->matrix[0][1]; + render->matrix13 = pict->matrix[0][2]; + + render->matrix21 = pict->matrix[1][0]; + render->matrix22 = pict->matrix[1][1]; + render->matrix23 = pict->matrix[1][2]; + + render->matrix31 = pict->matrix[2][0]; + render->matrix32 = pict->matrix[2][1]; + render->matrix33 = pict->matrix[2][2]; +} + +Bool +PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector) +{ + return pixman_transform_point(transform, vector); +} + +Bool +PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector) +{ + return pixman_transform_point_3d(transform, vector); +} diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index ddb21a07c..3c43abd67 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1892,71 +1892,3 @@ AddTraps (PicturePtr pPicture, ValidatePicture (pPicture); (*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps); } - -#define MAX_FIXED_48_16 ((xFixed_48_16) 0x7fffffff) -#define MIN_FIXED_48_16 (-((xFixed_48_16) 1 << 31)) - -Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - *vector = result; - return TRUE; -} - - -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 38d2cc5ec..4969f6cab 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -54,13 +54,10 @@ typedef struct _PictFormat { IndexFormatRec index; } PictFormatRec; -typedef struct _PictVector { - xFixed vector[3]; -} PictVector, *PictVectorPtr; +typedef struct pixman_vector PictVector, *PictVectorPtr; +typedef struct pixman_transform PictTransform, *PictTransformPtr; -typedef struct _PictTransform { - xFixed matrix[3][3]; -} PictTransform, *PictTransformPtr; +#define pict_f_transform pixman_f_transform #define PICT_GRADIENT_STOPTABLE_SIZE 1024 #define SourcePictTypeSolidFill 0 @@ -664,4 +661,22 @@ void PanoramiXRenderInit (void); void PanoramiXRenderReset (void); #endif +/* + * matrix.c + */ + +extern _X_EXPORT void +PictTransform_from_xRenderTransform(PictTransformPtr pict, + xRenderTransform * render); + +extern _X_EXPORT void +xRenderTransform_from_PictTransform(xRenderTransform * render, + PictTransformPtr pict); + +extern _X_EXPORT Bool + PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector); + +extern _X_EXPORT Bool + PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector); + #endif /* _PICTURESTR_H_ */ -- cgit v1.2.3 From 500544f827c266f6a9c16d8669f62e54cdfd1f48 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 8 Apr 2016 09:38:20 +0200 Subject: hw/nxagent/NXmitrap.c: Shrink file, drop duplicate code that can identically be found in render/mitrap.c. --- nx-X11/programs/Xserver/render/Imakefile | 23 ++++++++++++++++++----- nx-X11/programs/Xserver/render/mitrap.c | 2 ++ 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index ff272ecbd..d6e2f4c40 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -1,6 +1,18 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 keithp Exp $ + +NULL = + #include +#if (!(defined(NXAgentServer) && NXAgentServer)) +NXAGENT_SKIP_SRCS = \ + mitrap.c \ + $(NULL) +NXAGENT_SKIP_OBJS = \ + mitrap.o \ + $(NULL) +#endif + SRCS = animcur.c \ filter.c \ glyph.c \ @@ -9,11 +21,12 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 miindex.c \ mipict.c \ mirect.c \ - mitrap.c \ mitri.c \ picture.c \ render.c \ - renderedge.c + renderedge.c \ + $(NXAGENT_SKIP_SRCS) \ + $(NULL) OBJS = animcur.o \ filter.o \ @@ -23,11 +36,12 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 miindex.o \ mipict.o \ mirect.o \ - mitrap.o \ mitri.o \ picture.o \ render.o \ - renderedge.o + renderedge.o \ + $(NXAGENT_SKIP_OBJS) \ + $(NULL) INCLUDES = -I. -I../include -I../mi \ -I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \ @@ -46,4 +60,3 @@ InstallDriverSDKNonExecFile(glyphstr.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(mipict.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(picture.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(picturestr.h,$(DRIVERSDKINCLUDEDIR)) - diff --git a/nx-X11/programs/Xserver/render/mitrap.c b/nx-X11/programs/Xserver/render/mitrap.c index be1712420..96f1159a4 100644 --- a/nx-X11/programs/Xserver/render/mitrap.c +++ b/nx-X11/programs/Xserver/render/mitrap.c @@ -128,6 +128,7 @@ miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box) } } +#ifndef NXAGENT_SERVER void miTrapezoids (CARD8 op, PicturePtr pSrc, @@ -188,3 +189,4 @@ miTrapezoids (CARD8 op, miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps); } } +#endif -- cgit v1.2.3 From ae1a218d16b65194c522ef8ffc998184863321f9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 8 Apr 2016 09:45:32 +0200 Subject: hw/nxagent/NXmiglyph.c: Shrink file, drop code that can be identically found in render/miglyph.c. --- nx-X11/programs/Xserver/render/Imakefile | 4 ++-- nx-X11/programs/Xserver/render/miglyph.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index d6e2f4c40..0685ef3f6 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -6,9 +6,11 @@ NULL = #if (!(defined(NXAgentServer) && NXAgentServer)) NXAGENT_SKIP_SRCS = \ + miglyph.c \ mitrap.c \ $(NULL) NXAGENT_SKIP_OBJS = \ + miglyph.o \ mitrap.o \ $(NULL) #endif @@ -17,7 +19,6 @@ NXAGENT_SKIP_OBJS = \ filter.c \ glyph.c \ matrix.c \ - miglyph.c \ miindex.c \ mipict.c \ mirect.c \ @@ -32,7 +33,6 @@ NXAGENT_SKIP_OBJS = \ filter.o \ glyph.o \ matrix.o \ - miglyph.o \ miindex.o \ mipict.o \ mirect.o \ diff --git a/nx-X11/programs/Xserver/render/miglyph.c b/nx-X11/programs/Xserver/render/miglyph.c index 8b046bd46..f169c3bb7 100644 --- a/nx-X11/programs/Xserver/render/miglyph.c +++ b/nx-X11/programs/Xserver/render/miglyph.c @@ -89,6 +89,7 @@ miGlyphExtents (int nlist, #define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) +#ifndef NXAGENT_SERVER void miGlyphs (CARD8 op, PicturePtr pSrc, @@ -241,3 +242,4 @@ miGlyphs (CARD8 op, (*pScreen->DestroyPixmap) (pMaskPixmap); } } +#endif -- cgit v1.2.3 From 0c29f81f1bbd3c507c847ce4460d316478083213 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 9 Apr 2016 00:36:40 +0200 Subject: hw/nxagent/NXpicture.c: Shrink file, drop duplicate code that can identically be found in render/picture.c. --- nx-X11/programs/Xserver/render/Imakefile | 4 ++-- nx-X11/programs/Xserver/render/picture.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 0685ef3f6..5db244d6d 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -8,10 +8,12 @@ NULL = NXAGENT_SKIP_SRCS = \ miglyph.c \ mitrap.c \ + picture.c \ $(NULL) NXAGENT_SKIP_OBJS = \ miglyph.o \ mitrap.o \ + picture.o \ $(NULL) #endif @@ -23,7 +25,6 @@ NXAGENT_SKIP_OBJS = \ mipict.c \ mirect.c \ mitri.c \ - picture.c \ render.c \ renderedge.c \ $(NXAGENT_SKIP_SRCS) \ @@ -37,7 +38,6 @@ NXAGENT_SKIP_OBJS = \ mipict.o \ mirect.o \ mitri.o \ - picture.o \ render.o \ renderedge.o \ $(NXAGENT_SKIP_OBJS) \ diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 3c43abd67..a29a9568c 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -40,7 +40,10 @@ #include "dixstruct.h" #include "gcstruct.h" #include "servermd.h" + +#ifndef NXAGENT_SERVER #include "picturestr.h" +#endif int PictureScreenPrivateIndex = -1; int PictureWindowPrivateIndex; @@ -212,6 +215,7 @@ addFormat (FormatInitRec formats[256], #define Mask(n) ((n) == 32 ? 0xffffffff : ((1 << (n))-1)) +#ifndef NXAGENT_SERVER PictFormatPtr PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) { @@ -431,6 +435,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) *nformatp = nformats; return pFormats; } +#endif static VisualPtr PictureFindVisual (ScreenPtr pScreen, VisualID visual) @@ -767,6 +772,7 @@ SetPictureToDefaults (PicturePtr pPicture) pPicture->pSourcePict = 0; } +#ifndef NXAGENT_SERVER PicturePtr AllocatePicture (ScreenPtr pScreen) { @@ -847,6 +853,7 @@ CreatePicture (Picture pid, } return pPicture; } +#endif static CARD32 xRenderColorToCard32(xRenderColor c) { @@ -969,6 +976,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, initGradientColorTable(pGradient, error); } +#ifndef NXAGENT_SERVER static PicturePtr createSourcePicture(void) { PicturePtr pPicture; @@ -1002,6 +1010,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color); return pPicture; } +#endif PicturePtr CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, @@ -1592,6 +1601,7 @@ ValidatePicture(PicturePtr pPicture) ValidateOnePicture (pPicture->alphaMap); } +#ifndef NXAGENT_SERVER int FreePicture (void * value, XID pid) @@ -1641,6 +1651,7 @@ FreePicture (void * value, } return Success; } +#endif int FreePictFormat (void * pPictFormat, -- cgit v1.2.3 From 778e83a3cb717f4033a3bff65134cc5697a528fc Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 13 Apr 2016 15:28:33 +0200 Subject: hw/nxagent/NX{glyphstr,picturestr}.h: Don't ship the complete header files in nxagent's code base. Rather replace structures we need modified only. --- nx-X11/programs/Xserver/render/Imakefile | 2 ++ nx-X11/programs/Xserver/render/glyphstr.h | 8 ++++++++ nx-X11/programs/Xserver/render/picturestr.h | 4 ++++ 3 files changed, 14 insertions(+) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 5db244d6d..f39e74830 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -15,6 +15,8 @@ NXAGENT_SKIP_OBJS = \ mitrap.o \ picture.o \ $(NULL) +#else + DEFINES = -DNXAGENT_SERVER #endif SRCS = animcur.c \ diff --git a/nx-X11/programs/Xserver/render/glyphstr.h b/nx-X11/programs/Xserver/render/glyphstr.h index f27a73fbb..d0c14919c 100644 --- a/nx-X11/programs/Xserver/render/glyphstr.h +++ b/nx-X11/programs/Xserver/render/glyphstr.h @@ -44,10 +44,14 @@ typedef struct _Glyph { /* bits follow */ } GlyphRec, *GlyphPtr; +#ifdef NXAGENT_SERVER +#include "../hw/nxagent/NXglyphstr_GlyphRef.h" +#else typedef struct _GlyphRef { CARD32 signature; GlyphPtr glyph; } GlyphRefRec, *GlyphRefPtr; +#endif /* NXAGENT_SERVER */ #define DeletedGlyph ((GlyphPtr) 1) @@ -63,6 +67,9 @@ typedef struct _GlyphHash { CARD32 tableEntries; } GlyphHashRec, *GlyphHashPtr; +#ifdef NXAGENT_SERVER +#include "../hw/nxagent/NXglyphstr_GlyphSet.h" +#else typedef struct _GlyphSet { CARD32 refcnt; PictFormatPtr format; @@ -71,6 +78,7 @@ typedef struct _GlyphSet { int maxPrivate; void **devPrivates; } GlyphSetRec, *GlyphSetPtr; +#endif /* NXAGENT_SERVER */ #define GlyphSetGetPrivate(pGlyphSet,n) \ ((n) > (pGlyphSet)->maxPrivate ? \ diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 4969f6cab..27c36dc9c 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -65,10 +65,14 @@ typedef struct pixman_transform PictTransform, *PictTransformPtr; #define SourcePictTypeRadial 2 #define SourcePictTypeConical 3 +#ifdef NXAGENT_SERVER +#include "../hw/nxagent/NXpicturestr_PictSolidFill.h" +#else typedef struct _PictSolidFill { unsigned int type; CARD32 color; } PictSolidFill, *PictSolidFillPtr; +#endif /* NXAGENT_SERVER */ typedef struct _PictGradientStop { xFixed x; -- cgit v1.2.3 From a648558796042b0cdb1a373f52bf8a4ca2dbea87 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 13 Apr 2016 15:29:32 +0200 Subject: hw/nxagent/NXrender.c: Shrink file, drop duplicate code that can identically be found in render/render.c. Fixes ArcticaProject/nx-libs#37 --- nx-X11/programs/Xserver/render/Imakefile | 4 ++-- nx-X11/programs/Xserver/render/render.c | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index f39e74830..a8eab5149 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -9,11 +9,13 @@ NXAGENT_SKIP_SRCS = \ miglyph.c \ mitrap.c \ picture.c \ + render.c \ $(NULL) NXAGENT_SKIP_OBJS = \ miglyph.o \ mitrap.o \ picture.o \ + render.o \ $(NULL) #else DEFINES = -DNXAGENT_SERVER @@ -27,7 +29,6 @@ NXAGENT_SKIP_OBJS = \ mipict.c \ mirect.c \ mitri.c \ - render.c \ renderedge.c \ $(NXAGENT_SKIP_SRCS) \ $(NULL) @@ -40,7 +41,6 @@ NXAGENT_SKIP_OBJS = \ mipict.o \ mirect.o \ mitri.o \ - render.o \ renderedge.o \ $(NXAGENT_SKIP_OBJS) \ $(NULL) diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index b165cf549..3c14ac0e7 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -275,6 +275,7 @@ RenderResetProc (ExtensionEntry *extEntry) ResetGlyphSetPrivateIndex(); } +#ifndef NXAGENT_SERVER static int ProcRenderQueryVersion (ClientPtr client) { @@ -303,6 +304,7 @@ ProcRenderQueryVersion (ClientPtr client) WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); return (client->noClientException); } +#endif /* NXAGENT_SERVER */ #if 0 static int @@ -341,6 +343,7 @@ findVisual (ScreenPtr pScreen, VisualID vid) extern char *ConnectionInfo; +#ifndef NXAGENT_SERVER static int ProcRenderQueryPictFormats (ClientPtr client) { @@ -550,6 +553,7 @@ ProcRenderQueryPictFormats (ClientPtr client) xfree (reply); return client->noClientException; } +#endif /* NXAGENT_SERVER */ static int ProcRenderQueryPictIndexValues (ClientPtr client) @@ -621,6 +625,7 @@ ProcRenderQueryDithers (ClientPtr client) return BadImplementation; } +#ifndef NXAGENT_SERVER static int ProcRenderCreatePicture (ClientPtr client) { @@ -710,6 +715,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) else return(result); } +#endif /* NXAGENT_SERVER */ static int ProcRenderFreePicture (ClientPtr client) @@ -737,6 +743,7 @@ PictOpValid (CARD8 op) return FALSE; } +#ifndef NXAGENT_SERVER static int ProcRenderComposite (ClientPtr client) { @@ -774,6 +781,7 @@ ProcRenderComposite (ClientPtr client) stuff->height); return Success; } +#endif /* NXAGENT_SERVER */ static int ProcRenderScale (ClientPtr client) @@ -781,6 +789,7 @@ ProcRenderScale (ClientPtr client) return BadImplementation; } +#ifndef NXAGENT_SERVER static int ProcRenderTrapezoids (ClientPtr client) { @@ -827,6 +836,7 @@ ProcRenderTrapezoids (ClientPtr client) ntraps, (xTrapezoid *) &stuff[1]); return client->noClientException; } +#endif /* NXAGENT_SERVER */ static int ProcRenderTriangles (ClientPtr client) @@ -987,6 +997,7 @@ ProcRenderTransform (ClientPtr client) return BadImplementation; } +#ifndef NXAGENT_SERVER static int ProcRenderCreateGlyphSet (ClientPtr client) { @@ -1060,10 +1071,12 @@ ProcRenderReferenceGlyphSet (ClientPtr client) return BadAlloc; return client->noClientException; } +#endif /* NXAGENT_SERVER */ #define NLOCALDELTA 64 #define NLOCALGLYPH 256 +#ifndef NXAGENT_SERVER static int ProcRenderFreeGlyphSet (ClientPtr client) { @@ -1083,6 +1096,7 @@ ProcRenderFreeGlyphSet (ClientPtr client) FreeResource (stuff->glyphset, RT_NONE); return client->noClientException; } +#endif /* NXAGENT_SERVER */ typedef struct _GlyphNew { Glyph id; @@ -1096,7 +1110,7 @@ ProcRenderAddGlyphs (ClientPtr client) REQUEST(xRenderAddGlyphsReq); GlyphNewRec glyphsLocal[NLOCALGLYPH]; GlyphNewPtr glyphsBase, glyphs; - GlyphPtr glyph; + GlyphPtr glyph = NULL; int remain, nglyphs; CARD32 *gids; xGlyphInfo *gi; @@ -1199,6 +1213,7 @@ ProcRenderAddGlyphsFromPicture (ClientPtr client) return BadImplementation; } +#ifndef NXAGENT_SERVER static int ProcRenderFreeGlyphs (ClientPtr client) { @@ -1454,6 +1469,7 @@ ProcRenderFillRectangles (ClientPtr client) return client->noClientException; } +#endif /* NXAGENT_SERVER */ static void SetBit (unsigned char *line, int x, int bit) @@ -1481,6 +1497,7 @@ static CARD32 orderedDither[DITHER_DIM][DITHER_DIM] = { #define DITHER_SIZE ((sizeof orderedDither / sizeof orderedDither[0][0]) + 1) +#ifndef NXAGENT_SERVER static int ProcRenderCreateCursor (ClientPtr client) { @@ -1694,6 +1711,7 @@ ProcRenderSetPictureTransform (ClientPtr client) else return(result); } +#endif /* NXAGENT_SERVER */ static int ProcRenderQueryFilters (ClientPtr client) @@ -1804,6 +1822,7 @@ ProcRenderQueryFilters (ClientPtr client) return(client->noClientException); } +#ifndef NXAGENT_SERVER static int ProcRenderSetPictureFilter (ClientPtr client) { @@ -1868,6 +1887,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) return client->noClientException; return BadAlloc; } +#endif /* NXAGENT_SERVER */ static int ProcRenderAddTraps (ClientPtr client) @@ -1892,6 +1912,7 @@ ProcRenderAddTraps (ClientPtr client) return client->noClientException; } +#ifndef NXAGENT_SERVER static int ProcRenderCreateSolidFill(ClientPtr client) { PicturePtr pPicture; @@ -2011,6 +2032,7 @@ ProcRenderDispatch (ClientPtr client) else return BadRequest; } +#endif /* NXAGENT_SERVER */ static int SProcRenderQueryVersion (ClientPtr client) @@ -2611,6 +2633,7 @@ SProcRenderCreateConicalGradient (ClientPtr client) return (*ProcRenderVector[stuff->renderReqType]) (client); } +#ifndef NXAGENT_SERVER static int SProcRenderDispatch (ClientPtr client) { @@ -2621,6 +2644,7 @@ SProcRenderDispatch (ClientPtr client) else return BadRequest; } +#endif /* NXAGENT_SERVER */ #ifdef PANORAMIX #include "panoramiX.h" -- cgit v1.2.3 From 0571ece6a4ea66b4d558b3f6d0dc1d81b47c799b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 18 Apr 2016 08:19:05 +0200 Subject: hw/nxagent/NXglyph.c: Shrink file, drop duplicate code that can identically be found in render/glyph.c. --- nx-X11/programs/Xserver/render/Imakefile | 2 ++ nx-X11/programs/Xserver/render/glyph.c | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index a8eab5149..2d918458b 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -6,12 +6,14 @@ NULL = #if (!(defined(NXAgentServer) && NXAgentServer)) NXAGENT_SKIP_SRCS = \ + glyph.c \ miglyph.c \ mitrap.c \ picture.c \ render.c \ $(NULL) NXAGENT_SKIP_OBJS = \ + glyph.o \ miglyph.o \ mitrap.o \ picture.o \ diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index f15b199b5..854a9069d 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -268,6 +268,7 @@ FreeGlyph (GlyphPtr glyph, int format) } } +#ifndef NXAGENT_SERVER void AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) { @@ -301,6 +302,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) gr->signature = id; CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); } +#endif /* NXAGENT_SERVER */ Bool DeleteGlyph (GlyphSetPtr glyphSet, Glyph id) @@ -320,6 +322,7 @@ DeleteGlyph (GlyphSetPtr glyphSet, Glyph id) return FALSE; } +#ifndef NXAGENT_SERVER GlyphPtr FindGlyph (GlyphSetPtr glyphSet, Glyph id) { @@ -330,6 +333,7 @@ FindGlyph (GlyphSetPtr glyphSet, Glyph id) glyph = 0; return glyph; } +#endif /* NXAGENT_SERVER */ GlyphPtr AllocateGlyph (xGlyphInfo *gi, int fdepth) @@ -363,6 +367,8 @@ AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) return TRUE; } + +#ifndef NXAGENT_SERVER Bool ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) { @@ -405,6 +411,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) CheckDuplicates (hash, "ResizeGlyphHash bottom"); return TRUE; } +#endif /* NXAGENT_SERVER */ Bool ResizeGlyphSet (GlyphSetPtr glyphSet, CARD32 change) -- cgit v1.2.3 From 3bdcd172757a10aeaeceff4447a62f7513804893 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 2 May 2016 11:29:53 +0200 Subject: hw/nxagent/NX*.c: Amend re-introduced nxagent warnings by fixing the corresponding code section in files included from "somewhere" in nx-X11/programs/Xserver/. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (1) In file included from NXrender.c:44:0: ../../mi/../render/render.c: In function ‘swapStops’: ../../mi/../render/render.c:2541:13: warning: variable ‘colors’ set but not used [-Wunused-but-set-variable] CARD16 *colors; ^ (2) In file included from NXevents.c:133:0: ../../dix/events.c: In function ‘ReinitializeRootWindow’: ../../dix/events.c:2046:15: warning: unused variable ‘pScreen’ [-Wunused-variable] ScreenPtr pScreen = win->drawable.pScreen; ^ ../../dix/events.c: In function ‘XineramaPointInWindowIsVisible’: ../../dix/events.c:2177:15: warning: variable ‘pScreen’ set but not used [-Wunused-but-set-variable] ScreenPtr pScreen = pWin->drawable.pScreen; ^ In file included from NXevents.c:133:0: ../../dix/events.c: In function ‘XineramaPointInWindowIsVisible’: ../../dix/events.c:2191:2: error: ‘pScreen’ undeclared (first use in this function) pScreen = pWin->drawable.pScreen; ^ (3) In file included from NXdixfonts.c:77:0: ../../dix/dixfonts.c: In function ‘GetFontPath’: ../../dix/dixfonts.c:1890:2: warning: return makes pointer from integer without a cast return BadAlloc; ^ --- nx-X11/programs/Xserver/render/render.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 3c14ac0e7..c73ff8305 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -2538,13 +2538,11 @@ static void swapStops(void *stuff, int num) { int i, n; CARD32 *stops; - CARD16 *colors; stops = (CARD32 *)(stuff); for (i = 0; i < num; ++i) { swapl(stops, n); ++stops; } - colors = (CARD16 *)(stops); for (i = 0; i < 4*num; ++i) { swaps(stops, n); ++stops; -- cgit v1.2.3 From a08e2323e838099cc2079287c5b3fd1e9b7f20f7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 28 Jun 2016 12:06:50 +0200 Subject: Xserver Imakefiles: Make sure NXAGENT_SERVER is defined for all extensions. --- nx-X11/programs/Xserver/render/Imakefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 2d918458b..6c3a7880c 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -1,6 +1,6 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 keithp Exp $ -NULL = + NULL = #include @@ -20,7 +20,7 @@ NXAGENT_SKIP_OBJS = \ render.o \ $(NULL) #else - DEFINES = -DNXAGENT_SERVER + NX_DEFINES = -DNXAGENT_SERVER #endif SRCS = animcur.c \ @@ -53,6 +53,10 @@ NXAGENT_SKIP_OBJS = \ `pkg-config --cflags-only-I pixman-1` LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln + DEFINES = \ + $(NX_DEFINES) \ + $(NULL) + NormalLibraryTarget(render,$(OBJS)) NormalLibraryObjectRule() LintLibraryTarget(render,$(SRCS)) -- cgit v1.2.3 From 487870fff5cd1bc3db5ade4f5721f483f96119c7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 28 Jun 2016 12:07:10 +0200 Subject: Xserver/include/protocol-versions.h: Switch to having an Xserver-specific header file containing all use protocol versions. --- nx-X11/programs/Xserver/render/render.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index c73ff8305..5a4114adc 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -52,6 +52,8 @@ #include "xf86_ansic.h" #endif +#include "protocol-versions.h" + #if !defined(UINT32_MAX) #define UINT32_MAX 0xffffffffU #endif @@ -293,8 +295,8 @@ ProcRenderQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = RENDER_MAJOR; - rep.minorVersion = RENDER_MINOR; + rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; + rep.minorVersion = SERVER_RENDER_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); -- cgit v1.2.3 From acf87144d019f18e646501657d9082c6eba77f54 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 01:38:22 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}free() macros, use free() instead. Fixes ArcticaProject/nx-libs#105 --- nx-X11/programs/Xserver/render/animcur.c | 2 +- nx-X11/programs/Xserver/render/filter.c | 12 ++++----- nx-X11/programs/Xserver/render/glyph.c | 16 ++++++------ nx-X11/programs/Xserver/render/miindex.c | 6 ++--- nx-X11/programs/Xserver/render/mipict.c | 2 +- nx-X11/programs/Xserver/render/picture.c | 42 +++++++++++++++--------------- nx-X11/programs/Xserver/render/render.c | 44 ++++++++++++++++---------------- 7 files changed, 62 insertions(+), 62 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 27e5ab949..993800c7e 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -128,7 +128,7 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen) Unwrap(as, pScreen, RecolorCursor); SetAnimCurScreen(pScreen,0); ret = (*pScreen->CloseScreen) (index, pScreen); - xfree (as); + free (as); if (index == 0) AnimCurScreenPrivateIndex = -1; return ret; diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 57a21a8c0..31d5481c9 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -73,7 +73,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) names = xalloc (sizeof (char *)); if (!names) { - xfree (name); + free (name); return -1; } filterNames = names; @@ -119,8 +119,8 @@ PictureFreeFilterIds (void) int i; for (i = 0; i < nfilterNames; i++) - xfree (filterNames[i]); - xfree (filterNames); + free (filterNames[i]); + free (filterNames); nfilterNames = 0; filterNames = 0; } @@ -272,8 +272,8 @@ PictureResetFilters (ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); - xfree (ps->filters); - xfree (ps->filterAliases); + free (ps->filters); + free (ps->filterAliases); PictureFreeFilterIds (); } @@ -340,7 +340,7 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, if (!new_params && nparams) return BadAlloc; - xfree (pPicture->filter_params); + free (pPicture->filter_params); pPicture->filter_params = new_params; pPicture->filter_nparams = nparams; } diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 854a9069d..f956c44b2 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -264,7 +264,7 @@ FreeGlyph (GlyphPtr glyph, int format) gr->signature = 0; globalGlyphs[format].tableEntries--; } - xfree (glyph); + free (glyph); } } @@ -281,7 +281,7 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) gr = FindGlyphRef (&globalGlyphs[glyphSet->fdepth], hash, TRUE, glyph); if (gr->glyph && gr->glyph != DeletedGlyph) { - xfree (glyph); + free (glyph); glyph = gr->glyph; } else @@ -404,7 +404,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) ++newHash.tableEntries; } } - xfree (hash->table); + free (hash->table); } *hash = newHash; if (global) @@ -444,7 +444,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) { - xfree (glyphSet); + free (glyphSet); return FALSE; } glyphSet->refcnt = 1; @@ -473,19 +473,19 @@ FreeGlyphSet (void *value, } if (!globalGlyphs[glyphSet->fdepth].tableEntries) { - xfree (globalGlyphs[glyphSet->fdepth].table); + free (globalGlyphs[glyphSet->fdepth].table); globalGlyphs[glyphSet->fdepth].table = 0; globalGlyphs[glyphSet->fdepth].hashSet = 0; } else ResizeGlyphHash (&globalGlyphs[glyphSet->fdepth], 0, TRUE); - xfree (table); + free (table); if (glyphSet->devPrivates && glyphSet->devPrivates != (void *)(&glyphSet[1])) - xfree(glyphSet->devPrivates); + free(glyphSet->devPrivates); - xfree (glyphSet); + free (glyphSet); } return Success; } diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c index 03e2857a2..ad2653c14 100644 --- a/nx-X11/programs/Xserver/render/miindex.c +++ b/nx-X11/programs/Xserver/render/miindex.c @@ -267,7 +267,7 @@ miInitIndexed (ScreenPtr pScreen, pFormat->index.pValues = xalloc (num * sizeof (xIndexValue)); if (!pFormat->index.pValues) { - xfree (pIndexed); + free (pIndexed); return FALSE; } @@ -323,12 +323,12 @@ miCloseIndexed (ScreenPtr pScreen, { if (pFormat->index.devPrivate) { - xfree (pFormat->index.devPrivate); + free (pFormat->index.devPrivate); pFormat->index.devPrivate = 0; } if (pFormat->index.pValues) { - xfree (pFormat->index.pValues); + free (pFormat->index.pValues); pFormat->index.pValues = 0; } } diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index ae7cf5a6d..5bd449d44 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -107,7 +107,7 @@ miChangePictureClip (PicturePtr pPicture, if (!clientClip) return BadAlloc; clientClipType = CT_REGION; - xfree(value); + free(value); break; } (*ps->DestroyPictureClip) (pPicture); diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index a29a9568c..1e653b0c3 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -141,9 +141,9 @@ PictureCloseScreen (int index, ScreenPtr pScreen) (*ps->CloseIndexed) (pScreen, &ps->formats[n]); SetPictureScreen(pScreen, 0); if (ps->PicturePrivateSizes) - xfree (ps->PicturePrivateSizes); - xfree (ps->formats); - xfree (ps); + free (ps->PicturePrivateSizes); + free (ps->formats); + free (ps); return ret; } @@ -660,7 +660,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) { if (!AddResource (formats[n].id, PictFormatType, (void *) (formats+n))) { - xfree (formats); + free (formats); return FALSE; } if (formats[n].type == PictTypeIndexed) @@ -692,15 +692,15 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); if (!ps) { - xfree (formats); + free (formats); return FALSE; } SetPictureScreen(pScreen, ps); if (!GlyphInit (pScreen)) { SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); + free (formats); + free (ps); return FALSE; } @@ -730,8 +730,8 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) { PictureResetFilters (pScreen); SetPictureScreen(pScreen, 0); - xfree (formats); - xfree (ps); + free (formats); + free (ps); return FALSE; } @@ -1003,7 +1003,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } pPicture->pSourcePict->type = SourcePictTypeSolidFill; @@ -1037,7 +1037,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } @@ -1047,7 +1047,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { - xfree(pPicture); + free(pPicture); return 0; } return pPicture; @@ -1086,7 +1086,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } radial = &pPicture->pSourcePict->radial; @@ -1110,7 +1110,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { - xfree(pPicture); + free(pPicture); return 0; } return pPicture; @@ -1137,7 +1137,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; - xfree(pPicture); + free(pPicture); return 0; } @@ -1147,7 +1147,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, initGradient(pPicture->pSourcePict, nStops, stops, colors, error); if (*error) { - xfree(pPicture); + free(pPicture); return 0; } return pPicture; @@ -1487,7 +1487,7 @@ SetPictureTransform (PicturePtr pPicture, { if (pPicture->transform) { - xfree (pPicture->transform); + free (pPicture->transform); pPicture->transform = 0; } } @@ -1611,12 +1611,12 @@ FreePicture (void * value, if (--pPicture->refcnt == 0) { if (pPicture->transform) - xfree (pPicture->transform); + free (pPicture->transform); if (!pPicture->pDrawable) { if (pPicture->pSourcePict) { if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) - xfree(pPicture->pSourcePict->linear.stops); - xfree(pPicture->pSourcePict); + free(pPicture->pSourcePict->linear.stops); + free(pPicture->pSourcePict); } } else { ScreenPtr pScreen = pPicture->pDrawable->pScreen; @@ -1647,7 +1647,7 @@ FreePicture (void * value, (*pScreen->DestroyPixmap) ((PixmapPtr)pPicture->pDrawable); } } - xfree (pPicture); + free (pPicture); } return Success; } diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 5a4114adc..58b3dbc88 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -552,7 +552,7 @@ ProcRenderQueryPictFormats (ClientPtr client) swapl (&reply->numSubpixel, n); } WriteToClient(client, rlength, (char *) reply); - xfree (reply); + free (reply); return client->noClientException; } #endif /* NXAGENT_SERVER */ @@ -617,7 +617,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) } WriteToClient(client, rlength, (char *) reply); - xfree(reply); + free(reply); return (client->noClientException); } @@ -1196,16 +1196,16 @@ ProcRenderAddGlyphs (ClientPtr client) } if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); + free (glyphsBase); return client->noClientException; bail: while (glyphs != glyphsBase) { --glyphs; - xfree (glyphs->glyph); + free (glyphs->glyph); } if (glyphsBase != glyphsLocal) - Xfree (glyphsBase); + free (glyphsBase); return err; } @@ -1542,14 +1542,14 @@ ProcRenderCreateCursor (ClientPtr client) srcbits = (unsigned char *)xalloc(nbytes_mono); if (!srcbits) { - xfree (argbbits); + free (argbbits); return (BadAlloc); } mskbits = (unsigned char *)xalloc(nbytes_mono); if (!mskbits) { - xfree(argbbits); - xfree(srcbits); + free(argbbits); + free(srcbits); return (BadAlloc); } bzero ((char *) mskbits, nbytes_mono); @@ -1571,26 +1571,26 @@ ProcRenderCreateCursor (ClientPtr client) pFormat = PictureMatchFormat (pScreen, 32, PICT_a8r8g8b8); if (!pFormat) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return (BadImplementation); } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); if (!pPixmap) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return (BadAlloc); } pPicture = CreatePicture (0, &pPixmap->drawable, pFormat, 0, 0, client, &error); if (!pPicture) { - xfree (argbbits); - xfree (srcbits); - xfree (mskbits); + free (argbbits); + free (srcbits); + free (mskbits); return error; } (*pScreen->DestroyPixmap) (pPixmap); @@ -1674,7 +1674,7 @@ ProcRenderCreateCursor (ClientPtr client) } else { - xfree (argbbits); + free (argbbits); argbbits = 0; } @@ -1819,7 +1819,7 @@ ProcRenderQueryFilters (ClientPtr client) swapl(&reply->numFilters, n); } WriteToClient(client, total_bytes, (char *) reply); - xfree (reply); + free (reply); return(client->noClientException); } @@ -1873,7 +1873,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) RT_CURSOR, SecurityReadAccess); if (!cursors[i]) { - xfree (cursors); + free (cursors); client->errorValue = elt->cursor; return BadCursor; } @@ -1881,7 +1881,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) elt++; } ret = AnimCursorCreate (cursors, deltas, ncursor, &pCursor); - xfree (cursors); + free (cursors); if (ret != Success) return ret; @@ -2707,7 +2707,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) if (result == Success) AddResource(newPict->info[0].id, XRT_PICTURE, newPict); else - xfree(newPict); + free(newPict); return (result); } -- cgit v1.2.3 From 2646fc254e75c4a7fc10d03d1139d0bd708ceae9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 01:51:18 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}alloc() macros, use malloc() instead. --- nx-X11/programs/Xserver/render/animcur.c | 4 ++-- nx-X11/programs/Xserver/render/filter.c | 10 +++++----- nx-X11/programs/Xserver/render/glyph.c | 8 ++++---- nx-X11/programs/Xserver/render/miindex.c | 4 ++-- nx-X11/programs/Xserver/render/picture.c | 20 ++++++++++---------- nx-X11/programs/Xserver/render/render.c | 18 +++++++++--------- 6 files changed, 32 insertions(+), 32 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 993800c7e..c5535050e 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -334,7 +334,7 @@ AnimCurInit (ScreenPtr pScreen) animCurState.elt = 0; animCurState.time = 0; } - as = (AnimCurScreenPtr) xalloc (sizeof (AnimCurScreenRec)); + as = (AnimCurScreenPtr) malloc (sizeof (AnimCurScreenRec)); if (!as) return FALSE; Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); @@ -366,7 +366,7 @@ AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *pp if (IsAnimCur (cursors[i])) return BadMatch; - pCursor = (CursorPtr) xalloc (sizeof (CursorRec) + + pCursor = (CursorPtr) malloc (sizeof (CursorRec) + sizeof (AnimCurRec) + ncursor * sizeof (AnimCurElt)); if (!pCursor) diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 31d5481c9..065ffa682 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -62,7 +62,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) return i; if (!makeit) return -1; - name = xalloc (len + 1); + name = malloc (len + 1); if (!name) return -1; memcpy (name, filter, len); @@ -70,7 +70,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) if (filterNames) names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *)); else - names = xalloc (sizeof (char *)); + names = malloc (sizeof (char *)); if (!names) { free (name); @@ -146,7 +146,7 @@ PictureAddFilter (ScreenPtr pScreen, if (ps->filters) filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec)); else - filters = xalloc (sizeof (PictFilterRec)); + filters = malloc (sizeof (PictFilterRec)); if (!filters) return -1; ps->filters = filters; @@ -179,7 +179,7 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias) (ps->nfilterAliases + 1) * sizeof (PictFilterAliasRec)); else - aliases = xalloc (sizeof (PictFilterAliasRec)); + aliases = malloc (sizeof (PictFilterAliasRec)); if (!aliases) return FALSE; ps->filterAliases = aliases; @@ -336,7 +336,7 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, } if (nparams != pPicture->filter_nparams) { - xFixed *new_params = xalloc (nparams * sizeof (xFixed)); + xFixed *new_params = malloc (nparams * sizeof (xFixed)); if (!new_params && nparams) return BadAlloc; diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index f956c44b2..4cba50d0f 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -122,7 +122,7 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) if (!new) return FALSE; } else { - new = (void **) xalloc ((n + 1) * sizeof (void *)); + new = (void **) malloc ((n + 1) * sizeof (void *)); if (!new) return FALSE; if (glyphSet->devPrivates) @@ -346,7 +346,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height) return 0; size = gi->height * padded_width; - glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); + glyph = (GlyphPtr) malloc (size + sizeof (GlyphRec)); if (!glyph) return 0; glyph->refcnt = 0; @@ -358,7 +358,7 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth) Bool AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) { - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); + hash->table = (GlyphRefPtr) malloc (hashSet->size * sizeof (GlyphRefRec)); if (!hash->table) return FALSE; memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); @@ -434,7 +434,7 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) size = (sizeof (GlyphSetRec) + (sizeof (void *) * _GlyphSetPrivateAllocateIndex)); - glyphSet = xalloc (size); + glyphSet = malloc (size); if (!glyphSet) return FALSE; bzero((char *)glyphSet, size); diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c index ad2653c14..ce31c00fb 100644 --- a/nx-X11/programs/Xserver/render/miindex.c +++ b/nx-X11/programs/Xserver/render/miindex.c @@ -259,12 +259,12 @@ miInitIndexed (ScreenPtr pScreen, pixels[p] = p; } - pIndexed = xalloc (sizeof (miIndexedRec)); + pIndexed = malloc (sizeof (miIndexedRec)); if (!pIndexed) return FALSE; pFormat->index.nvalues = num; - pFormat->index.pValues = xalloc (num * sizeof (xIndexValue)); + pFormat->index.pValues = malloc (num * sizeof (xIndexValue)); if (!pFormat->index.pValues) { free (pIndexed); diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 1e653b0c3..1131696d5 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -365,7 +365,7 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) } - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); + pFormats = (PictFormatPtr) malloc (nformats * sizeof (PictFormatRec)); if (!pFormats) return 0; memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); @@ -689,7 +689,7 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats) } formats[n].format = PICT_FORMAT(0,type,a,r,g,b); } - ps = (PictureScreenPtr) xalloc (sizeof (PictureScreenRec)); + ps = (PictureScreenPtr) malloc (sizeof (PictureScreenRec)); if (!ps) { free (formats); @@ -784,7 +784,7 @@ AllocatePicture (ScreenPtr pScreen) unsigned int size; int i; - pPicture = (PicturePtr) xalloc (ps->totalPictureSize); + pPicture = (PicturePtr) malloc (ps->totalPictureSize); if (!pPicture) return 0; ppriv = (DevUnion *)(pPicture + 1); @@ -961,7 +961,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, dpos = stopPoints[i]; } - pGradient->linear.stops = xalloc(stopCount*sizeof(PictGradientStop)); + pGradient->linear.stops = malloc(stopCount*sizeof(PictGradientStop)); if (!pGradient->linear.stops) { *error = BadAlloc; return; @@ -980,7 +980,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); + pPicture = (PicturePtr) malloc(sizeof(PictureRec)); pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1000,7 +1000,7 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictSolidFill)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1034,7 +1034,7 @@ CreateLinearGradientPicture (Picture pid, xPointFixed *p1, xPointFixed *p2, } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictLinearGradient)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1083,7 +1083,7 @@ CreateRadialGradientPicture (Picture pid, xPointFixed *inner, xPointFixed *outer } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictRadialGradient)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1134,7 +1134,7 @@ CreateConicalGradientPicture (Picture pid, xPointFixed *center, xFixed angle, } pPicture->id = pid; - pPicture->pSourcePict = (SourcePictPtr) xalloc(sizeof(PictConicalGradient)); + pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); if (!pPicture->pSourcePict) { *error = BadAlloc; free(pPicture); @@ -1477,7 +1477,7 @@ SetPictureTransform (PicturePtr pPicture, { if (!pPicture->transform) { - pPicture->transform = (PictTransform *) xalloc (sizeof (PictTransform)); + pPicture->transform = (PictTransform *) malloc (sizeof (PictTransform)); if (!pPicture->transform) return BadAlloc; } diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 58b3dbc88..c6cb7bce7 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -413,7 +413,7 @@ ProcRenderQueryPictFormats (ClientPtr client) ndepth * sizeof (xPictDepth) + nvisual * sizeof (xPictVisual) + numSubpixel * sizeof (CARD32)); - reply = (xRenderQueryPictFormatsReply *) xalloc (rlength); + reply = (xRenderQueryPictFormatsReply *) malloc (rlength); if (!reply) return BadAlloc; memset(reply, 0, rlength); @@ -588,7 +588,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) num = pFormat->index.nvalues; rlength = (sizeof (xRenderQueryPictIndexValuesReply) + num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) xalloc (rlength); + reply = (xRenderQueryPictIndexValuesReply *) malloc (rlength); if (!reply) return BadAlloc; @@ -1139,7 +1139,7 @@ ProcRenderAddGlyphs (ClientPtr client) glyphsBase = glyphsLocal; else { - glyphsBase = (GlyphNewPtr) Xalloc (nglyphs * sizeof (GlyphNewRec)); + glyphsBase = (GlyphNewPtr) malloc (nglyphs * sizeof (GlyphNewRec)); if (!glyphsBase) return BadAlloc; } @@ -1533,19 +1533,19 @@ ProcRenderCreateCursor (ClientPtr client) if ( stuff->x > width || stuff->y > height ) return (BadMatch); - argbbits = xalloc (width * height * sizeof (CARD32)); + argbbits = malloc (width * height * sizeof (CARD32)); if (!argbbits) return (BadAlloc); stride = BitmapBytePad(width); nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); + srcbits = (unsigned char *)malloc(nbytes_mono); if (!srcbits) { free (argbbits); return (BadAlloc); } - mskbits = (unsigned char *)xalloc(nbytes_mono); + mskbits = (unsigned char *)malloc(nbytes_mono); if (!mskbits) { free(argbbits); @@ -1748,7 +1748,7 @@ ProcRenderQueryFilters (ClientPtr client) } len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2); total_bytes = sizeof (xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) xalloc (total_bytes); + reply = (xRenderQueryFiltersReply *) malloc (total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); @@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) if (client->req_len & 1) return BadLength; ncursor = (client->req_len - (SIZEOF(xRenderCreateAnimCursorReq) >> 2)) >> 1; - cursors = xalloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); + cursors = malloc (ncursor * (sizeof (CursorPtr) + sizeof (CARD32))); if (!cursors) return BadAlloc; deltas = (CARD32 *) (cursors + ncursor); @@ -2681,7 +2681,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) return BadDrawable; - if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes)))) + if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; newPict->type = XRT_PICTURE; newPict->info[0].id = stuff->pid; -- cgit v1.2.3 From 74a5450bc058354e55c1589e64ef8e73775cebc4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 26 Jun 2016 02:08:32 +0200 Subject: nx-X11/programs/Xserver: Drop {X,x}realloc() macros, use realloc() instead. --- nx-X11/programs/Xserver/render/filter.c | 6 +++--- nx-X11/programs/Xserver/render/glyph.c | 2 +- nx-X11/programs/Xserver/render/picture.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 065ffa682..10e732997 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -68,7 +68,7 @@ PictureGetFilterId (char *filter, int len, Bool makeit) memcpy (name, filter, len); name[len] = '\0'; if (filterNames) - names = xrealloc (filterNames, (nfilterNames + 1) * sizeof (char *)); + names = realloc (filterNames, (nfilterNames + 1) * sizeof (char *)); else names = malloc (sizeof (char *)); if (!names) @@ -144,7 +144,7 @@ PictureAddFilter (ScreenPtr pScreen, if (ps->filters[i].id == id) return -1; if (ps->filters) - filters = xrealloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec)); + filters = realloc (ps->filters, (ps->nfilters + 1) * sizeof (PictFilterRec)); else filters = malloc (sizeof (PictFilterRec)); if (!filters) @@ -175,7 +175,7 @@ PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias) PictFilterAliasPtr aliases; if (ps->filterAliases) - aliases = xrealloc (ps->filterAliases, + aliases = realloc (ps->filterAliases, (ps->nfilterAliases + 1) * sizeof (PictFilterAliasRec)); else diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 4cba50d0f..2ef1087e7 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -117,7 +117,7 @@ _GlyphSetSetNewPrivate (GlyphSetPtr glyphSet, int n, void * ptr) if (n > glyphSet->maxPrivate) { if (glyphSet->devPrivates && glyphSet->devPrivates != (void *)(&glyphSet[1])) { - new = (void **) xrealloc (glyphSet->devPrivates, + new = (void **) realloc (glyphSet->devPrivates, (n + 1) * sizeof (void *)); if (!new) return FALSE; diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 1131696d5..4a1cd98f5 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -82,7 +82,7 @@ AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount) { unsigned int *nsizes; - nsizes = (unsigned int *)xrealloc(ps->PicturePrivateSizes, + nsizes = (unsigned int *)realloc(ps->PicturePrivateSizes, (index2 + 1) * sizeof(unsigned int)); if (!nsizes) return FALSE; -- cgit v1.2.3 From 286d83260216e8e53db701eed5c785aae1c716bf Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 01:36:31 +0200 Subject: Use internal temp variable for swap macros. Make swaps/swapl type safe (introducing wrong_size check at build time). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While working on this changeset, various spots got discovered where swapl or swaps was used on a wrong type, where byte swapping calls had been forgotten or done on the wrong variable. This backport at least includes changes from the following X.org commits, listed in non-chronological order: commit 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 Author: Matt Turner Date: Thu Aug 4 15:35:41 2011 -0400 Use internal temp variable for swap macros Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris Signed-off-by: Matt Turner commit 9edcae78c46286baff42e74bfe26f6ae4d00fe01 Author: Matt Turner Date: Wed Sep 21 17:14:16 2011 -0400 Use correct swap{l,s} (or none at all for CARD8) Swapping the wrong size was never caught because swap{l,s} are macros. It's clear in the case of Xext/xres.c, that the author believed client_major/minor to be CARD16 from looking at the code in the first hunk. v2: dmx.c fixes from Keith. Reviewed-by: Peter Harris Signed-off-by: Matt Turner commit dab064fa5e0b1f5c67222562ad5367005832cba1 Author: Andrea Canciani Date: Tue Nov 2 20:10:32 2010 +0100 render: Fix byteswapping of gradient stops 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 Reviewed-by: Soren Sandmann Reviewed-by: Julien Cristau Signed-off-by: Keith Packard commit 54770c980cd2b91a8377f975a58ed69def5cfa42 Author: Matt Turner Date: Tue Aug 16 16:59:07 2011 -0400 Cast char* buffers to swap functions Reviewed-by: Peter Harris Signed-off-by: Matt Turner commit 6844bd2e63490870bab3c469eec6030354ef2865 Author: Alan Coopersmith Date: Wed Jan 9 19:52:00 2008 -0800 More Xv extension byte swapping fixes commit e46f6ddeccd082b2d507a1e8b57ea30e6b0a2c83 Author: Michel Dänzer Date: Wed Jan 16 14:24:22 2008 +0100 Yet another Xv extension byte swapping fix. --- nx-X11/programs/Xserver/render/render.c | 443 +++++++++++++++----------------- 1 file changed, 207 insertions(+), 236 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index c6cb7bce7..b97c63775 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -283,7 +283,7 @@ ProcRenderQueryVersion (ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient (client); xRenderQueryVersionReply rep; - register int n; + REQUEST(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq); @@ -298,10 +298,10 @@ ProcRenderQueryVersion (ClientPtr client) rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; rep.minorVersion = SERVER_RENDER_MINOR_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); return (client->noClientException); @@ -456,16 +456,16 @@ ProcRenderQueryPictFormats (ClientPtr client) pictForm->colormap = None; if (client->swapped) { - swapl (&pictForm->id, n); - swaps (&pictForm->direct.red, n); - swaps (&pictForm->direct.redMask, n); - swaps (&pictForm->direct.green, n); - swaps (&pictForm->direct.greenMask, n); - swaps (&pictForm->direct.blue, n); - swaps (&pictForm->direct.blueMask, n); - swaps (&pictForm->direct.alpha, n); - swaps (&pictForm->direct.alphaMask, n); - swapl (&pictForm->colormap, n); + swapl (&pictForm->id); + swaps (&pictForm->direct.red); + swaps (&pictForm->direct.redMask); + swaps (&pictForm->direct.green); + swaps (&pictForm->direct.greenMask); + swaps (&pictForm->direct.blue); + swaps (&pictForm->direct.blueMask); + swaps (&pictForm->direct.alpha); + swaps (&pictForm->direct.alphaMask); + swapl (&pictForm->colormap); } pictForm++; } @@ -495,8 +495,8 @@ ProcRenderQueryPictFormats (ClientPtr client) pictVisual->format = pFormat->id; if (client->swapped) { - swapl (&pictVisual->visual, n); - swapl (&pictVisual->format, n); + swapl (&pictVisual->visual); + swapl (&pictVisual->format); } pictVisual++; nvisual++; @@ -506,7 +506,7 @@ ProcRenderQueryPictFormats (ClientPtr client) pictDepth->nPictVisuals = nvisual; if (client->swapped) { - swaps (&pictDepth->nPictVisuals, n); + swaps (&pictDepth->nPictVisuals); } ndepth++; pictDepth = (xPictDepth *) pictVisual; @@ -519,8 +519,8 @@ ProcRenderQueryPictFormats (ClientPtr client) pictScreen->fallback = 0; if (client->swapped) { - swapl (&pictScreen->nDepth, n); - swapl (&pictScreen->fallback, n); + swapl (&pictScreen->nDepth); + swapl (&pictScreen->fallback); } pictScreen = (xPictScreen *) pictDepth; } @@ -536,20 +536,20 @@ ProcRenderQueryPictFormats (ClientPtr client) *pictSubpixel = SubPixelUnknown; if (client->swapped) { - swapl (pictSubpixel, n); + swapl (pictSubpixel); } ++pictSubpixel; } if (client->swapped) { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numFormats, n); - swapl (&reply->numScreens, n); - swapl (&reply->numDepths, n); - swapl (&reply->numVisuals, n); - swapl (&reply->numSubpixel, n); + swaps (&reply->sequenceNumber); + swapl (&reply->length); + swapl (&reply->numFormats); + swapl (&reply->numScreens); + swapl (&reply->numDepths); + swapl (&reply->numVisuals); + swapl (&reply->numSubpixel); } WriteToClient(client, rlength, (char *) reply); free (reply); @@ -563,7 +563,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) PictFormatPtr pFormat; int num; int rlength; - int i, n; + int i; REQUEST(xRenderQueryPictIndexValuesReq); xRenderQueryPictIndexValuesReply *reply; xIndexValue *values; @@ -605,15 +605,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client) { for (i = 0; i < num; i++) { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); + swapl (&values[i].pixel); + swaps (&values[i].red); + swaps (&values[i].green); + swaps (&values[i].blue); + swaps (&values[i].alpha); } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); + swaps (&reply->sequenceNumber); + swapl (&reply->length); + swapl (&reply->numIndexValues); } WriteToClient(client, rlength, (char *) reply); @@ -1807,16 +1807,14 @@ ProcRenderQueryFilters (ClientPtr client) if (client->swapped) { - register int n; - for (i = 0; i < reply->numAliases; i++) { - swaps (&aliases[i], n); + swaps (&aliases[i]); } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swapl(&reply->numAliases); + swapl(&reply->numFilters); } WriteToClient(client, total_bytes, (char *) reply); free (reply); @@ -2039,34 +2037,31 @@ ProcRenderDispatch (ClientPtr client) static int SProcRenderQueryVersion (ClientPtr client) { - register int n; REQUEST(xRenderQueryVersionReq); REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swaps(&stuff->length); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcRenderVector[stuff->renderReqType])(client); } static int SProcRenderQueryPictFormats (ClientPtr client) { - register int n; REQUEST(xRenderQueryPictFormatsReq); REQUEST_SIZE_MATCH(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryPictIndexValues (ClientPtr client) { - register int n; REQUEST(xRenderQueryPictIndexValuesReq); REQUEST_AT_LEAST_SIZE(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); + swaps(&stuff->length); + swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2079,14 +2074,13 @@ SProcRenderQueryDithers (ClientPtr client) static int SProcRenderCreatePicture (ClientPtr client) { - register int n; REQUEST(xRenderCreatePictureReq); REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->drawable); + swapl(&stuff->format); + swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2094,12 +2088,11 @@ SProcRenderCreatePicture (ClientPtr client) static int SProcRenderChangePicture (ClientPtr client) { - register int n; REQUEST(xRenderChangePictureReq); REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2107,11 +2100,10 @@ SProcRenderChangePicture (ClientPtr client) static int SProcRenderSetPictureClipRectangles (ClientPtr client) { - register int n; REQUEST(xRenderSetPictureClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); + swaps(&stuff->length); + swapl(&stuff->picture); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2119,68 +2111,64 @@ SProcRenderSetPictureClipRectangles (ClientPtr client) static int SProcRenderFreePicture (ClientPtr client) { - register int n; REQUEST(xRenderFreePictureReq); REQUEST_SIZE_MATCH(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); + swaps(&stuff->length); + swapl(&stuff->picture); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderComposite (ClientPtr client) { - register int n; REQUEST(xRenderCompositeReq); REQUEST_SIZE_MATCH(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->mask); + swapl(&stuff->dst); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); + swaps(&stuff->xMask); + swaps(&stuff->yMask); + swaps(&stuff->xDst); + swaps(&stuff->yDst); + swaps(&stuff->width); + swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderScale (ClientPtr client) { - register int n; REQUEST(xRenderScaleReq); REQUEST_SIZE_MATCH(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->colorScale); + swapl(&stuff->alphaScale); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); + swaps(&stuff->xDst); + swaps(&stuff->yDst); + swaps(&stuff->width); + swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderTrapezoids (ClientPtr client) { - register int n; REQUEST(xRenderTrapezoidsReq); REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2188,16 +2176,15 @@ SProcRenderTrapezoids (ClientPtr client) static int SProcRenderTriangles (ClientPtr client) { - register int n; REQUEST(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2205,16 +2192,15 @@ SProcRenderTriangles (ClientPtr client) static int SProcRenderTriStrip (ClientPtr client) { - register int n; REQUEST(xRenderTriStripReq); REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2222,16 +2208,15 @@ SProcRenderTriStrip (ClientPtr client) static int SProcRenderTriFan (ClientPtr client) { - register int n; REQUEST(xRenderTriFanReq); REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps (&stuff->length); + swapl (&stuff->src); + swapl (&stuff->dst); + swapl (&stuff->maskFormat); + swaps (&stuff->xSrc); + swaps (&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2257,51 +2242,47 @@ SProcRenderTransform (ClientPtr client) static int SProcRenderCreateGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderCreateGlyphSetReq); REQUEST_SIZE_MATCH(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); + swaps(&stuff->length); + swapl(&stuff->gsid); + swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderReferenceGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderReferenceGlyphSetReq); REQUEST_SIZE_MATCH(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); + swaps(&stuff->length); + swapl(&stuff->gsid); + swapl(&stuff->existing); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderFreeGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderFreeGlyphSetReq); REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderAddGlyphs (ClientPtr client) { - register int n; register int i; CARD32 *gids; void *end; xGlyphInfo *gi; REQUEST(xRenderAddGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); + swapl(&stuff->nglyphs); if (stuff->nglyphs & 0xe0000000) return BadLength; end = (CARD8 *) stuff + (client->req_len << 2); @@ -2313,13 +2294,13 @@ SProcRenderAddGlyphs (ClientPtr client) return BadLength; for (i = 0; i < stuff->nglyphs; i++) { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); + swapl (&gids[i]); + swaps (&gi[i].width); + swaps (&gi[i].height); + swaps (&gi[i].x); + swaps (&gi[i].y); + swaps (&gi[i].xOff); + swaps (&gi[i].yOff); } return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2333,11 +2314,10 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client) static int SProcRenderFreeGlyphs (ClientPtr client) { - register int n; REQUEST(xRenderFreeGlyphsReq); REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2345,7 +2325,6 @@ SProcRenderFreeGlyphs (ClientPtr client) static int SProcRenderCompositeGlyphs (ClientPtr client) { - register int n; xGlyphElt *elt; CARD8 *buffer; CARD8 *end; @@ -2362,13 +2341,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) case X_RenderCompositeGlyphs32: size = 4; break; } - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->maskFormat); + swapl(&stuff->glyphset); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); buffer = (CARD8 *) (stuff + 1); end = (CARD8 *) stuff + (client->req_len << 2); while (buffer + sizeof (xGlyphElt) < end) @@ -2376,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) elt = (xGlyphElt *) buffer; buffer += sizeof (xGlyphElt); - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); + swaps (&elt->deltax); + swaps (&elt->deltay); i = elt->len; if (i == 0xff) { - swapl (buffer, n); + swapl ((int *) buffer); buffer += 4; } else @@ -2395,14 +2374,14 @@ SProcRenderCompositeGlyphs (ClientPtr client) case 2: while (i--) { - swaps (buffer, n); + swaps ((short *) buffer); buffer += 2; } break; case 4: while (i--) { - swapl (buffer, n); + swapl ((int *) buffer); buffer += 4; } break; @@ -2417,16 +2396,15 @@ SProcRenderCompositeGlyphs (ClientPtr client) static int SProcRenderFillRectangles (ClientPtr client) { - register int n; REQUEST(xRenderFillRectanglesReq); REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); + swaps(&stuff->length); + swapl(&stuff->dst); + swaps(&stuff->color.red); + swaps(&stuff->color.green); + swaps(&stuff->color.blue); + swaps(&stuff->color.alpha); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2434,73 +2412,68 @@ SProcRenderFillRectangles (ClientPtr client) static int SProcRenderCreateCursor (ClientPtr client) { - register int n; REQUEST(xRenderCreateCursorReq); REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); + swaps(&stuff->length); + swapl(&stuff->cid); + swapl(&stuff->src); + swaps(&stuff->x); + swaps(&stuff->y); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureTransform (ClientPtr client) { - register int n; REQUEST(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swapl(&stuff->transform.matrix11); + swapl(&stuff->transform.matrix12); + swapl(&stuff->transform.matrix13); + swapl(&stuff->transform.matrix21); + swapl(&stuff->transform.matrix22); + swapl(&stuff->transform.matrix23); + swapl(&stuff->transform.matrix31); + swapl(&stuff->transform.matrix32); + swapl(&stuff->transform.matrix33); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryFilters (ClientPtr client) { - register int n; REQUEST (xRenderQueryFiltersReq); REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); + swaps(&stuff->length); + swapl(&stuff->drawable); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureFilter (ClientPtr client) { - register int n; REQUEST (xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swaps(&stuff->nbytes); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateAnimCursor (ClientPtr client) { - register int n; REQUEST (xRenderCreateAnimCursorReq); REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - swaps(&stuff->length, n); - swapl(&stuff->cid, n); + swaps(&stuff->length); + swapl(&stuff->cid); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2508,14 +2481,13 @@ SProcRenderCreateAnimCursor (ClientPtr client) static int SProcRenderAddTraps (ClientPtr client) { - register int n; REQUEST (xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOff, n); - swaps(&stuff->yOff, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swaps(&stuff->xOff); + swaps(&stuff->yOff); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2523,49 +2495,50 @@ SProcRenderAddTraps (ClientPtr client) static int SProcRenderCreateSolidFill(ClientPtr client) { - register int n; REQUEST (xRenderCreateSolidFillReq); REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swaps(&stuff->color.alpha, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swaps(&stuff->color.alpha); + swaps(&stuff->color.red); + swaps(&stuff->color.green); + swaps(&stuff->color.blue); return (*ProcRenderVector[stuff->renderReqType]) (client); } static void swapStops(void *stuff, int num) { - int i, n; + int i; CARD32 *stops; + CARD16 *colors; + stops = (CARD32 *)(stuff); for (i = 0; i < num; ++i) { - swapl(stops, n); + swapl(stops); ++stops; } + colors = (CARD16 *) (stops); for (i = 0; i < 4*num; ++i) { - swaps(stops, n); - ++stops; + swaps(colors); + ++colors; } } static int SProcRenderCreateLinearGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateLinearGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->p1.x, n); - swapl(&stuff->p1.y, n); - swapl(&stuff->p2.x, n); - swapl(&stuff->p2.y, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->p1.x); + swapl(&stuff->p1.y); + swapl(&stuff->p2.x); + swapl(&stuff->p2.y); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) @@ -2581,20 +2554,19 @@ SProcRenderCreateLinearGradient (ClientPtr client) static int SProcRenderCreateRadialGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateRadialGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->inner.x, n); - swapl(&stuff->inner.y, n); - swapl(&stuff->outer.x, n); - swapl(&stuff->outer.y, n); - swapl(&stuff->inner_radius, n); - swapl(&stuff->outer_radius, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->inner.x); + swapl(&stuff->inner.y); + swapl(&stuff->outer.x); + swapl(&stuff->outer.y); + swapl(&stuff->inner_radius); + swapl(&stuff->outer_radius); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) @@ -2610,17 +2582,16 @@ SProcRenderCreateRadialGradient (ClientPtr client) static int SProcRenderCreateConicalGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateConicalGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->center.x, n); - swapl(&stuff->center.y, n); - swapl(&stuff->angle, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->center.x); + swapl(&stuff->center.y); + swapl(&stuff->angle); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) -- cgit v1.2.3 From 89499350173da693a0dfa60101b313a73da60fda Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 14:28:49 +0200 Subject: Xserver: Post-REGION-macros-to-inline-funcs clean-up. --- nx-X11/programs/Xserver/render/mipict.c | 1 - 1 file changed, 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index 5bd449d44..d2420ea87 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -129,7 +129,6 @@ miValidatePicture (PicturePtr pPicture, Mask mask) { DrawablePtr pDrawable = pPicture->pDrawable; - ScreenPtr pScreen = pDrawable->pScreen; if ((mask & (CPClipXOrigin|CPClipYOrigin|CPClipMask|CPSubwindowMode)) || (pDrawable->serialNumber != (pPicture->serialNumber & DRAWABLE_SERIAL_BITS))) -- cgit v1.2.3 From f6a1bda2dff0c70aa13f3cb763a9b08c4c037c53 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 4 Jul 2016 00:28:47 +0200 Subject: Remove unneccesary casts from WriteToClient calls Casting return to (void) was used to tell lint that you intended to ignore the return value, so it didn't warn you about it. Casting the third argument to (char *) was used as the most generic pointer type in the days before compilers supported C89 (void *) (except for a couple places it's used for byte-sized pointer math). Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/render/render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index b97c63775..764874507 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -303,7 +303,7 @@ ProcRenderQueryVersion (ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xRenderQueryVersionReply), &rep); return (client->noClientException); } #endif /* NXAGENT_SERVER */ @@ -551,7 +551,7 @@ ProcRenderQueryPictFormats (ClientPtr client) swapl (&reply->numVisuals); swapl (&reply->numSubpixel); } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free (reply); return client->noClientException; } @@ -616,7 +616,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) swapl (&reply->numIndexValues); } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free(reply); return (client->noClientException); } @@ -1816,7 +1816,7 @@ ProcRenderQueryFilters (ClientPtr client) swapl(&reply->numAliases); swapl(&reply->numFilters); } - WriteToClient(client, total_bytes, (char *) reply); + WriteToClient(client, total_bytes, reply); free (reply); return(client->noClientException); -- cgit v1.2.3 From fa651994740d4381d8a8ab72e2ac3ef38fba3dde Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 4 Jul 2016 21:11:21 +0200 Subject: remove unreferenced NEED_EVENTS/NEED_REPLIES Remove defines of NEED_EVENTS and NEED_REPLIES because they are never used anywhere. Basically these three commits, but as they are newer and to not match the code structure the patches have not been applied but replaced by sed + manual intervention: From cb95642dc8edebb2935dd471f8b339cb98aa8481 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 28 Nov 2008 22:28:32 +1000 Subject: Remove #define NEED_EVENTS and NEED_REPLIES A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer Signed-off-by: Adam Jackson -- From 6de368c9aa7ccd2fcd62fca5a2b278913db4d03d Mon Sep 17 00:00:00 2001 From: Fernando Carrijo Date: Thu, 1 Jul 2010 06:50:47 -0300 Subject: Purge macros NEED_EVENTS and NEED_REPLIES Signed-off-by: Fernando Carrijo Acked-by: Tiago Vignatti Reviewed-by: Alan Coopersmith -- From 57c03e52e6b4e3ed54df5fdd778865467d08e119 Mon Sep 17 00:00:00 2001 From: Fernando Carrijo Date: Thu, 1 Jul 2010 06:59:48 -0300 Subject: Purge macro NEED_EVENTS Signed-off-by: Fernando Carrijo Acked-by: Tiago Vignatti Reviewed-by: Alan Coopersmith --- nx-X11/programs/Xserver/render/render.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 764874507..d2312aaef 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -24,8 +24,6 @@ * Author: Keith Packard, SuSE, Inc. */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include #endif -- cgit v1.2.3 From 6144b615dd7ae2acd786aaa08f66c9743870b709 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 5 Jul 2016 16:32:57 +0200 Subject: VCS info lines: Remove ancient X.org / XFree86 VCS info line from code files. This has already been started while replacing copyright info in file headers and has now been completed with this commit. --- nx-X11/programs/Xserver/render/render.c | 1 - 1 file changed, 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index d2312aaef..2eba16a4e 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1,4 +1,3 @@ -/* $XdotOrg: xc/programs/Xserver/render/render.c,v 1.12 2005/08/28 19:47:39 ajax Exp $ */ /* * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $ * -- cgit v1.2.3 From fcf61d3411bc1868e53305a3777f4bcaab3eb4bd Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 29 Oct 2016 15:30:20 +0200 Subject: Imakefile cleanup: Delete all ancient Vcs comments stemming from SVN times of X.org and XFree86. Fixes ArcticaProject/nx-libs#250. --- nx-X11/programs/Xserver/render/Imakefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 6c3a7880c..0fe78340d 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -1,5 +1,3 @@ -XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 keithp Exp $ - NULL = #include -- cgit v1.2.3 From 508d2deae98846111299a3693033a507010e3c91 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 29 Oct 2016 11:28:02 +0200 Subject: Remove libcwrapper usage from xorg server modules. The libcwrapper is not used in nxagent. From c3d14036729fd186d4ec7ca1de603e1f2d174e2f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 10 Feb 2006 22:00:30 +0000 Subject: Remove libcwrapper usage from xorg server modules. The libcwrapper is only of (marginal) use in the drivers, and that usage remains. Backported-to-NX-by: Mike Gabriel Fixes ArcticaProject/nx-libs#246 (together with merge commit ecd335fa61551d0b86d3f075469a7743ab899d95). --- nx-X11/programs/Xserver/render/render.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 2eba16a4e..774dcc8ec 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -45,9 +45,6 @@ #include "glyphstr.h" #include #include "cursorstr.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif #include "protocol-versions.h" -- cgit v1.2.3 From 2d45d8d805df95f7277d333e026a008dbd07f479 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 15 Nov 2016 22:03:39 +0100 Subject: drop platform support: unifdef sgi. Relates to ArcticaProject/nx-libs#275. --- nx-X11/programs/Xserver/render/picture.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/picture.h b/nx-X11/programs/Xserver/render/picture.h index b09d9aac2..6f3f2d832 100644 --- a/nx-X11/programs/Xserver/render/picture.h +++ b/nx-X11/programs/Xserver/render/picture.h @@ -173,8 +173,7 @@ typedef __int64 xFixed_32_32; defined(ia64) || defined(__ia64__) || \ defined(__sparc64__) || \ defined(__s390x__) || \ - defined(amd64) || defined (__amd64__) || \ - (defined(sgi) && (_MIPS_SZLONG == 64)) + defined(amd64) || defined (__amd64__) typedef long xFixed_32_32; # else # if defined(__GNUC__) && \ -- cgit v1.2.3 From 104a3e9e2dbafd31e7b1def3686d052a356fc74a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 15 Feb 2017 09:59:00 +0100 Subject: Naming change: Security*Access -> Dix*Access Backported from X.org: commit 6c46645cfc1afda8aeabfe0ed4d9342673b702f1 Author: Eamon Walsh Date: Thu Dec 14 14:45:42 2006 -0500 Naming change: Security*Access -> Dix*Access Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/render/picture.c | 4 +- nx-X11/programs/Xserver/render/render.c | 122 +++++++++++++++---------------- 2 files changed, 63 insertions(+), 63 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 4a1cd98f5..862ae0031 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1210,7 +1210,7 @@ ChangePicture (PicturePtr pPicture, pAlpha = (PicturePtr) SecurityLookupIDByType(client, pid, PictureType, - SecurityWriteAccess|SecurityReadAccess); + DixWriteAccess|DixReadAccess); if (!pAlpha) { client->errorValue = pid; @@ -1271,7 +1271,7 @@ ChangePicture (PicturePtr pPicture, pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pid, RT_PIXMAP, - SecurityReadAccess); + DixReadAccess); if (!pPixmap) { client->errorValue = pid; diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 774dcc8ec..abc26b5d9 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -567,7 +567,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { @@ -636,11 +636,11 @@ ProcRenderCreatePicture (ClientPtr client) LEGAL_NEW_RESOURCE(stuff->pid, client); SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); + DixWriteAccess); pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->format; @@ -674,7 +674,7 @@ ProcRenderChangePicture (ClientPtr client) int len; REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); @@ -694,7 +694,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) int result; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -721,7 +721,7 @@ ProcRenderFreePicture (ClientPtr client) REQUEST_SIZE_MATCH(xRenderFreePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess, RenderErrBase + BadPicture); FreeResource (stuff->picture, RT_NONE); return(client->noClientException); @@ -752,13 +752,13 @@ ProcRenderComposite (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, + VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) @@ -800,9 +800,9 @@ ProcRenderTrapezoids (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -813,7 +813,7 @@ ProcRenderTrapezoids (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -848,9 +848,9 @@ ProcRenderTriangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -861,7 +861,7 @@ ProcRenderTriangles (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -895,9 +895,9 @@ ProcRenderTriStrip (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -908,7 +908,7 @@ ProcRenderTriStrip (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -942,9 +942,9 @@ ProcRenderTriFan (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -955,7 +955,7 @@ ProcRenderTriFan (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -1008,7 +1008,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) format = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!format) { client->errorValue = stuff->format; @@ -1056,7 +1056,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->existing, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->existing; @@ -1083,7 +1083,7 @@ ProcRenderFreeGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityDestroyAccess); + DixDestroyAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1118,7 +1118,7 @@ ProcRenderAddGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1223,7 +1223,7 @@ ProcRenderFreeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1278,9 +1278,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1291,7 +1291,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -1304,7 +1304,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1366,7 +1366,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, gs, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = gs; @@ -1447,7 +1447,7 @@ ProcRenderFillRectangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1515,7 +1515,7 @@ ProcRenderCreateCursor (ClientPtr client) REQUEST_SIZE_MATCH (xRenderCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); if (!pSrc->pDrawable) return BadDrawable; @@ -1699,7 +1699,7 @@ ProcRenderSetPictureTransform (ClientPtr client) int result; REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); if (client->noClientException != Success) @@ -1726,7 +1726,7 @@ ProcRenderQueryFilters (ClientPtr client) char *names; REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); + SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, DixReadAccess); pScreen = pDrawable->pScreen; nbytesName = 0; @@ -1828,7 +1828,7 @@ ProcRenderSetPictureFilter (ClientPtr client) char *name; REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); name = (char *) (stuff + 1); params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); @@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) for (i = 0; i < ncursor; i++) { cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursors[i]) { free (cursors); @@ -1891,7 +1891,7 @@ ProcRenderAddTraps (ClientPtr client) REQUEST(xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -2644,7 +2644,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; @@ -2686,7 +2686,7 @@ PanoramiXRenderChangePicture (ClientPtr client) REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2707,7 +2707,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2728,7 +2728,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2749,7 +2749,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2772,7 +2772,7 @@ PanoramiXRenderFreePicture (ClientPtr client) client->errorValue = stuff->picture; - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess, RenderErrBase + BadPicture); @@ -2798,11 +2798,11 @@ PanoramiXRenderComposite (ClientPtr client) REQUEST_SIZE_MATCH(xRenderCompositeReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, + VERIFY_XIN_ALPHA (msk, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); orig = *stuff; @@ -2846,9 +2846,9 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client) INT16 xSrc, ySrc; REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + @@ -2889,7 +2889,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) int extra_len; REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); if (extra_len && @@ -2936,9 +2936,9 @@ PanoramiXRenderTrapezoids(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); @@ -2998,9 +2998,9 @@ PanoramiXRenderTriangles(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); @@ -3056,9 +3056,9 @@ PanoramiXRenderTriStrip(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTriStripReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); @@ -3110,9 +3110,9 @@ PanoramiXRenderTriFan(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTriFanReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); @@ -3166,7 +3166,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); @@ -3210,7 +3210,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); @@ -3256,7 +3256,7 @@ PanoramiXRenderAddTraps (ClientPtr client) INT16 x_off, y_off; REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - VERIFY_XIN_PICTURE (picture, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); if (extra_len && -- cgit v1.2.3 From 1a7fc41c2c011c05c3dc0cd8eb4ade98a2186217 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan <ïonic@ionic.de> Date: Wed, 20 Jul 2016 02:41:03 +0000 Subject: misc nx-X11/programs/Xserver/{hw/nxagent,miext,render}/: move code around so that we can drop nx-X11/programs/Xserver/render/miglyph.c (and by extension nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.) This is essentially a bastardized cross/backport of these X.Org commits - based on our current architecture: commit 4b14c9a9cd2033d3839c4ba364d41ab4c4b198ab Author: Eric Anholt Date: Fri Oct 19 16:34:54 2007 -0700 Replace calls to Glyphs screen hook with CompositeGlyphs and remove dead code. Not all of the DDX/miext Glyphs hook implementations have been removed, but they should be. and commit 2251572062b2c25643671b8d5070de1c3f7ae976 Author: Aaron Plattner Date: Fri Oct 26 15:13:50 2007 -0700 Restore the CompositeGlyphs -> ps->Glyphs -> miGlyphs callchain to allow acceleration architectures to wrap above miGlyphs. Conflicts: nx-X11/programs/Xserver/render/miglyph.c nx-X11/programs/Xserver/render/mipict.h nx-X11/programs/Xserver/render/picture.c --- nx-X11/programs/Xserver/render/Imakefile | 2 - nx-X11/programs/Xserver/render/glyph.c | 207 ++++++++++++++++++++++++++ nx-X11/programs/Xserver/render/miglyph.c | 245 ------------------------------- nx-X11/programs/Xserver/render/mipict.h | 6 - nx-X11/programs/Xserver/render/picture.c | 26 +--- 5 files changed, 210 insertions(+), 276 deletions(-) delete mode 100644 nx-X11/programs/Xserver/render/miglyph.c (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/Imakefile b/nx-X11/programs/Xserver/render/Imakefile index 0fe78340d..235acf1ed 100644 --- a/nx-X11/programs/Xserver/render/Imakefile +++ b/nx-X11/programs/Xserver/render/Imakefile @@ -5,14 +5,12 @@ #if (!(defined(NXAgentServer) && NXAgentServer)) NXAGENT_SKIP_SRCS = \ glyph.c \ - miglyph.c \ mitrap.c \ picture.c \ render.c \ $(NULL) NXAGENT_SKIP_OBJS = \ glyph.o \ - miglyph.o \ mitrap.o \ picture.o \ render.o \ diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index 2ef1087e7..d3bfae760 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -42,6 +42,7 @@ #include "servermd.h" #include "picturestr.h" #include "glyphstr.h" +#include "mipict.h" #include @@ -489,3 +490,209 @@ FreeGlyphSet (void *value, } return Success; } + +void +GlyphExtents(int nlist, GlyphListPtr list, GlyphPtr * glyphs, BoxPtr extents) +{ + int x1, x2, y1, y2; + int n; + GlyphPtr glyph; + int x, y; + + x = 0; + y = 0; + extents->x1 = MAXSHORT; + extents->x2 = MINSHORT; + extents->y1 = MAXSHORT; + extents->y2 = MINSHORT; + while (nlist--) { + x += list->xOff; + y += list->yOff; + n = list->len; + list++; + while (n--) { + glyph = *glyphs++; + x1 = x - glyph->info.x; + if (x1 < MINSHORT) + x1 = MINSHORT; + y1 = y - glyph->info.y; + if (y1 < MINSHORT) + y1 = MINSHORT; + x2 = x1 + glyph->info.width; + if (x2 > MAXSHORT) + x2 = MAXSHORT; + y2 = y1 + glyph->info.height; + if (y2 > MAXSHORT) + y2 = MAXSHORT; + if (x1 < extents->x1) + extents->x1 = x1; + if (x2 > extents->x2) + extents->x2 = x2; + if (y1 < extents->y1) + extents->y1 = y1; + if (y2 > extents->y2) + extents->y2 = y2; + x += glyph->info.xOff; + y += glyph->info.yOff; + } + } +} + +#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) + +void +CompositeGlyphs(CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, int nlist, GlyphListPtr lists, GlyphPtr * glyphs) +{ + PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); + + ValidatePicture(pSrc); + ValidatePicture(pDst); + (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, + glyphs); +} + +#ifndef NXAGENT_SERVER +void +miGlyphs(CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) +{ + PixmapPtr pPixmap = 0; + PicturePtr pPicture; + PixmapPtr pMaskPixmap = 0; + PicturePtr pMask; + ScreenPtr pScreen = pDst->pDrawable->pScreen; + int width = 0, height = 0; + int x, y; + int xDst = list->xOff, yDst = list->yOff; + int n; + GlyphPtr glyph; + int error; + BoxRec extents; + CARD32 component_alpha; + + if (maskFormat) { + GCPtr pGC; + xRectangle rect; + + GlyphExtents(nlist, list, glyphs, &extents); + + if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) + return; + width = extents.x2 - extents.x1; + height = extents.y2 - extents.y1; + pMaskPixmap = + (*pScreen->CreatePixmap) (pScreen, width, height, + maskFormat->depth); + if (!pMaskPixmap) + return; + component_alpha = NeedsComponent(maskFormat->format); + pMask = CreatePicture(0, &pMaskPixmap->drawable, + maskFormat, CPComponentAlpha, &component_alpha, + serverClient, &error); + if (!pMask) { + (*pScreen->DestroyPixmap) (pMaskPixmap); + return; + } + pGC = GetScratchGC(pMaskPixmap->drawable.depth, pScreen); + ValidateGC(&pMaskPixmap->drawable, pGC); + rect.x = 0; + rect.y = 0; + rect.width = width; + rect.height = height; + (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); + FreeScratchGC(pGC); + x = -extents.x1; + y = -extents.y1; + } + else { + pMask = pDst; + x = 0; + y = 0; + } + pPicture = 0; + while (nlist--) { + x += list->xOff; + y += list->yOff; + n = list->len; + while (n--) { + glyph = *glyphs++; + if (!pPicture) { + pPixmap = + GetScratchPixmapHeader(pScreen, glyph->info.width, + glyph->info.height, + list->format->depth, + list->format->depth, 0, + (void *) (glyph + 1)); + if (!pPixmap) + return; + component_alpha = NeedsComponent(list->format->format); + pPicture = CreatePicture(0, &pPixmap->drawable, list->format, + CPComponentAlpha, &component_alpha, + serverClient, &error); + if (!pPicture) { + FreeScratchPixmapHeader(pPixmap); + return; + } + } + (*pScreen->ModifyPixmapHeader) (pPixmap, + glyph->info.width, + glyph->info.height, 0, 0, -1, + (void *) (glyph + 1)); + pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; + if (maskFormat) { + CompositePicture(PictOpAdd, + pPicture, + None, + pMask, + 0, 0, + 0, 0, + x - glyph->info.x, + y - glyph->info.y, + glyph->info.width, glyph->info.height); + } + else { + CompositePicture(op, + pSrc, + pPicture, + pDst, + xSrc + (x - glyph->info.x) - xDst, + ySrc + (y - glyph->info.y) - yDst, + 0, 0, + x - glyph->info.x, + y - glyph->info.y, + glyph->info.width, glyph->info.height); + } + x += glyph->info.xOff; + y += glyph->info.yOff; + } + list++; + if (pPicture) { + FreeScratchPixmapHeader(pPixmap); + FreePicture((void *) pPicture, 0); + pPicture = 0; + pPixmap = 0; + } + } + if (maskFormat) { + x = extents.x1; + y = extents.y1; + CompositePicture(op, + pSrc, + pMask, + pDst, + xSrc + x - xDst, + ySrc + y - yDst, 0, 0, x, y, width, height); + FreePicture((void *) pMask, (XID) 0); + (*pScreen->DestroyPixmap) (pMaskPixmap); + } +} +#endif diff --git a/nx-X11/programs/Xserver/render/miglyph.c b/nx-X11/programs/Xserver/render/miglyph.c deleted file mode 100644 index f169c3bb7..000000000 --- a/nx-X11/programs/Xserver/render/miglyph.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/render/miglyph.c,v 1.4 2000/11/20 07:13:13 keithp Exp $ - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "scrnintstr.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "mi.h" -#include "picturestr.h" -#include "mipict.h" - -void -miGlyphExtents (int nlist, - GlyphListPtr list, - GlyphPtr *glyphs, - BoxPtr extents) -{ - int x1, x2, y1, y2; - int n; - GlyphPtr glyph; - int x, y; - - x = 0; - y = 0; - extents->x1 = MAXSHORT; - extents->x2 = MINSHORT; - extents->y1 = MAXSHORT; - extents->y2 = MINSHORT; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - list++; - while (n--) - { - glyph = *glyphs++; - x1 = x - glyph->info.x; - if (x1 < MINSHORT) - x1 = MINSHORT; - y1 = y - glyph->info.y; - if (y1 < MINSHORT) - y1 = MINSHORT; - x2 = x1 + glyph->info.width; - if (x2 > MAXSHORT) - x2 = MAXSHORT; - y2 = y1 + glyph->info.height; - if (y2 > MAXSHORT) - y2 = MAXSHORT; - if (x1 < extents->x1) - extents->x1 = x1; - if (x2 > extents->x2) - extents->x2 = x2; - if (y1 < extents->y1) - extents->y1 = y1; - if (y2 > extents->y2) - extents->y2 = y2; - x += glyph->info.xOff; - y += glyph->info.yOff; - } - } -} - -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - -#ifndef NXAGENT_SERVER -void -miGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr list, - GlyphPtr *glyphs) -{ - PixmapPtr pPixmap = 0; - PicturePtr pPicture; - PixmapPtr pMaskPixmap = 0; - PicturePtr pMask; - ScreenPtr pScreen = pDst->pDrawable->pScreen; - int width = 0, height = 0; - int x, y; - int xDst = list->xOff, yDst = list->yOff; - int n; - GlyphPtr glyph; - int error; - BoxRec extents; - CARD32 component_alpha; - - if (maskFormat) - { - GCPtr pGC; - xRectangle rect; - - miGlyphExtents (nlist, list, glyphs, &extents); - - if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) - return; - width = extents.x2 - extents.x1; - height = extents.y2 - extents.y1; - pMaskPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, maskFormat->depth); - if (!pMaskPixmap) - return; - component_alpha = NeedsComponent(maskFormat->format); - pMask = CreatePicture (0, &pMaskPixmap->drawable, - maskFormat, CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pMask) - { - (*pScreen->DestroyPixmap) (pMaskPixmap); - return; - } - pGC = GetScratchGC (pMaskPixmap->drawable.depth, pScreen); - ValidateGC (&pMaskPixmap->drawable, pGC); - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); - FreeScratchGC (pGC); - x = -extents.x1; - y = -extents.y1; - } - else - { - pMask = pDst; - x = 0; - y = 0; - } - pPicture = 0; - while (nlist--) - { - x += list->xOff; - y += list->yOff; - n = list->len; - while (n--) - { - glyph = *glyphs++; - if (!pPicture) - { - pPixmap = GetScratchPixmapHeader (pScreen, glyph->info.width, glyph->info.height, - list->format->depth, - list->format->depth, - 0, (void *) (glyph + 1)); - if (!pPixmap) - return; - component_alpha = NeedsComponent(list->format->format); - pPicture = CreatePicture (0, &pPixmap->drawable, list->format, - CPComponentAlpha, &component_alpha, - serverClient, &error); - if (!pPicture) - { - FreeScratchPixmapHeader (pPixmap); - return; - } - } - (*pScreen->ModifyPixmapHeader) (pPixmap, - glyph->info.width, glyph->info.height, - 0, 0, -1, (void *) (glyph + 1)); - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - if (maskFormat) - { - CompositePicture (PictOpAdd, - pPicture, - None, - pMask, - 0, 0, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - else - { - CompositePicture (op, - pSrc, - pPicture, - pDst, - xSrc + (x - glyph->info.x) - xDst, - ySrc + (y - glyph->info.y) - yDst, - 0, 0, - x - glyph->info.x, - y - glyph->info.y, - glyph->info.width, - glyph->info.height); - } - x += glyph->info.xOff; - y += glyph->info.yOff; - } - list++; - if (pPicture) - { - FreeScratchPixmapHeader (pPixmap); - FreePicture ((void *) pPicture, 0); - pPicture = 0; - pPixmap = 0; - } - } - if (maskFormat) - { - x = extents.x1; - y = extents.y1; - CompositePicture (op, - pSrc, - pMask, - pDst, - xSrc + x - xDst, - ySrc + y - yDst, - 0, 0, - x, y, - width, height); - FreePicture ((void *) pMask, (XID) 0); - (*pScreen->DestroyPixmap) (pMaskPixmap); - } -} -#endif diff --git a/nx-X11/programs/Xserver/render/mipict.h b/nx-X11/programs/Xserver/render/mipict.h index 726d8be65..c035a87f8 100644 --- a/nx-X11/programs/Xserver/render/mipict.h +++ b/nx-X11/programs/Xserver/render/mipict.h @@ -106,12 +106,6 @@ miComputeCompositeRegion (RegionPtr pRegion, Bool miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats); -void -miGlyphExtents (int nlist, - GlyphListPtr list, - GlyphPtr *glyphs, - BoxPtr extents); - void miGlyphs (CARD8 op, PicturePtr pSrc, diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 862ae0031..0d4c19969 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1793,29 +1793,9 @@ CompositePicture (CARD8 op, } void -CompositeGlyphs (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, - GlyphListPtr lists, - GlyphPtr *glyphs) -{ - PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); - - ValidatePicture (pSrc); - ValidatePicture (pDst); - (*ps->Glyphs) (op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, lists, glyphs); -} - -void -CompositeRects (CARD8 op, - PicturePtr pDst, - xRenderColor *color, - int nRect, - xRectangle *rects) +CompositeRects(CARD8 op, + PicturePtr pDst, + xRenderColor * color, int nRect, xRectangle *rects) { PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen); -- cgit v1.2.3 From 09ef99919c010801bd4220d482a867035b6f4f25 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 2 Mar 2017 15:38:08 +0100 Subject: replace (DE)ALLOCATE_LOCAL by malloc/free This is basically a backport of the following commits + replacing xalloc/xfree by malloc/free. Fixes ArcticaProject/nx-libs#358. commit 2761c103311a1160bc483fd0367d654733df8598 Author: Daniel Stone Date: Mon Nov 5 14:03:26 2007 +0000 OS: Remove usage of alloca Replace with heap allocations. commit 5e363500c86042c394595e1a6633581eb8fcd1bb Author: Daniel Stone Date: Mon Nov 5 14:38:28 2007 +0000 OS: Remove ALLOCATE_LOCAL from os.h Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and remove the include of Xalloca.h as well. --- nx-X11/programs/Xserver/render/mitri.c | 8 +++--- nx-X11/programs/Xserver/render/render.c | 44 ++++++++++++++++----------------- 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/mitri.c b/nx-X11/programs/Xserver/render/mitri.c index bc2641895..9adc7180e 100644 --- a/nx-X11/programs/Xserver/render/mitri.c +++ b/nx-X11/programs/Xserver/render/mitri.c @@ -145,7 +145,7 @@ miTriStrip (CARD8 op, if (npoint < 3) return; ntri = npoint - 2; - tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle)); + tris = malloc (ntri * sizeof (xTriangle)); if (!tris) return; for (tri = tris; npoint >= 3; npoint--, points++, tri++) @@ -155,7 +155,7 @@ miTriStrip (CARD8 op, tri->p3 = points[2]; } (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); - DEALLOCATE_LOCAL (tris); + free (tris); } void @@ -177,7 +177,7 @@ miTriFan (CARD8 op, if (npoint < 3) return; ntri = npoint - 2; - tris = ALLOCATE_LOCAL (ntri * sizeof (xTriangle)); + tris = malloc (ntri * sizeof (xTriangle)); if (!tris) return; first = points++; @@ -188,5 +188,5 @@ miTriFan (CARD8 op, tri->p3 = points[1]; } (*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); - DEALLOCATE_LOCAL (tris); + free (tris); } diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index abc26b5d9..43cb430aa 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1338,7 +1338,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphsBase = glyphsLocal; else { - glyphsBase = (GlyphPtr *) ALLOCATE_LOCAL (nglyph * sizeof (GlyphPtr)); + glyphsBase = (GlyphPtr *) malloc (nglyph * sizeof (GlyphPtr)); if (!glyphsBase) return BadAlloc; } @@ -1346,7 +1346,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) listsBase = listsLocal; else { - listsBase = (GlyphListPtr) ALLOCATE_LOCAL (nlist * sizeof (GlyphListRec)); + listsBase = (GlyphListPtr) malloc (nlist * sizeof (GlyphListRec)); if (!listsBase) return BadAlloc; } @@ -1371,9 +1371,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) { client->errorValue = gs; if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); + free (glyphsBase); if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); + free (listsBase); return RenderErrBase + BadGlyphSet; } } @@ -1427,9 +1427,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphsBase); if (glyphsBase != glyphsLocal) - DEALLOCATE_LOCAL (glyphsBase); + free (glyphsBase); if (listsBase != listsLocal) - DEALLOCATE_LOCAL (listsBase); + free (listsBase); return client->noClientException; } @@ -2893,7 +2893,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -2919,7 +2919,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -2944,7 +2944,7 @@ PanoramiXRenderTrapezoids(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -2981,7 +2981,7 @@ PanoramiXRenderTrapezoids(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3006,7 +3006,7 @@ PanoramiXRenderTriangles(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3039,7 +3039,7 @@ PanoramiXRenderTriangles(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3064,7 +3064,7 @@ PanoramiXRenderTriStrip(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3093,7 +3093,7 @@ PanoramiXRenderTriStrip(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3118,7 +3118,7 @@ PanoramiXRenderTriFan(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3147,7 +3147,7 @@ PanoramiXRenderTriFan(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3172,7 +3172,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3193,7 +3193,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3216,7 +3216,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) { + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); FOR_NSCREENS_FORWARD(j) { @@ -3237,7 +3237,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; @@ -3260,7 +3260,7 @@ PanoramiXRenderAddTraps (ClientPtr client) RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); if (extra_len && - (extra = (char *) ALLOCATE_LOCAL (extra_len))) + (extra = (char *) malloc (extra_len))) { memcpy (extra, stuff + 1, extra_len); x_off = stuff->xOff; @@ -3277,7 +3277,7 @@ PanoramiXRenderAddTraps (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); if(result != Success) break; } - DEALLOCATE_LOCAL(extra); + free(extra); } return result; -- cgit v1.2.3 From e79d3ac6b168e55ffc43ab9afcc5fef35d94f780 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 4 Mar 2017 00:15:08 +0100 Subject: render/filter.c: add missing return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes filter.c: In function ‘SetPicturePictFilter’: filter.c:363:5: warning: ‘return’ with no value, in function returning non-void [enabled by default] return ; ^ --- nx-X11/programs/Xserver/render/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 10e732997..71b893a75 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -360,5 +360,5 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - return ; + return Success; } -- cgit v1.2.3 From 6c8c950258cf0da0cf24c5e80c2216914ac282a4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 21 Mar 2017 21:25:39 +0100 Subject: NXpicturestr_PictSolidFill.h: Drop file and revert db8705. Not an issue anymore nowadays. --- nx-X11/programs/Xserver/render/picturestr.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 27c36dc9c..4969f6cab 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -65,14 +65,10 @@ typedef struct pixman_transform PictTransform, *PictTransformPtr; #define SourcePictTypeRadial 2 #define SourcePictTypeConical 3 -#ifdef NXAGENT_SERVER -#include "../hw/nxagent/NXpicturestr_PictSolidFill.h" -#else typedef struct _PictSolidFill { unsigned int type; CARD32 color; } PictSolidFill, *PictSolidFillPtr; -#endif /* NXAGENT_SERVER */ typedef struct _PictGradientStop { xFixed x; -- cgit v1.2.3 From 93ea74e53e13890ea2f85ea57e9455d0eb2525f4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 11 Mar 2017 00:53:01 +0100 Subject: xserver: remove index from CloseScreen (API/ABI breakage) Extracted from X.org bulk commit: commit 1f0e8bd5eb1a5539689cfc4f5a6b86b530907ec5 Author: Dave Airlie Date: Tue Jun 5 13:22:18 2012 +0100 api: rework the X server driver API to avoid global arrays. This is a squash merge containing all the API changes, as well as the video ABI bump. Its been squashed to make bisection easier. Full patch log below: [...] commit 06729dbbc804a20242e6499f446acb5d94023c3c Author: Dave Airlie Date: Tue Apr 10 14:04:59 2012 +0100 xserver: remove index from CloseScreen (API/ABI breakage) This drops the index from the CloseScreen callback, its always been useless really, since the pScreen contains it. Reviewed-by: Alan Coopersmith Acked-by: Aaron Plattner Reviewed-by: Adam Jackson Signed-off-by: Dave Airlie --- nx-X11/programs/Xserver/render/animcur.c | 8 ++++---- nx-X11/programs/Xserver/render/picture.c | 4 ++-- nx-X11/programs/Xserver/render/picturestr.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index c5535050e..7cd6c8119 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -111,7 +111,7 @@ AnimCurSetCursorPosition (ScreenPtr pScreen, Bool generateEvent); static Bool -AnimCurCloseScreen (int index, ScreenPtr pScreen) +AnimCurCloseScreen (ScreenPtr pScreen) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; @@ -127,10 +127,10 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen) Unwrap(as, pScreen, UnrealizeCursor); Unwrap(as, pScreen, RecolorCursor); SetAnimCurScreen(pScreen,0); - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); free (as); - if (index == 0) - AnimCurScreenPrivateIndex = -1; + if (screenInfo.numScreens <= 1) + AnimCurScreenPrivateIndex = -1; return ret; } diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 0d4c19969..4e7c02ecb 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -127,14 +127,14 @@ PictureDestroyWindow (WindowPtr pWindow) } Bool -PictureCloseScreen (int index, ScreenPtr pScreen) +PictureCloseScreen (ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); Bool ret; int n; pScreen->CloseScreen = ps->CloseScreen; - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); PictureResetFilters (pScreen); for (n = 0; n < ps->nformats; n++) if (ps->formats[n].type == PictTypeIndexed) diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 4969f6cab..7ce831c4b 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -406,7 +406,7 @@ Bool PictureDestroyWindow (WindowPtr pWindow); Bool -PictureCloseScreen (int Index, ScreenPtr pScreen); +PictureCloseScreen (ScreenPtr pScreen); void PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef); -- cgit v1.2.3 From 3ef6d51202a5c4f8ad23d17abf0ee9957129e88c Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Wed, 22 Feb 2017 13:30:48 +0100 Subject: Add CreatePixmap allocation hints. Backported from X.org: commit f2e310132fbe1520c1b5f3da4faa2d2d47835e72 Author: Aaron Plattner Date: Wed Oct 31 14:15:35 2007 -0700 Add CreatePixmap allocation hints. These hints allow an acceleration architecture to optimize allocation of certain types of pixmaps, such as pixmaps that will serve as backing pixmaps for redirected windows. Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/render/mirect.c | 3 ++- nx-X11/programs/Xserver/render/mitrap.c | 2 +- nx-X11/programs/Xserver/render/render.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/mirect.c b/nx-X11/programs/Xserver/render/mirect.c index 3ce7a7f4c..888492140 100644 --- a/nx-X11/programs/Xserver/render/mirect.c +++ b/nx-X11/programs/Xserver/render/mirect.c @@ -137,7 +137,8 @@ miCompositeRects (CARD8 op, goto bail1; pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, - rgbaFormat->depth); + rgbaFormat->depth, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) goto bail2; diff --git a/nx-X11/programs/Xserver/render/mitrap.c b/nx-X11/programs/Xserver/render/mitrap.c index 96f1159a4..d3d052800 100644 --- a/nx-X11/programs/Xserver/render/mitrap.c +++ b/nx-X11/programs/Xserver/render/mitrap.c @@ -62,7 +62,7 @@ miCreateAlphaPicture (ScreenPtr pScreen, } pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, - pPictFormat->depth); + pPictFormat->depth, 0); if (!pPixmap) return 0; pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 43cb430aa..24a8675f6 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1570,7 +1570,8 @@ ProcRenderCreateCursor (ClientPtr client) free (mskbits); return (BadImplementation); } - pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32); + pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height, 32, + CREATE_PIXMAP_USAGE_SCRATCH); if (!pPixmap) { free (argbbits); -- cgit v1.2.3 From 4ad88de861f6a513d4d6ae4b4609f7ced1001a6b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 19 Apr 2017 13:08:26 +0200 Subject: Clearing comments from $XFree86$ (et al.) header lines. --- nx-X11/programs/Xserver/render/animcur.c | 2 -- nx-X11/programs/Xserver/render/glyph.c | 2 -- nx-X11/programs/Xserver/render/glyphstr.h | 2 -- nx-X11/programs/Xserver/render/miindex.c | 2 -- nx-X11/programs/Xserver/render/mipict.c | 2 -- nx-X11/programs/Xserver/render/mipict.h | 2 -- nx-X11/programs/Xserver/render/mirect.c | 2 -- nx-X11/programs/Xserver/render/mitrap.c | 2 -- nx-X11/programs/Xserver/render/mitri.c | 2 -- nx-X11/programs/Xserver/render/picture.c | 2 -- nx-X11/programs/Xserver/render/picture.h | 2 -- nx-X11/programs/Xserver/render/render.c | 2 -- 12 files changed, 24 deletions(-) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/animcur.c b/nx-X11/programs/Xserver/render/animcur.c index 7cd6c8119..7336cdeff 100644 --- a/nx-X11/programs/Xserver/render/animcur.c +++ b/nx-X11/programs/Xserver/render/animcur.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/animcur.c,v 1.5tsi Exp $ - * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/glyph.c b/nx-X11/programs/Xserver/render/glyph.c index d3bfae760..9c9a485ea 100644 --- a/nx-X11/programs/Xserver/render/glyph.c +++ b/nx-X11/programs/Xserver/render/glyph.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/glyph.c,v 1.5 2001/01/30 07:01:22 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/glyphstr.h b/nx-X11/programs/Xserver/render/glyphstr.h index d0c14919c..5c4ed4933 100644 --- a/nx-X11/programs/Xserver/render/glyphstr.h +++ b/nx-X11/programs/Xserver/render/glyphstr.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/glyphstr.h,v 1.3 2000/11/20 07:13:13 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/miindex.c b/nx-X11/programs/Xserver/render/miindex.c index ce31c00fb..5b5f35b19 100644 --- a/nx-X11/programs/Xserver/render/miindex.c +++ b/nx-X11/programs/Xserver/render/miindex.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/miindex.c,v 1.7 2002/11/05 06:05:04 keithp Exp $ - * * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index d2420ea87..9b8f0cfda 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mipict.c,v 1.15tsi Exp $ - * * Copyright © 1999 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mipict.h b/nx-X11/programs/Xserver/render/mipict.h index c035a87f8..6a6554033 100644 --- a/nx-X11/programs/Xserver/render/mipict.h +++ b/nx-X11/programs/Xserver/render/mipict.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mipict.h,v 1.12 2002/11/05 05:34:40 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mirect.c b/nx-X11/programs/Xserver/render/mirect.c index 888492140..49da8d4f8 100644 --- a/nx-X11/programs/Xserver/render/mirect.c +++ b/nx-X11/programs/Xserver/render/mirect.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mirect.c,v 1.3 2000/12/08 07:52:05 keithp Exp $ - * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mitrap.c b/nx-X11/programs/Xserver/render/mitrap.c index d3d052800..2155641ce 100644 --- a/nx-X11/programs/Xserver/render/mitrap.c +++ b/nx-X11/programs/Xserver/render/mitrap.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.8 2002/09/03 19:28:28 keithp Exp $ - * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/mitri.c b/nx-X11/programs/Xserver/render/mitri.c index 9adc7180e..a39e23623 100644 --- a/nx-X11/programs/Xserver/render/mitri.c +++ b/nx-X11/programs/Xserver/render/mitri.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/mitri.c,v 1.5 2002/05/31 16:48:52 keithp Exp $ - * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 4e7c02ecb..e82319bc9 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/picture.c,v 1.29 2002/11/23 02:38:15 keithp Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/picture.h b/nx-X11/programs/Xserver/render/picture.h index 6f3f2d832..5dde2d0bc 100644 --- a/nx-X11/programs/Xserver/render/picture.h +++ b/nx-X11/programs/Xserver/render/picture.h @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/picture.h,v 1.20tsi Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 24a8675f6..fb9208ad1 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1,6 +1,4 @@ /* - * $XFree86: xc/programs/Xserver/render/render.c,v 1.27tsi Exp $ - * * Copyright © 2000 SuSE, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its -- cgit v1.2.3 From 61d5cd0b75acc0ca3bfe2b6addc052c4aae8e6f2 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 21 Apr 2017 12:07:37 +0200 Subject: Revert "NXpicturestr_PictSolidFill.h: Drop file and revert db8705. Not an issue anymore nowadays." This reverts commit 6c8c950258cf0da0cf24c5e80c2216914ac282a4. Fixes ArcticaProject/nx-libs#433. This patch is still a candidate for being re-implemented without extending the _PictSolidFill struct, but for now, we'll have to re-introduce commit db8705 for the sake of having fonts readable after resumption of remote NX sessions. --- nx-X11/programs/Xserver/render/picturestr.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/picturestr.h b/nx-X11/programs/Xserver/render/picturestr.h index 7ce831c4b..f5c367bb4 100644 --- a/nx-X11/programs/Xserver/render/picturestr.h +++ b/nx-X11/programs/Xserver/render/picturestr.h @@ -65,10 +65,14 @@ typedef struct pixman_transform PictTransform, *PictTransformPtr; #define SourcePictTypeRadial 2 #define SourcePictTypeConical 3 +#ifdef NXAGENT_SERVER +#include "../hw/nxagent/NXpicturestr_PictSolidFill.h" +#else typedef struct _PictSolidFill { unsigned int type; CARD32 color; } PictSolidFill, *PictSolidFillPtr; +#endif /* NXAGENT_SERVER */ typedef struct _PictGradientStop { xFixed x; -- cgit v1.2.3 From e073093cc9ea46eb1740440d286c2874b98fd3ae Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 5 Dec 2017 22:14:22 +0100 Subject: devPrivates fixes Backported from X.Org: commit 0693083335185ce05ee64546151f3fc43ce98575 Author: Lars Knoll Date: Mon Mar 6 21:00:09 2006 +0000 render/picture.c Correctly initialize devPrivates variable in source only pictures to 0 miext/cw/cw.h Don't try to access devPrivates of source only pictures Backported-from-NX-by: Ulrich Sibiller --- nx-X11/programs/Xserver/render/picture.c | 1 + 1 file changed, 1 insertion(+) (limited to 'nx-X11/programs/Xserver/render') diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index e82319bc9..eba042903 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -982,6 +982,7 @@ static PicturePtr createSourcePicture(void) pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; + pPicture->devPrivates = 0; SetPictureToDefaults(pPicture); return pPicture; -- cgit v1.2.3