Hand-apply patches (X11rdp: fix for frame buffer getting smaller in randr) from Authentic8 branch: 1e92a08

ulab-next
Jim Grandy 12 years ago
parent 81488cd615
commit 984e12a54e

@ -114,7 +114,9 @@ struct _rdpScreenInfoRec
int height;
int depth;
int bitsPerPixel;
int sizeInBytes;
int sizeInBytes; /* size of current used frame buffer */
int sizeInBytesAlloc; /* size of current alloc frame buffer,
always >= sizeInBytes */
char* pfbMemory;
Pixel blackPixel;
Pixel whitePixel;

@ -274,6 +274,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
(g_rdpScreen.paddedWidthInBytes * g_rdpScreen.height);
ErrorF("buffer size %d\n", g_rdpScreen.sizeInBytes);
g_rdpScreen.pfbMemory = (char *)g_malloc(g_rdpScreen.sizeInBytes, 1);
g_rdpScreen.sizeInBytesAlloc = g_rdpScreen.sizeInBytes;
}
if (g_rdpScreen.pfbMemory == 0)

@ -156,8 +156,13 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
ErrorF(" resizing screenPixmap [%p] to %dx%d, currently at %dx%d\n",
(void *)screenPixmap, width, height,
screenPixmap->drawable.width, screenPixmap->drawable.height);
if (g_rdpScreen.sizeInBytes > g_rdpScreen.sizeInBytesAlloc)
{
g_free(g_rdpScreen.pfbMemory);
g_rdpScreen.pfbMemory = g_malloc(g_rdpScreen.sizeInBytes, 1);
g_rdpScreen.pfbMemory = (char*)g_malloc(g_rdpScreen.sizeInBytes, 1);
g_rdpScreen.sizeInBytesAlloc = g_rdpScreen.sizeInBytes;
ErrorF("new buffer size %d\n", g_rdpScreen.sizeInBytes);
}
pScreen->ModifyPixmapHeader(screenPixmap, width, height,
g_rdpScreen.depth, g_rdpScreen.bitsPerPixel,
g_rdpScreen.paddedWidthInBytes,

Loading…
Cancel
Save