[client] spice: initialize new surfaces to black

This commit is contained in:
Geoffrey McRae 2022-05-24 00:17:08 +10:00
parent b2221b114e
commit faae785c44
2 changed files with 13 additions and 0 deletions

View File

@ -502,6 +502,18 @@ void egl_desktopSpiceConfigure(EGL_Desktop * desktop, int width, int height)
void egl_desktopSpiceDrawFill(EGL_Desktop * desktop, int x, int y, int width, void egl_desktopSpiceDrawFill(EGL_Desktop * desktop, int x, int y, int width,
int height, uint32_t color) int height, uint32_t color)
{ {
/* this is a fairly hacky way to do this, but since it's only for the fallback
* spice display it's not really an issue */
uint32_t line[width];
for(int x = 0; x < width; ++x)
line[x] = color;
for(; y < height; ++y)
egl_textureUpdateRect(desktop->spiceTexture,
x, y, width, 1, sizeof(line), (uint8_t *)line, false);
atomic_store(&desktop->processFrame, true);
} }
void egl_desktopSpiceDrawBitmap(EGL_Desktop * desktop, int x, int y, int width, void egl_desktopSpiceDrawBitmap(EGL_Desktop * desktop, int x, int y, int width,

View File

@ -885,6 +885,7 @@ static void spice_surfaceCreate(unsigned int surfaceId, PSSurfaceFormat format,
core_updatePositionInfo(); core_updatePositionInfo();
renderQueue_spiceConfigure(width, height); renderQueue_spiceConfigure(width, height);
renderQueue_spiceDrawFill(0, 0, width, height, 0x0);
} }
static void spice_surfaceDestroy(unsigned int surfaceId) static void spice_surfaceDestroy(unsigned int surfaceId)