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