diff options
author | Joel Bosveld <Joel.Bosveld@gmail.com> | 2009-06-24 19:52:03 +0800 |
---|---|---|
committer | Joel Bosveld <Joel.Bosveld@gmail.com> | 2009-06-24 19:53:54 +0800 |
commit | 31d393708f8c69eea0c92348fa06b0036006a7b9 (patch) | |
tree | d41a250f70daa72cd46d01bbcd20146a8483f3e1 | |
parent | 4ae2677329493a494838c8d43eb4cf1e08fcd4b9 (diff) |
Changes to make SetTriCoordMesh work if max_request_size is too small
Previously, when the max_request_size was too small, XCompositeSetTriangularCoordinateMesh would just send multiple requests, each with a portion of the triangles. Since the server would remove the mesh at each request, the end result was that only the triangles in the last request would be in the mesh
-rw-r--r-- | src/Xcomposite.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Xcomposite.c b/src/Xcomposite.c index ff2d741..930a821 100644 --- a/src/Xcomposite.c +++ b/src/Xcomposite.c @@ -405,6 +405,7 @@ XCompositeSetTriangularCoordinateMesh (Display *dpy, xCompositeSetTriangularCoordinateMeshReq *req; int n; long len; + Bool first = True; XCompositeSimpleCheckExtension (dpy, info); LockDisplay (dpy); @@ -414,14 +415,30 @@ XCompositeSetTriangularCoordinateMesh (Display *dpy, req->reqType = info->codes->major_opcode; req->compositeReqType = X_CompositeSetTriangularCoordinateMesh; req->window = window; + + req->flags = 0; + if (first) + { + req->flags |= CompositeSetMeshBegin; + req->total = nTriangle; + first = False; + } + else + req->total = 0; + n = nTriangle; len = ((long) n) * (SIZEOF (xTriangle) >> 2); if (!dpy->bigreq_size && len > (dpy->max_request_size - req->length)) { n = (dpy->max_request_size - req->length) / (SIZEOF (xTriangle) >> 2); + n = (n/2) * 2; /* Triangles need to be sent in groups of two */ len = ((long) n) * (SIZEOF (xTriangle) >> 2); } + + if (n == nTriangle) + req->flags |= CompositeSetMeshEnd; + SetReqLen (req, len, len); len <<= 2; DataInt32 (dpy, (int *) triangle, len); |