Revision: 5100 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5100&view=rev Author: ossman_ Date: 2013-05-22 12:52:27 +0000 (Wed, 22 May 2013) Log Message: ----------- Redo r5090 using functions that are available in older Xorg versions as well.
Revision Links: -------------- http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5090&view=rev Modified Paths: -------------- trunk/unix/xserver/hw/vnc/vncHooks.cc Modified: trunk/unix/xserver/hw/vnc/vncHooks.cc =================================================================== --- trunk/unix/xserver/hw/vnc/vncHooks.cc 2013-05-22 11:59:38 UTC (rev 5099) +++ trunk/unix/xserver/hw/vnc/vncHooks.cc 2013-05-22 12:52:27 UTC (rev 5100) @@ -661,22 +661,20 @@ return count; } -static void -GlyphRegion(int nlist, GlyphListPtr list, GlyphPtr * glyphs, RegionPtr region) +static RegionPtr +GlyphsToRegion(ScreenPtr pScreen, int nlist, GlyphListPtr list, GlyphPtr *glyphs) { int n; GlyphPtr glyph; int x, y; - int nboxes = GlyphCount(nlist, list, glyphs); - BoxRec boxes[nboxes]; - BoxPtr box; + int nrects = GlyphCount(nlist, list, glyphs); + xRectangle rects[nrects]; + xRectanglePtr rect; - RegionUninit(region); - x = 0; y = 0; - box = &boxes[0]; + rect = &rects[0]; while (nlist--) { x += list->xOff; y += list->yOff; @@ -684,17 +682,17 @@ list++; while (n--) { glyph = *glyphs++; - box->x1 = x - glyph->info.x; - box->y1 = y - glyph->info.y; - box->x2 = box->x1 + glyph->info.width; - box->y2 = box->y1 + glyph->info.height; + rect->x = x - glyph->info.x; + rect->y = y - glyph->info.y; + rect->width = glyph->info.width; + rect->height = glyph->info.height; x += glyph->info.xOff; y += glyph->info.yOff; - box++; + rect++; } } - RegionInitBoxes(region, boxes, nboxes); + return RECTS_TO_REGION(pScreen, nrects, rects, CT_NONE); } // Glyphs - Glyph specific version of Composite (caches and whatnot) @@ -715,21 +713,20 @@ BoxRec fbbox; RegionRec fbreg; - changed.init(NULL, 0); + changed.reg = GlyphsToRegion(pScreen, nlists, lists, glyphs); + REGION_TRANSLATE(pScreen, changed.reg, + pDst->pDrawable->x, pDst->pDrawable->y); - GlyphRegion(nlists, lists, glyphs, changed.reg); - RegionTranslate(changed.reg, pDst->pDrawable->x, pDst->pDrawable->y); - fbrect = vncHooksScreen->desktop->getRect(); fbbox.x1 = fbrect.tl.x; fbbox.y1 = fbrect.tl.y; fbbox.x2 = fbrect.br.x; fbbox.y2 = fbrect.br.y; - RegionInit(&fbreg, &fbbox, 0); + REGION_INIT(pScreen, &fbreg, &fbbox, 0); - RegionIntersect(changed.reg, changed.reg, &fbreg); + REGION_INTERSECT(pScreen, changed.reg, changed.reg, &fbreg); - RegionUninit(&fbreg); + REGION_UNINIT(pScreen, &fbreg); } else { changed.init(NullBox, 0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits