diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-07-01 09:44:46 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-07-11 12:13:30 +0000 |
commit | 48e241740974ca1b8ba7d654958c423ca9ec9e0e (patch) | |
tree | baa3a2a0aac05ff3a8a8b54be8a22f1e7d943a80 /src/compositor | |
parent | 839f40ccf522bef3ed4b499899a23393a9a8a1aa (diff) |
Compositor: Rename shm to sharedMemory
sharedMemory is much clearer and will increase the readability of the code and
API.
Change-Id: Ibb6d7424fa8d44a94a0f4ddf476a564eb235323f
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
Diffstat (limited to 'src/compositor')
9 files changed, 22 insertions, 21 deletions
diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro index a83223c05..251d757e2 100644 --- a/src/compositor/compositor.pro +++ b/src/compositor/compositor.pro @@ -23,7 +23,7 @@ INCLUDEPATH += ../shared HEADERS += ../shared/qwaylandmimehelper_p.h \ ../shared/qwaylandinputmethodeventbuilder_p.h \ - ../shared/qwaylandshmformathelper_p.h + ../shared/qwaylandsharedmemoryformathelper_p.h SOURCES += ../shared/qwaylandmimehelper.cpp \ ../shared/qwaylandinputmethodeventbuilder.cpp diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp index 209117ed2..9bdac5dbb 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.cpp +++ b/src/compositor/compositor_api/qwaylandbufferref.cpp @@ -205,8 +205,8 @@ QWaylandBufferRef::BufferType QWaylandBufferRef::bufferType() const if (d->nullOrDestroyed()) return BufferType_Null; - if (isShm()) - return BufferType_Shm; + if (isSharedMemory()) + return BufferType_SharedMemory; return BufferType_Egl; } @@ -222,12 +222,12 @@ QWaylandBufferRef::BufferFormatEgl QWaylandBufferRef::bufferFormatEgl() const /*! * Returns true if the buffer is a shared memory buffer. Otherwise returns false. */ -bool QWaylandBufferRef::isShm() const +bool QWaylandBufferRef::isSharedMemory() const { if (d->nullOrDestroyed()) return false; - return d->buffer->isShm(); + return d->buffer->isSharedMemory(); } /*! @@ -267,7 +267,7 @@ void QWaylandBufferRef::bindToTexture() const void QWaylandBufferRef::updateTexture() const { - if (d->nullOrDestroyed() || d->buffer->isShm()) + if (d->nullOrDestroyed() || d->buffer->isSharedMemory()) return; d->buffer->updateTexture(); diff --git a/src/compositor/compositor_api/qwaylandbufferref.h b/src/compositor/compositor_api/qwaylandbufferref.h index c3953b440..bca42df96 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.h +++ b/src/compositor/compositor_api/qwaylandbufferref.h @@ -77,7 +77,7 @@ public: enum BufferType { BufferType_Null, - BufferType_Shm, + BufferType_SharedMemory, BufferType_Egl }; @@ -94,7 +94,7 @@ public: BufferType bufferType() const; BufferFormatEgl bufferFormatEgl() const; - bool isShm() const; + bool isSharedMemory() const; QImage image() const; #ifdef QT_WAYLAND_COMPOSITOR_GL GLuint textureForPlane(int plane) const; diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 7d09fa783..c2693a2d6 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -63,7 +63,7 @@ #include "extensions/qwaylandqtwindowmanager.h" #include "qwaylandxkb_p.h" -#include "qwaylandshmformathelper_p.h" +#include "qwaylandsharedmemoryformathelper_p.h" #include <QtCore/QCoreApplication> #include <QtCore/QStringList> @@ -174,7 +174,7 @@ void QWaylandCompositorPrivate::init() data_device_manager = new QtWayland::DataDeviceManager(q); wl_display_init_shm(display); - QVector<wl_shm_format> formats = QWaylandShmFormatHelper::supportedWaylandFormats(); + QVector<wl_shm_format> formats = QWaylandSharedMemoryFormatHelper::supportedWaylandFormats(); foreach (wl_shm_format format, formats) wl_display_add_shm_format(display, format); @@ -836,13 +836,13 @@ void QWaylandCompositor::setUseHardwareIntegrationExtension(bool use) * The default implementation requires a OpenGL context to be bound to the current thread * to work. If this is not possible reimplement this function in your compositor subclass * to implement custom logic. - * The default implementation only grabs SHM and OpenGL buffers, reimplement this in your + * The default implementation only grabs shared memory and OpenGL buffers, reimplement this in your * compositor subclass to handle more buffer types. * You should not call this manually, but rather use \a QWaylandSurfaceGrabber. */ void QWaylandCompositor::grabSurface(QWaylandSurfaceGrabber *grabber, const QWaylandBufferRef &buffer) { - if (buffer.isShm()) { + if (buffer.isSharedMemory()) { emit grabber->success(buffer.image()); } else { #ifdef QT_WAYLAND_COMPOSITOR_GL diff --git a/src/compositor/compositor_api/qwaylandquickcompositor.cpp b/src/compositor/compositor_api/qwaylandquickcompositor.cpp index dc13368f2..75fe35947 100644 --- a/src/compositor/compositor_api/qwaylandquickcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandquickcompositor.cpp @@ -114,7 +114,7 @@ void QWaylandQuickCompositor::componentComplete() */ void QWaylandQuickCompositor::grabSurface(QWaylandSurfaceGrabber *grabber, const QWaylandBufferRef &buffer) { - if (buffer.isShm()) { + if (buffer.isSharedMemory()) { QWaylandCompositor::grabSurface(grabber, buffer); return; } diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 203b9ac44..f47104d7e 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -296,7 +296,7 @@ public: delete m_sgTex; m_sgTex = 0; if (m_ref.hasBuffer()) { - if (buffer.isShm()) { + if (buffer.isSharedMemory()) { m_sgTex = surfaceItem->window()->createTextureFromImage(buffer.image()); if (m_sgTex) { m_sgTex->bind(); @@ -1080,7 +1080,7 @@ QSGNode *QWaylandQuickItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDat const QRectF rect = invertY ? QRectF(0, height(), width(), -height()) : QRectF(0, 0, width(), height()); - if (ref.isShm() || bufferTypes[ref.bufferFormatEgl()].canProvideTexture) { + if (ref.isSharedMemory() || bufferTypes[ref.bufferFormatEgl()].canProvideTexture) { QSGSimpleTextureNode *node = static_cast<QSGSimpleTextureNode *>(oldNode); if (!node) { diff --git a/src/compositor/compositor_api/qwaylandsurfacegrabber.cpp b/src/compositor/compositor_api/qwaylandsurfacegrabber.cpp index 0eb85b0c6..beeea9f98 100644 --- a/src/compositor/compositor_api/qwaylandsurfacegrabber.cpp +++ b/src/compositor/compositor_api/qwaylandsurfacegrabber.cpp @@ -51,7 +51,8 @@ QT_BEGIN_NAMESPACE Sometimes it is needed to get the contents of a surface, for example to provide a screenshot to the user. The QWaylandSurfaceGrabber class provides a simple method to do so, without - having to care what type of buffer backs the surface, be it SHM, OpenGL or something else. + having to care what type of buffer backs the surface, be it shared memory, OpenGL or something + else. */ /*! diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index c2441fae1..71ae6e212 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -44,7 +44,7 @@ #include <QtCore/QDebug> #include <wayland-server-protocol.h> -#include "qwaylandshmformathelper_p.h" +#include "qwaylandsharedmemoryformathelper_p.h" #include <QtWaylandCompositor/private/qwaylandcompositor_p.h> @@ -176,7 +176,7 @@ QSize SurfaceBuffer::size() const QWaylandSurface::Origin SurfaceBuffer::origin() const { - if (isShm()) { + if (isSharedMemory()) { return QWaylandSurface::OriginTopLeft; } @@ -201,7 +201,7 @@ QImage SurfaceBuffer::image() const QWaylandBufferRef::BufferFormatEgl SurfaceBuffer::bufferFormatEgl() const { - Q_ASSERT(isShm() == false); + Q_ASSERT(isSharedMemory() == false); if (QtWayland::ClientBufferIntegration *clientInt = QWaylandCompositorPrivate::get(m_compositor)->clientBufferIntegration()) return clientInt->bufferFormat(m_buffer); @@ -212,7 +212,7 @@ QWaylandBufferRef::BufferFormatEgl SurfaceBuffer::bufferFormatEgl() const void SurfaceBuffer::bindToTexture() const { Q_ASSERT(m_compositor); - if (isShm()) { + if (isSharedMemory()) { QImage image = this->image(); if (image.hasAlphaChannel()) { if (image.format() != QImage::Format_RGBA8888) { diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 95e7e8158..609581493 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -101,7 +101,7 @@ public: QSize size() const; QWaylandSurface::Origin origin() const; - bool isShm() const { return wl_shm_buffer_get(m_buffer); } + bool isSharedMemory() const { return wl_shm_buffer_get(m_buffer); } QImage image() const; QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const; |