Lines Matching refs:cl

39 static int subrectEncode8(rfbClientPtr cl, uint8_t *data, int w, int h);
40 static int subrectEncode16(rfbClientPtr cl, uint16_t *data, int w, int h);
41 static int subrectEncode32(rfbClientPtr cl, uint32_t *data, int w, int h);
43 static rfbBool rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y,
53 rfbSendRectEncodingCoRRE(rfbClientPtr cl, in rfbSendRectEncodingCoRRE() argument
59 if (h > cl->correMaxHeight) { in rfbSendRectEncodingCoRRE()
60 return (rfbSendRectEncodingCoRRE(cl, x, y, w, cl->correMaxHeight) && in rfbSendRectEncodingCoRRE()
61 rfbSendRectEncodingCoRRE(cl, x, y + cl->correMaxHeight, w, in rfbSendRectEncodingCoRRE()
62 h - cl->correMaxHeight)); in rfbSendRectEncodingCoRRE()
65 if (w > cl->correMaxWidth) { in rfbSendRectEncodingCoRRE()
66 return (rfbSendRectEncodingCoRRE(cl, x, y, cl->correMaxWidth, h) && in rfbSendRectEncodingCoRRE()
67 rfbSendRectEncodingCoRRE(cl, x + cl->correMaxWidth, y, in rfbSendRectEncodingCoRRE()
68 w - cl->correMaxWidth, h)); in rfbSendRectEncodingCoRRE()
71 rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h); in rfbSendRectEncodingCoRRE()
83 rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, in rfbSendSmallRectEncodingCoRRE() argument
93 char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y) in rfbSendSmallRectEncodingCoRRE()
94 + (x * (cl->scaledScreen->bitsPerPixel / 8))); in rfbSendSmallRectEncodingCoRRE()
96 int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height in rfbSendSmallRectEncodingCoRRE()
97 * (cl->format.bitsPerPixel / 8)); in rfbSendSmallRectEncodingCoRRE()
99 if (cl->beforeEncBufSize < maxRawSize) { in rfbSendSmallRectEncodingCoRRE()
100 cl->beforeEncBufSize = maxRawSize; in rfbSendSmallRectEncodingCoRRE()
101 if (cl->beforeEncBuf == NULL) in rfbSendSmallRectEncodingCoRRE()
102 cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize); in rfbSendSmallRectEncodingCoRRE()
104 cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize); in rfbSendSmallRectEncodingCoRRE()
107 if (cl->afterEncBufSize < maxRawSize) { in rfbSendSmallRectEncodingCoRRE()
108 cl->afterEncBufSize = maxRawSize; in rfbSendSmallRectEncodingCoRRE()
109 if (cl->afterEncBuf == NULL) in rfbSendSmallRectEncodingCoRRE()
110 cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize); in rfbSendSmallRectEncodingCoRRE()
112 cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize); in rfbSendSmallRectEncodingCoRRE()
115 (*cl->translateFn)(cl->translateLookupTable,&(cl->screen->serverFormat), in rfbSendSmallRectEncodingCoRRE()
116 &cl->format, fbptr, cl->beforeEncBuf, in rfbSendSmallRectEncodingCoRRE()
117 cl->scaledScreen->paddedWidthInBytes, w, h); in rfbSendSmallRectEncodingCoRRE()
119 switch (cl->format.bitsPerPixel) { in rfbSendSmallRectEncodingCoRRE()
121 nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h); in rfbSendSmallRectEncodingCoRRE()
124 nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h); in rfbSendSmallRectEncodingCoRRE()
127 nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h); in rfbSendSmallRectEncodingCoRRE()
130 rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel); in rfbSendSmallRectEncodingCoRRE()
138 return rfbSendRectEncodingRaw(cl, x, y, w, h); in rfbSendSmallRectEncodingCoRRE()
141 rfbStatRecordEncodingSent(cl,rfbEncodingCoRRE, in rfbSendSmallRectEncodingCoRRE()
142 sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen, in rfbSendSmallRectEncodingCoRRE()
143 sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8)); in rfbSendSmallRectEncodingCoRRE()
145 if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader in rfbSendSmallRectEncodingCoRRE()
148 if (!rfbSendUpdateBuf(cl)) in rfbSendSmallRectEncodingCoRRE()
158 memcpy(&cl->updateBuf[cl->ublen], (char *)&rect, in rfbSendSmallRectEncodingCoRRE()
160 cl->ublen += sz_rfbFramebufferUpdateRectHeader; in rfbSendSmallRectEncodingCoRRE()
164 memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader); in rfbSendSmallRectEncodingCoRRE()
165 cl->ublen += sz_rfbRREHeader; in rfbSendSmallRectEncodingCoRRE()
167 for (i = 0; i < cl->afterEncBufLen;) { in rfbSendSmallRectEncodingCoRRE()
169 int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen; in rfbSendSmallRectEncodingCoRRE()
171 if (i + bytesToCopy > cl->afterEncBufLen) { in rfbSendSmallRectEncodingCoRRE()
172 bytesToCopy = cl->afterEncBufLen - i; in rfbSendSmallRectEncodingCoRRE()
175 memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy); in rfbSendSmallRectEncodingCoRRE()
177 cl->ublen += bytesToCopy; in rfbSendSmallRectEncodingCoRRE()
180 if (cl->ublen == UPDATE_BUF_SIZE) { in rfbSendSmallRectEncodingCoRRE()
181 if (!rfbSendUpdateBuf(cl)) in rfbSendSmallRectEncodingCoRRE()
207 uint##bpp##_t cl; \
229 cl = line[x]; \
234 if (seg[x] != cl) {break;} \
236 while ((seg[i] == cl) && (i < w)) i += 1; \
273 *((uint##bpp##_t*)(client->afterEncBuf + client->afterEncBufLen)) = cl; \