Re: [Tigervnc-commits] SF.net SVN: tigervnc:[5090] trunk/unix/xserver/hw/vnc/vncHooks.cc

2013-05-22 Thread Brian Hinz
On Wed, May 22, 2013 at 8:58 AM, Pierre Ossman oss...@cendio.se wrote:

 On Wed, 8 May 2013 10:20:23 -0400
 Brian Hinz bph...@jhu.edu wrote:

  Hi Pierre,
 
  r5090 breaks when compiled against Xorg 7.5:
 

 Sorry about this taking so long Should be fixed now. Please give it a
 try.

 Maybe it's time for a beta 2?


OK, I'll run the nightly builds tonight and let you know if there are any
issues.  Thanks.
--
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


[Tigervnc-commits] SF.net SVN: tigervnc:[5090] trunk/unix/xserver/hw/vnc/vncHooks.cc

2013-05-07 Thread ossman_
Revision: 5090
  http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5090view=rev
Author:   ossman_
Date: 2013-05-07 13:00:15 + (Tue, 07 May 2013)
Log Message:
---
The Glyph operation is not guaranteed to be implemented on top of the
Composite operation, so we need to hook both.

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-04-27 20:20:57 UTC (rev 
5089)
+++ trunk/unix/xserver/hw/vnc/vncHooks.cc   2013-05-07 13:00:15 UTC (rev 
5090)
@@ -81,6 +81,7 @@
   ScreenBlockHandlerProcPtrBlockHandler;
 #ifdef RENDER
   CompositeProcPtr Composite;
+  GlyphsProcPtrGlyphs;
 #endif
 #ifdef RANDR
   RRSetConfigProcPtr   RandRSetConfig;
@@ -150,6 +151,9 @@
 static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, 
  PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 
xMask, 
  INT16 yMask, INT16 xDst, INT16 yDst, CARD16 
width, CARD16 height);
+static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, 
+ PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, 
int nlists, 
+ GlyphListPtr lists, GlyphPtr * glyphs);
 #endif
 #ifdef RANDR
 static Bool vncHooksRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
@@ -294,6 +298,7 @@
   ps = GetPictureScreenIfSet(pScreen);
   if (ps) {
 vncHooksScreen-Composite = ps-Composite;
+vncHooksScreen-Glyphs = ps-Glyphs;
   }
 #endif
 #ifdef RANDR
@@ -320,6 +325,7 @@
 #ifdef RENDER
   if (ps) {
 ps-Composite = vncHooksComposite;
+ps-Glyphs = vncHooksGlyphs;
   }
 #endif
 #ifdef RANDR
@@ -384,6 +390,7 @@
   ps = GetPictureScreenIfSet(pScreen);
   if (ps) {
 ps-Composite = vncHooksScreen-Composite;
+ps-Glyphs = vncHooksScreen-Glyphs;
   }
 #endif
 #ifdef RANDR
@@ -594,9 +601,10 @@
   SCREEN_REWRAP(BlockHandler);
 }
 
-// Composite - needed for RENDER
+#ifdef RENDER
 
-#ifdef RENDER
+// Composite - The core of XRENDER
+
 void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, 
   PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, 
   INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, 
CARD16 height)
@@ -639,6 +647,101 @@
 vncHooksScreen-desktop-add_changed(changed.reg);
 }
 
+static int
+GlyphCount(int nlist, GlyphListPtr list, GlyphPtr * glyphs)
+{
+  int count;
+
+  count = 0;
+  while (nlist--) {
+count += list-len;
+list++;
+  }
+
+  return count;
+}
+
+static void
+GlyphRegion(int nlist, GlyphListPtr list, GlyphPtr * glyphs, RegionPtr region)
+{
+  int n;
+  GlyphPtr glyph;
+  int x, y;
+
+  int nboxes = GlyphCount(nlist, list, glyphs);
+  BoxRec boxes[nboxes];
+  BoxPtr box;
+
+  RegionUninit(region);
+
+  x = 0;
+  y = 0;
+  box = boxes[0];
+  while (nlist--) {
+x += list-xOff;
+y += list-yOff;
+n = list-len;
+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;
+  x += glyph-info.xOff;
+  y += glyph-info.yOff;
+  box++;
+}
+  }
+
+  RegionInitBoxes(region, boxes, nboxes);
+}
+
+// Glyphs - Glyph specific version of Composite (caches and whatnot)
+
+void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, 
+   PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlists, 
+   GlyphListPtr lists, GlyphPtr * glyphs)
+{
+  ScreenPtr pScreen = pDst-pDrawable-pScreen;
+  vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen);
+  PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+  RegionHelper changed(pScreen);
+
+  if (pDst-pDrawable-type == DRAWABLE_WINDOW 
+  ((WindowPtr) pDst-pDrawable)-viewable) {
+rfb::Rect fbrect;
+BoxRec fbbox;
+RegionRec fbreg;
+
+changed.init(NULL, 0);
+
+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);
+
+RegionIntersect(changed.reg, changed.reg, fbreg);
+
+RegionUninit(fbreg);
+  } else {
+changed.init(NullBox, 0);
+  }
+
+  ps-Glyphs = vncHooksScreen-Glyphs;
+  (*ps-Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlists, lists, glyphs);
+  ps-Glyphs = vncHooksGlyphs;
+
+  if (REGION_NOTEMPTY(pScreen, changed.reg))
+vncHooksScreen-desktop-add_changed(changed.reg);
+}
+
 #endif /* RENDER */
 
 // RandRSetConfig - follow any framebuffer changes

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source