Build without hw integration.
authorSamuel Rødal <samuel.rodal@nokia.com>
Mon, 14 May 2012 18:51:04 +0000 (20:51 +0200)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>
Tue, 15 May 2012 06:47:16 +0000 (08:47 +0200)
Change-Id: I011d0e9af8082570b29e9836df40d719bb5e96a6
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
src/compositor/wayland_wrapper/wlsurfacebuffer.cpp

index efd5040..ced3ed2 100644 (file)
@@ -102,9 +102,11 @@ void SurfaceBuffer::destructBufferState()
         if (m_handle) {
             if (m_is_shm) {
                 delete static_cast<QImage *>(m_handle);
+#ifdef QT_COMPOSITOR_WAYLAND_GL
             } else {
                 GraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration();
                 hwIntegration->unlockNativeBuffer(m_handle, m_compositor->directRenderContext());
+#endif
             }
         }
         wl_list_remove(&m_destroy_listener.listener.link);
@@ -198,7 +200,6 @@ void SurfaceBuffer::handleDisplayed()
 void *SurfaceBuffer::handle() const
 {
     if (!m_handle) {
-        GraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration();
         SurfaceBuffer *that = const_cast<SurfaceBuffer *>(this);
         if (isShmBuffer()) {
             const uchar *data = static_cast<const uchar *>(wl_shm_buffer_get_data(m_buffer));
@@ -207,8 +208,11 @@ void *SurfaceBuffer::handle() const
             int height = m_buffer->height;
             QImage *image = new QImage(data,width,height,stride, QImage::Format_ARGB32_Premultiplied);
             that->m_handle = image;
+#ifdef QT_COMPOSITOR_WAYLAND_GL
         } else {
+            GraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration();
             that->m_handle = hwIntegration->lockNativeBuffer(m_buffer, m_compositor->directRenderContext());
+#endif
         }
     }
     return m_handle;
@@ -229,6 +233,9 @@ void SurfaceBuffer::createTexture(GraphicsHardwareIntegration *hwIntegration, QO
 {
 #ifdef QT_COMPOSITOR_WAYLAND_GL
     m_texture = hwIntegration->createTextureFromBuffer(m_buffer, context);
+#else
+    Q_UNUSED(hwIntegration);
+    Q_UNUSED(context);
 #endif
 }