Subversion Repositories HelenOS

Rev

Rev 4676 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4676 Rev 4685
Line 287... Line 287...
287
static void mask_888(void *dst, bool mask)
287
static void mask_888(void *dst, bool mask)
288
{
288
{
289
    bgr_888(dst, mask ? 0xffffff : 0);
289
    bgr_888(dst, mask ? 0xffffff : 0);
290
}
290
}
291
 
291
 
292
static void bgr_555(void *dst, uint32_t rgb)
292
static void rgb_555_be(void *dst, uint32_t rgb)
293
{
293
{
294
    uint8_t hi = (BLUE(rgb, 5) | (GREEN(rgb, 5) << 5)) & 0xff;
294
    *((uint16_t *) dst) = host2uint16_t_be(RED(rgb, 5) << 10 |
295
    uint8_t lo = (GREEN(rgb, 5) >> 3) | (RED(rgb, 5) << 2);
295
        GREEN(rgb, 5) << 5 | BLUE(rgb, 5));
296
    *((uint16_t *) dst) = host2uint16_t_be((hi << 8) | lo);
-
 
297
}
296
}
298
 
297
 
299
static void mask_555(void *dst, bool mask)
298
static void rgb_555_le(void *dst, uint32_t rgb)
-
 
299
{
-
 
300
    *((uint16_t *) dst) = host2uint16_t_le(RED(rgb, 5) << 10 |
-
 
301
        GREEN(rgb, 5) << 5 | BLUE(rgb, 5));
-
 
302
}
-
 
303
 
-
 
304
static void rgb_565_be(void *dst, uint32_t rgb)
-
 
305
{
-
 
306
    *((uint16_t *) dst) = host2uint16_t_be(RED(rgb, 5) << 11 |
-
 
307
        GREEN(rgb, 6) << 5 | BLUE(rgb, 5));
-
 
308
}
-
 
309
 
-
 
310
static void rgb_565_le(void *dst, uint32_t rgb)
300
{
311
{
-
 
312
    *((uint16_t *) dst) = host2uint16_t_le(RED(rgb, 5) << 11 |
301
    bgr_555(dst, mask ? 0xffffff : 0);
313
        GREEN(rgb, 6) << 5 | BLUE(rgb, 5));
302
}
314
}
303
 
315
 
304
static void bgr_565(void *dst, uint32_t rgb)
316
static void mask_555(void *dst, bool mask)
305
{
317
{
306
    uint8_t hi = (BLUE(rgb, 5) | (GREEN(rgb, 6) << 5)) & 0xff;
-
 
307
    uint8_t lo = (GREEN(rgb, 6) >> 3) | (RED(rgb, 5) << 3);
-
 
308
    *((uint16_t *) dst) = host2uint16_t_be((hi << 8) | lo);
318
    rgb_555_be(dst, mask ? 0xffffff : 0);
309
}
319
}
310
 
320
 
311
static void mask_565(void *dst, bool mask)
321
static void mask_565(void *dst, bool mask)
312
{
322
{
313
    bgr_565(dst, mask ? 0xffffff : 0);
323
    rgb_565_be(dst, mask ? 0xffffff : 0);
314
}
324
}
315
 
325
 
316
static void bgr_323(void *dst, uint32_t rgb)
326
static void bgr_323(void *dst, uint32_t rgb)
317
{
327
{
318
    *((uint8_t *) dst)
328
    *((uint8_t *) dst)
Line 619... Line 629...
619
    case VISUAL_INDIRECT_8:
629
    case VISUAL_INDIRECT_8:
620
        screen.rgb_conv = bgr_323;
630
        screen.rgb_conv = bgr_323;
621
        screen.mask_conv = mask_323;
631
        screen.mask_conv = mask_323;
622
        screen.pixelbytes = 1;
632
        screen.pixelbytes = 1;
623
        break;
633
        break;
624
    case VISUAL_BGR_5_5_5:
634
    case VISUAL_RGB_5_5_5_LE:
-
 
635
        screen.rgb_conv = rgb_555_le;
-
 
636
        screen.mask_conv = mask_555;
-
 
637
        screen.pixelbytes = 2;
-
 
638
        break;
-
 
639
    case VISUAL_RGB_5_5_5_BE:
625
        screen.rgb_conv = bgr_555;
640
        screen.rgb_conv = rgb_555_be;
626
        screen.mask_conv = mask_555;
641
        screen.mask_conv = mask_555;
627
        screen.pixelbytes = 2;
642
        screen.pixelbytes = 2;
628
        break;
643
        break;
629
    case VISUAL_BGR_5_6_5:
644
    case VISUAL_RGB_5_6_5_LE:
-
 
645
        screen.rgb_conv = rgb_565_le;
-
 
646
        screen.mask_conv = mask_565;
-
 
647
        screen.pixelbytes = 2;
-
 
648
        break;
-
 
649
    case VISUAL_RGB_5_6_5_BE:
630
        screen.rgb_conv = bgr_565;
650
        screen.rgb_conv = rgb_565_be;
631
        screen.mask_conv = mask_565;
651
        screen.mask_conv = mask_565;
632
        screen.pixelbytes = 2;
652
        screen.pixelbytes = 2;
633
        break;
653
        break;
634
    case VISUAL_RGB_8_8_8:
654
    case VISUAL_RGB_8_8_8:
635
        screen.rgb_conv = rgb_888;
655
        screen.rgb_conv = rgb_888;