/* $Id$ */
/** @file
* VBox XPDM Display driver
*/
/*
* Copyright (C) 2011-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "VBoxDisp.h"
/*
* The client's glyph cache theoretically consists of 10 caches:
* cache index: 0 1 2 3 4 5 6 7 8 9
* glyph size (max): 0x4 0x4 0x8 0x8 0x10 0x20 0x40 0x80 0x100 0x800
* glyphs: 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe 0x40
*
* Glyph size is the size of the 1 BPP glyph bitmap bytes rounded up to 32 bit dword:
* glyph size = (((w + 7) / 8) * h + 3) & ~3
*
* Following simplifications are used:
* * Cache index 9 is not used, such huge glyphs (~40x40 pixel) are unlikely,
* (especially for raster fonts) so without it all caches contain up to 0xfe
* characters.
* * Maximum string length is 0xfe, so a string can always
* be placed in the cache, even if the string consists of
* all different characters.
*
* The driver always sends glyphs to the host.
* The host maintains the glyph cache. Performance issues:
* - increased the CPU load to copy glyph info.
* + eliminates the driver side of the cache.
* + lets the host to optimize memory usage.
*
* Therefore, on a textout the driver must send to the host
* The string attributes:
* - number of glyphs;
* - flags: HORIZONTAL, VERTICAL, CHAR_INC_EQUAL_BM_BASE, ... (1);
* - glyph increment for monospaced font (== 0 for not monospaced font) or a flag fMonospaced;
* - the bounding box of the string background (prclOpaque or the pstro->rclBkGround);
* - the foreground and background colors;
* - the mix (two ROP2);
* - ... (1).
* The glyph information for each glyph in the string:
* - unique glyph handle 64 bit for use of crc64;
* - the glyph bitmap coordinates on the screen;
* - width, height of the glyph;
* - the glyph origin in the bitmap (2);
* - the 1BPP glyph bitmap;
* - whether it is a 'space' character (3);
* - ... (1).
*
* Remarks:
* (1) to be defined;
* (2) might be not necessary;
* (3) it seems to be not necessary to know the codepoint value,
* strings are considered to be a set of bitmaps from
* the cache space. But reporting that the glyph actually
* represents a 'space' character might allow some optimizations.
*
* The VRDEORDERTEXT consists of the string info and glyph infos.
*
*/
{
/* BYTE-aligned 1BPP bitmap of the glyph. The array includes padding at the end to DWORD-align. */
{
return FALSE;
}
/* 1BPP bitmap. Rows are byte aligned. Size is (((w + 7)/8) * h + 3) & ~3. */
return TRUE;
}
{
return cb;
}
{
LOGF(("pDev %p, pClipRects %p, pstro %p, pfo %p, prclOpaque %p, ulForeRGB %x, ulBackRGB %x",
{
return FALSE;
}
/* The driver can get vertical strings with both SO_HORIZONTAL and SO_VERTICAL bits equal to zero. */
{
/* Do not support (yet) the vertical and right to left strings.
* @todo implement and test.
*/
return FALSE;
}
if ( fi.cjMaxGlyph1 == 0
{
/* No 1BPP bitmaps or the bitmap is larger than the cache supports. */
return FALSE;
}
LOG(("pstro->cGlyphs = %d, fi.cjMaxGlyph1 = 0x%x, cbOrderMax = 0x%x.", pstro->cGlyphs, fi.cjMaxGlyph1, cbOrderMax));
if (!pOrder)
{
return FALSE;
}
if (prclOpaque)
{
}
else
{
}
/* Enumerate glyphs. */
for (;;)
{
ULONG i;
for (i = 0; i < cGlyphs; i++)
{
if (!fResult)
{
break;
}
}
{
break;
}
}
if (fResult)
{
}
return fResult;
}