- Rendering is enables after a graphic context refresh was send.
, isMapped(false)
, pixmap(0)
, texture(0)
+ , m_isReadyForRendering(false)
{
}
~XPlatformSurface()
{
}
+
+ bool enableRendering()
+ {
+ m_isReadyForRendering = true;
+ }
+ bool disableRendering()
+ {
+ m_isReadyForRendering = false;
+ }
+
+ bool isReadyForRendering()
+ {
+ return m_isReadyForRendering;
+ }
// TODO: private/protected
bool isMapped;
Pixmap pixmap;
uint texture;
+ bool m_isReadyForRendering;
};
#endif /* _XPLATFORMSURFACE_H_ */
{
nativeSurface = (XPlatformSurface*)surface->platform;
}
- if( nativeSurface != NULL && surface->getNativeContent() != 0 )
+ if( nativeSurface != NULL && surface->getNativeContent() != 0 && nativeSurface->isReadyForRendering())
{
pixmap = XCompositeNameWindowPixmap (dpy, surface->getNativeContent());
if (!pixmap)
{
nativeSurface = (XPlatformSurface*)surface->platform;
}
- if( nativeSurface != NULL && surface->getNativeContent() != 0 )
+ if( nativeSurface != NULL && surface->getNativeContent() != 0 && nativeSurface->isReadyForRendering())
{
pixmap = XCompositeNameWindowPixmap (dpy, surface->getNativeContent());
if (!pixmap)
bool X11EglImage::bindSurfaceTexture(Surface* surface)
{
EglXPlatformSurface* nativeSurface = (EglXPlatformSurface*)surface->platform;
- if (nativeSurface)
+ if (nativeSurface && nativeSurface->isReadyForRendering())
{
glBindTexture(GL_TEXTURE_2D, nativeSurface->texture);
if (nativeSurface->eglImage)
bool X11TextureFromPixmap::unbindSurfaceTexture(Surface* surface)
{
GLXPlatformSurface* nativeSurface = (GLXPlatformSurface*)surface->platform;
- if (nativeSurface)
+ if (nativeSurface && nativeSurface->isReadyForRendering())
{
glXReleaseTexImageEXT_func(dpy, nativeSurface->glxPixmap, GLX_FRONT_LEFT_EXT);
return true;
{
LOG_WARNING("X11WindowSystem", "Surface empty during damage notification");
break;
+ } else {
+ if (currentSurface->platform != NULL)
+ {
+ /* Enable Rendering for Surface, after damage Notification was send successfully */
+ /* This will ensure, that the content is not dirty */
+ ((XPlatformSurface *)(currentSurface->platform))->enableRendering();
+ }
}
currentSurface->damaged = true;
checkRedraw = true;