aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:31 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:31 +0200
commit1c25e92b9ea5811d8ab9c2bfdc0dcb2e4d21bd0a (patch)
tree56b1d4196538a8abb7747e8455b59aa778d6b948 /nx-X11/programs/Xserver/hw/nxagent/Drawable.c
parent266b5554943baffafbf1d574f567283cc9792278 (diff)
downloadnx-libs-1c25e92b9ea5811d8ab9c2bfdc0dcb2e4d21bd0a.tar.gz
nx-libs-1c25e92b9ea5811d8ab9c2bfdc0dcb2e4d21bd0a.tar.bz2
nx-libs-1c25e92b9ea5811d8ab9c2bfdc0dcb2e4d21bd0a.zip
Imported nxagent-3.2.0-10.tar.gznxagent/3.2.0-10
Summary: Imported nxagent-3.2.0-10.tar.gz Keywords: Imported nxagent-3.2.0-10.tar.gz into Git repository
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Drawable.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Drawable.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
index abc228e9c..2c1b07fa5 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c
@@ -371,6 +371,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
int nBox;
int x, y;
int w, h;
+ int extentWidth, extentHeight;
int tileWidth, tileHeight;
int length, format, leftPad;
int i;
@@ -590,8 +591,20 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned
pDrawable -> x, pDrawable -> y, pDrawable -> width, pDrawable -> height);
#endif
- w = tileWidth = (nxagentOption(TileWidth) > pDrawable -> width ? pDrawable -> width : nxagentOption(TileWidth));
- h = tileHeight = (nxagentOption(TileHeight) > pDrawable -> height ? pDrawable -> height : nxagentOption(TileHeight));
+ /*
+ * We are going to synchronize the corrupted
+ * area, so we use the corrupted extents as
+ * maximum size of the image data. It's im-
+ * portant to avoid using the drawable size,
+ * because in case of a huge window it had to
+ * result in a failed data memory allocation.
+ */
+
+ extentWidth = clipRegion -> extents.x2 - clipRegion -> extents.x1;
+ extentHeight = clipRegion -> extents.y2 - clipRegion -> extents.y1;
+
+ w = tileWidth = (nxagentOption(TileWidth) > extentWidth ? extentWidth : nxagentOption(TileWidth));
+ h = tileHeight = (nxagentOption(TileHeight) > extentHeight ? extentHeight : nxagentOption(TileHeight));
#ifdef DEBUG
fprintf(stderr, "nxagentSynchronizeRegion: Using tiles of size [%dx%d].\n", tileWidth, tileHeight);
@@ -2613,7 +2626,10 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable)
* FIXME: A better way it would be create the bitmap
* with the same extents of the clipRegion. This
* requires to save the offset with respect to the
- * drawable origin like in the backing store.
+ * drawable origin like in the backing store. This
+ * becomes particularly important when the drawable
+ * is a huge window, because the pixmap creation
+ * would fail.
*/
pBitmap = nxagentCreatePixmap(pDrawable -> pScreen, pDrawable -> width, pDrawable -> height, pDrawable -> depth);