1 | /* $Id: VBoxDispVrdpBmp.h 36867 2011-04-28 07:27:03Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox XPDM Display driver
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2011 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef VBOXDISPVRDPBMP_H
|
---|
20 | #define VBOXDISPVRDPBMP_H
|
---|
21 |
|
---|
22 | /* RDP cache holds about 350 tiles 64x64. Therefore
|
---|
23 | * the driver does not have to cache more then the
|
---|
24 | * RDP capacity. Most of bitmaps will be tiled, so
|
---|
25 | * number of RDP tiles will be greater than number of
|
---|
26 | * bitmaps. Also the number of bitmaps must be a power
|
---|
27 | * of 2. So the 256 is a good number.
|
---|
28 | */
|
---|
29 | #define VRDPBMP_N_CACHED_BITMAPS (256)
|
---|
30 |
|
---|
31 | #define VRDPBMP_RC_NOT_CACHED (0x0000)
|
---|
32 | #define VRDPBMP_RC_CACHED (0x0001)
|
---|
33 | #define VRDPBMP_RC_ALREADY_CACHED (0x0002)
|
---|
34 |
|
---|
35 | #define VRDPBMP_RC_F_DELETED (0x10000)
|
---|
36 |
|
---|
37 | /* Bitmap hash. */
|
---|
38 | #pragma pack (1)
|
---|
39 | typedef struct _VRDPBCHASH
|
---|
40 | {
|
---|
41 | /* A 64 bit hash value of pixels. */
|
---|
42 | uint64_t hash64;
|
---|
43 |
|
---|
44 | /* Bitmap width. */
|
---|
45 | uint16_t cx;
|
---|
46 |
|
---|
47 | /* Bitmap height. */
|
---|
48 | uint16_t cy;
|
---|
49 |
|
---|
50 | /* Bytes per pixel at the bitmap. */
|
---|
51 | uint8_t bytesPerPixel;
|
---|
52 |
|
---|
53 | /* Padding to 16 bytes. */
|
---|
54 | uint8_t padding[3];
|
---|
55 | } VRDPBCHASH;
|
---|
56 | #pragma pack ()
|
---|
57 |
|
---|
58 | typedef struct _VRDPBCENTRY
|
---|
59 | {
|
---|
60 | bool fUsed;
|
---|
61 | struct _VRDPBCENTRY *next;
|
---|
62 | struct _VRDPBCENTRY *prev;
|
---|
63 | VRDPBCHASH hash;
|
---|
64 | } VRDPBCENTRY;
|
---|
65 |
|
---|
66 | typedef struct _VRDPBC
|
---|
67 | {
|
---|
68 | VRDPBCENTRY *head;
|
---|
69 | VRDPBCENTRY *tail;
|
---|
70 | VRDPBCENTRY aEntries[VRDPBMP_N_CACHED_BITMAPS];
|
---|
71 | } VRDPBC;
|
---|
72 |
|
---|
73 | void vrdpbmpReset (VRDPBC *pCache);
|
---|
74 | int vrdpbmpCacheSurface (VRDPBC *pCache, const SURFOBJ *pso, VRDPBCHASH *phash, VRDPBCHASH *phashDeleted);
|
---|
75 |
|
---|
76 | #endif /*VBOXDISPVRDPBMP_H*/
|
---|