Lines Matching refs:cl
33 { char *fbptr = (cl->scaledScreen->frameBuffer \
34 + (cl->scaledScreen->paddedWidthInBytes * ty) \
35 + (tx * (cl->scaledScreen->bitsPerPixel / 8))); \
37 (*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,\
38 &cl->format, fbptr, (char*)buf, \
39 cl->scaledScreen->paddedWidthInBytes, tw, th); }
41 #define EXTRA_ARGS , rfbClientPtr cl
104 rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h) in rfbSendRectEncodingZRLE() argument
112 if (cl->zrleBeforeBuf == NULL) { in rfbSendRectEncodingZRLE()
113 cl->zrleBeforeBuf = (char *) malloc(rfbZRLETileWidth * rfbZRLETileHeight * 4 + 4); in rfbSendRectEncodingZRLE()
115 zrleBeforeBuf = cl->zrleBeforeBuf; in rfbSendRectEncodingZRLE()
117 if (cl->preferredEncoding == rfbEncodingZYWRLE) { in rfbSendRectEncodingZRLE()
118 if (cl->tightQualityLevel < 0) { in rfbSendRectEncodingZRLE()
119 cl->zywrleLevel = 1; in rfbSendRectEncodingZRLE()
120 } else if (cl->tightQualityLevel < 3) { in rfbSendRectEncodingZRLE()
121 cl->zywrleLevel = 3; in rfbSendRectEncodingZRLE()
122 } else if (cl->tightQualityLevel < 6) { in rfbSendRectEncodingZRLE()
123 cl->zywrleLevel = 2; in rfbSendRectEncodingZRLE()
125 cl->zywrleLevel = 1; in rfbSendRectEncodingZRLE()
128 cl->zywrleLevel = 0; in rfbSendRectEncodingZRLE()
130 if (!cl->zrleData) in rfbSendRectEncodingZRLE()
131 cl->zrleData = zrleOutStreamNew(); in rfbSendRectEncodingZRLE()
132 zos = cl->zrleData; in rfbSendRectEncodingZRLE()
136 switch (cl->format.bitsPerPixel) { in rfbSendRectEncodingZRLE()
139 zrleEncode8NE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
143 if (cl->format.greenMax > 0x1F) { in rfbSendRectEncodingZRLE()
144 if (cl->format.bigEndian) in rfbSendRectEncodingZRLE()
145 zrleEncode16BE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
147 zrleEncode16LE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
149 if (cl->format.bigEndian) in rfbSendRectEncodingZRLE()
150 zrleEncode15BE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
152 zrleEncode15LE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
158 = ((cl->format.redMax << cl->format.redShift) < (1<<24) && in rfbSendRectEncodingZRLE()
159 (cl->format.greenMax << cl->format.greenShift) < (1<<24) && in rfbSendRectEncodingZRLE()
160 (cl->format.blueMax << cl->format.blueShift) < (1<<24)); in rfbSendRectEncodingZRLE()
162 rfbBool fitsInMS3Bytes = (cl->format.redShift > 7 && in rfbSendRectEncodingZRLE()
163 cl->format.greenShift > 7 && in rfbSendRectEncodingZRLE()
164 cl->format.blueShift > 7); in rfbSendRectEncodingZRLE()
166 if ((fitsInLS3Bytes && !cl->format.bigEndian) || in rfbSendRectEncodingZRLE()
167 (fitsInMS3Bytes && cl->format.bigEndian)) { in rfbSendRectEncodingZRLE()
168 if (cl->format.bigEndian) in rfbSendRectEncodingZRLE()
169 zrleEncode24ABE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
171 zrleEncode24ALE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
173 else if ((fitsInLS3Bytes && cl->format.bigEndian) || in rfbSendRectEncodingZRLE()
174 (fitsInMS3Bytes && !cl->format.bigEndian)) { in rfbSendRectEncodingZRLE()
175 if (cl->format.bigEndian) in rfbSendRectEncodingZRLE()
176 zrleEncode24BBE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
178 zrleEncode24BLE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
181 if (cl->format.bigEndian) in rfbSendRectEncodingZRLE()
182 zrleEncode32BE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
184 zrleEncode32LE(x, y, w, h, zos, zrleBeforeBuf, cl); in rfbSendRectEncodingZRLE()
190 …rfbStatRecordEncodingSent(cl, rfbEncodingZRLE, sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeade… in rfbSendRectEncodingZRLE()
191 + w * (cl->format.bitsPerPixel / 8) * h); in rfbSendRectEncodingZRLE()
193 if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeader in rfbSendRectEncodingZRLE()
196 if (!rfbSendUpdateBuf(cl)) in rfbSendRectEncodingZRLE()
204 rect.encoding = Swap32IfLE(cl->preferredEncoding); in rfbSendRectEncodingZRLE()
206 memcpy(cl->updateBuf+cl->ublen, (char *)&rect, in rfbSendRectEncodingZRLE()
208 cl->ublen += sz_rfbFramebufferUpdateRectHeader; in rfbSendRectEncodingZRLE()
212 memcpy(cl->updateBuf+cl->ublen, (char *)&hdr, sz_rfbZRLEHeader); in rfbSendRectEncodingZRLE()
213 cl->ublen += sz_rfbZRLEHeader; in rfbSendRectEncodingZRLE()
219 int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen; in rfbSendRectEncodingZRLE()
225 memcpy(cl->updateBuf+cl->ublen, (uint8_t*)zos->out.start + i, bytesToCopy); in rfbSendRectEncodingZRLE()
227 cl->ublen += bytesToCopy; in rfbSendRectEncodingZRLE()
230 if (cl->ublen == UPDATE_BUF_SIZE) { in rfbSendRectEncodingZRLE()
231 if (!rfbSendUpdateBuf(cl)) in rfbSendRectEncodingZRLE()
240 void rfbFreeZrleData(rfbClientPtr cl) in rfbFreeZrleData() argument
242 if (cl->zrleData) { in rfbFreeZrleData()
243 zrleOutStreamFree(cl->zrleData); in rfbFreeZrleData()
245 cl->zrleData = NULL; in rfbFreeZrleData()
247 if (cl->zrleBeforeBuf) { in rfbFreeZrleData()
248 free(cl->zrleBeforeBuf); in rfbFreeZrleData()
250 cl->zrleBeforeBuf = NULL; in rfbFreeZrleData()
252 if (cl->paletteHelper) { in rfbFreeZrleData()
253 free(cl->paletteHelper); in rfbFreeZrleData()
255 cl->paletteHelper = NULL; in rfbFreeZrleData()