From 2cf7a4bad3c8935f2a319dfe003f29c21a95edfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 17 Jun 2013 13:41:35 +0200 Subject: [PATCH] Provide pixmap format in XShm helper --- xcbutils.cpp | 2 ++ xcbutils.h | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/xcbutils.cpp b/xcbutils.cpp index 5bff1de8f2..5a24cb3ed2 100644 --- a/xcbutils.cpp +++ b/xcbutils.cpp @@ -265,6 +265,7 @@ Shm::Shm() , m_buffer(NULL) , m_segment(XCB_NONE) , m_valid(false) + , m_pixmapFormat(XCB_IMAGE_FORMAT_XY_BITMAP) { m_valid = init(); } @@ -290,6 +291,7 @@ bool Shm::init() qDebug() << "Failed to get SHM extension version information"; return false; } + m_pixmapFormat = version->pixmap_format; const int MAXSIZE = 4096 * 2048 * 4; // TODO check there are not larger windows m_shmId = shmget(IPC_PRIVATE, MAXSIZE, IPC_CREAT | 0600); if (m_shmId < 0) { diff --git a/xcbutils.h b/xcbutils.h index 4ce56eac25..5359fd1166 100644 --- a/xcbutils.h +++ b/xcbutils.h @@ -923,12 +923,14 @@ public: void *buffer() const; xcb_shm_seg_t segment() const; bool isValid() const; + uint8_t pixmapFormat() const; private: bool init(); int m_shmId; void *m_buffer; xcb_shm_seg_t m_segment; bool m_valid; + uint8_t m_pixmapFormat; }; inline @@ -955,6 +957,12 @@ int Shm::shmId() const return m_shmId; } +inline +uint8_t Shm::pixmapFormat() const +{ + return m_pixmapFormat; +} + } // namespace X11 } // namespace KWin