Lines Matching refs:cl
38 static int subrectEncode8(rfbClientPtr cl, uint8_t *data, int w, int h);
39 static int subrectEncode16(rfbClientPtr cl, uint16_t *data, int w, int h);
40 static int subrectEncode32(rfbClientPtr cl, uint32_t *data, int w, int h);
49 rfbSendRectEncodingRRE(rfbClientPtr cl, in rfbSendRectEncodingRRE() argument
59 char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y) in rfbSendRectEncodingRRE()
60 + (x * (cl->scaledScreen->bitsPerPixel / 8))); in rfbSendRectEncodingRRE()
62 int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height in rfbSendRectEncodingRRE()
63 * (cl->format.bitsPerPixel / 8)); in rfbSendRectEncodingRRE()
65 if (cl->beforeEncBufSize < maxRawSize) { in rfbSendRectEncodingRRE()
66 cl->beforeEncBufSize = maxRawSize; in rfbSendRectEncodingRRE()
67 if (cl->beforeEncBuf == NULL) in rfbSendRectEncodingRRE()
68 cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize); in rfbSendRectEncodingRRE()
70 cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize); in rfbSendRectEncodingRRE()
73 if (cl->afterEncBufSize < maxRawSize) { in rfbSendRectEncodingRRE()
74 cl->afterEncBufSize = maxRawSize; in rfbSendRectEncodingRRE()
75 if (cl->afterEncBuf == NULL) in rfbSendRectEncodingRRE()
76 cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize); in rfbSendRectEncodingRRE()
78 cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize); in rfbSendRectEncodingRRE()
81 (*cl->translateFn)(cl->translateLookupTable, in rfbSendRectEncodingRRE()
82 &(cl->screen->serverFormat), in rfbSendRectEncodingRRE()
83 &cl->format, fbptr, cl->beforeEncBuf, in rfbSendRectEncodingRRE()
84 cl->scaledScreen->paddedWidthInBytes, w, h); in rfbSendRectEncodingRRE()
86 switch (cl->format.bitsPerPixel) { in rfbSendRectEncodingRRE()
88 nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h); in rfbSendRectEncodingRRE()
91 nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h); in rfbSendRectEncodingRRE()
94 nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h); in rfbSendRectEncodingRRE()
97 rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel); in rfbSendRectEncodingRRE()
105 return rfbSendRectEncodingRaw(cl, x, y, w, h); in rfbSendRectEncodingRRE()
108 rfbStatRecordEncodingSent(cl, rfbEncodingRRE, in rfbSendRectEncodingRRE()
109 … sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen, in rfbSendRectEncodingRRE()
110 … sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8)); in rfbSendRectEncodingRRE()
112 if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader in rfbSendRectEncodingRRE()
115 if (!rfbSendUpdateBuf(cl)) in rfbSendRectEncodingRRE()
125 memcpy(&cl->updateBuf[cl->ublen], (char *)&rect, in rfbSendRectEncodingRRE()
127 cl->ublen += sz_rfbFramebufferUpdateRectHeader; in rfbSendRectEncodingRRE()
131 memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader); in rfbSendRectEncodingRRE()
132 cl->ublen += sz_rfbRREHeader; in rfbSendRectEncodingRRE()
134 for (i = 0; i < cl->afterEncBufLen;) { in rfbSendRectEncodingRRE()
136 int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen; in rfbSendRectEncodingRRE()
138 if (i + bytesToCopy > cl->afterEncBufLen) { in rfbSendRectEncodingRRE()
139 bytesToCopy = cl->afterEncBufLen - i; in rfbSendRectEncodingRRE()
142 memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy); in rfbSendRectEncodingRRE()
144 cl->ublen += bytesToCopy; in rfbSendRectEncodingRRE()
147 if (cl->ublen == UPDATE_BUF_SIZE) { in rfbSendRectEncodingRRE()
148 if (!rfbSendUpdateBuf(cl)) in rfbSendRectEncodingRRE()
174 uint##bpp##_t cl; \
196 cl = line[x]; \
201 if (seg[x] != cl) {break;} \
203 while ((seg[i] == cl) && (i < w)) i += 1; \
240 *((uint##bpp##_t*)(client->afterEncBuf + client->afterEncBufLen)) = cl; \