Changeset bde5c04 in mainline for uspace/srv/hid/rfb/rfb.c
- Timestamp:
- 2017-12-04T19:32:55Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0fb1755
- Parents:
- 8e3498b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/rfb/rfb.c
r8e3498b rbde5c04 418 418 } 419 419 420 static s size_t rfb_tile_encode_raw(rfb_t *rfb, cpixel_ctx_t *cpixel,420 static size_t rfb_tile_encode_raw(rfb_t *rfb, cpixel_ctx_t *cpixel, 421 421 rfb_rectangle_t *tile, void *buf) 422 422 { 423 s size_t size = tile->width * tile->height * cpixel->size;423 size_t size = tile->width * tile->height * cpixel->size; 424 424 if (buf == NULL) 425 425 return size; … … 435 435 } 436 436 437 static s size_t rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel,438 rfb_rectangle_t *tile, void *buf )437 static size_t rfb_tile_encode_solid(rfb_t *rfb, cpixel_ctx_t *cpixel, 438 rfb_rectangle_t *tile, void *buf, size_t *size) 439 439 { 440 440 /* Check if it is single color */ … … 443 443 for (uint16_t x = tile->x; x < tile->x + tile->width; x++) { 444 444 if (pixelmap_get_pixel(&rfb->framebuffer, x, y) != the_color) 445 return -1;445 return EINVAL; 446 446 } 447 447 } … … 450 450 if (buf) 451 451 cpixel_encode(rfb, cpixel, buf, the_color); 452 return cpixel->size; 452 *size = cpixel->size; 453 return EOK; 453 454 } 454 455 … … 474 475 475 476 uint8_t tile_enctype = RFB_TILE_ENCODING_SOLID; 476 ssize_t tile_size = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf); 477 if (tile_size < 0) { 477 size_t tile_size; 478 int rc = rfb_tile_encode_solid(rfb, &cpixel, &tile, buf, 479 &tile_size); 480 if (rc != EOK) { 478 481 tile_size = rfb_tile_encode_raw(rfb, &cpixel, &tile, buf); 479 482 tile_enctype = RFB_TILE_ENCODING_RAW;
Note:
See TracChangeset
for help on using the changeset viewer.