, m_pointerFocusSurface(0)
, m_keyFocusSurface(0)
, m_directRenderSurface(0)
+ , m_graphics_hw_integration(0)
{
compositor = this;
#if defined (QT_COMPOSITOR_WAYLAND_GL)
- m_graphics_hw_integration = GraphicsHardwareIntegration::createGraphicsHardwareIntegration(qt_compositor);
+ if (qt_compositor->topLevelWidget()->platformWindowFormat().windowApi() != QPlatformWindowFormat::Raster)
+ m_graphics_hw_integration = GraphicsHardwareIntegration::createGraphicsHardwareIntegration(qt_compositor);
#endif
m_windowManagerWaylandProtocol = new WindowManagerServerIntegration(this);
void Compositor::initializeHardwareIntegration()
{
#ifdef QT_COMPOSITOR_WAYLAND_GL
- m_graphics_hw_integration->initializeHardware(m_display);
+ if (m_graphics_hw_integration)
+ m_graphics_hw_integration->initializeHardware(m_display);
#endif
}
bool Compositor::setDirectRenderSurface(Surface *surface)
{
#ifdef QT_COMPOSITOR_WAYLAND_GL
- if (m_graphics_hw_integration->setDirectRenderSurface(surface ? surface->handle() : 0)) {
+ if (m_graphics_hw_integration && m_graphics_hw_integration->setDirectRenderSurface(surface ? surface->handle() : 0)) {
m_directRenderSurface = surface;
return true;
}
Q_D(Surface);
d->compositor->surfaceDestroyed(this);
#ifdef QT_COMPOSITOR_WAYLAND_GL
- glDeleteTextures(1,&d->texture_id);
+ if (d->compositor->graphicsHWIntegration())
+ glDeleteTextures(1,&d->texture_id);
#endif
delete d->qtSurface;
}
#ifdef QT_COMPOSITOR_WAYLAND_GL
Q_D(const Surface);
- if (d->type() == WaylandSurface::Texture) {
- if (textureId()) {
+ if (d->compositor->graphicsHWIntegration()) {
+ if (d->type() == WaylandSurface::Texture) {
+ if (textureId()) {
+ return d->compositor->graphicsHWIntegration()->isYInverted(d->buffer());
+ }
+ } else if (d->type() == WaylandSurface::Direct) {
return d->compositor->graphicsHWIntegration()->isYInverted(d->buffer());
}
- } else if (d->type() == WaylandSurface::Direct) {
- return d->compositor->graphicsHWIntegration()->isYInverted(d->buffer());
}
#endif
//shm surfaces are not flipped (in our "world")
Q_D(Surface);
#ifdef QT_COMPOSITOR_WAYLAND_GL
- if (d->type() == WaylandSurface::Direct) {
+ if (d->compositor->graphicsHWIntegration() && d->type() == WaylandSurface::Direct) {
//should the texture be deleted here, or should we explicitly delete it
//when going into direct mode...
if (d->textureCreatedForBuffer) {
d->textureCreatedForBuffer = false;
}
if (d->compositor->graphicsHWIntegration()->postBuffer(d->directRenderBuffer))
- return;
+ return;
}
#endif
GLuint Surface::textureId() const
{
Q_D(const Surface);
- if ( d->type() == WaylandSurface::Texture
- && !d->textureCreatedForBuffer) {
+ if (d->compositor->graphicsHWIntegration() && d->type() == WaylandSurface::Texture
+ && !d->textureCreatedForBuffer) {
glDeleteTextures(1,&d->texture_id);
Surface *that = const_cast<Surface *>(this);
GraphicsHardwareIntegration *hwIntegration = d->compositor->graphicsHWIntegration();