Give "something" for the handle of a shm sufracebuffer
authorJørgen Lind <jorgen.lind@nokia.com>
Tue, 24 Apr 2012 11:37:52 +0000 (13:37 +0200)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>
Tue, 24 Apr 2012 12:07:11 +0000 (14:07 +0200)
Change-Id: I91647bd515a1497ae999b3f493d60b3250727b67
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
src/compositor/wayland_wrapper/wlsurfacebuffer.cpp

index ad8d3d6..a729eb0 100644 (file)
@@ -178,7 +178,11 @@ void *SurfaceBuffer::handle() const
     if (!m_handle) {
         GraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration();
         SurfaceBuffer *that = const_cast<SurfaceBuffer *>(this);
-        that->m_handle = hwIntegration->lockNativeBuffer(m_buffer, m_compositor->directRenderContext());
+        if (isShmBuffer()) {
+            that->m_handle = wl_shm_buffer_get_data(m_buffer);
+        } else {
+            that->m_handle = hwIntegration->lockNativeBuffer(m_buffer, m_compositor->directRenderContext());
+        }
     }
     return m_handle;
 }