Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qxcbbackingstore.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QXCBBACKINGSTORE_H
5#define QXCBBACKINGSTORE_H
6
7#include <qpa/qplatformbackingstore.h>
8#include <QtCore/QStack>
9
10#include <xcb/xcb.h>
11
12#include "qxcbobject.h"
13
15
17
19{
20public:
23
24 QPaintDevice *paintDevice() override;
25 void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
27 qreal sourceDevicePixelRatio,
28 const QRegion &region,
29 const QPoint &offset,
31 bool translucentBackground) override;
32 QImage toImage() const override;
33
35
36 void resize(const QSize &size, const QRegion &staticContents) override;
37 bool scroll(const QRegion &area, int dx, int dy) override;
38
39 void beginPaint(const QRegion &) override;
40 void endPaint() override;
41
42 static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize = 1,
43 void *shmInfo = nullptr);
44
45protected:
46 virtual void render(xcb_window_t window, const QRegion &region, const QPoint &offset);
47 virtual void recreateImage(QXcbWindow *win, const QSize &size);
48
50 QStack<QRegion> m_paintRegions;
52};
53
55{
56public:
59
60 void beginPaint(const QRegion &) override;
61
62protected:
63 void render(xcb_window_t window, const QRegion &region, const QPoint &offset) override;
64 void recreateImage(QXcbWindow *win, const QSize &size) override;
65
66private:
67 void initXRenderMode();
68
69 xcb_pixmap_t m_xrenderPixmap = XCB_NONE;
70 xcb_render_picture_t m_xrenderPicture = XCB_NONE;
71 xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE;
72 xcb_render_picture_t m_windowPicture = XCB_NONE;
73
74 bool m_usingXRenderMode = false;
75 bool m_useGrabbedBackgound = false;
76 QPixmap m_grabbedBackground;
77};
78
80
81#endif
\inmodule QtGui
Definition qimage.h:37
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
The QPlatformBackingStore class provides the drawing area for top-level windows.
QWindow * window() const
Returns a pointer to the top-level window associated with this surface.
\inmodule QtCore\reentrant
Definition qpoint.h:25
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtCore
Definition qsize.h:25
\inmodule QtGui
Definition qwindow.h:63
QXcbBackingStoreImage * m_image
QPlatformGraphicsBuffer * graphicsBuffer() const override
Accessor for a backingstores graphics buffer abstraction.
void resize(const QSize &size, const QRegion &staticContents) override
FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion &region, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override
Flushes the given region from the specified window, and compositing it with the specified textures li...
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
QXcbBackingStore(QWindow *window)
void endPaint() override
This function is called after painting onto the surface has ended.
virtual void render(xcb_window_t window, const QRegion &region, const QPoint &offset)
void flush(QWindow *window, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
virtual void recreateImage(QXcbWindow *win, const QSize &size)
QStack< QRegion > m_paintRegions
static bool createSystemVShmSegment(xcb_connection_t *c, size_t segmentSize=1, void *shmInfo=nullptr)
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
bool scroll(const QRegion &area, int dx, int dy) override
Scrolls the given area dx pixels to the right and dy downward; both dx and dy may be negative.
void render(xcb_window_t window, const QRegion &region, const QPoint &offset) override
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
void recreateImage(QXcbWindow *win, const QSize &size) override
QXcbSystemTrayBackingStore(QWindow *window)
Combined button and popup list for selecting options.
static int area(const QSize &s)
Definition qicon.cpp:153
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint const GLuint GLuint const GLuint * textures
GLenum GLuint GLintptr offset
const GLubyte * c
double qreal
Definition qtypes.h:187
QWidget * win
Definition settings.cpp:6