44 #include <private/qhighdpiscaling_p.h>
47 #if QT_CONFIG(xrender)
48 # include <X11/extensions/Xrender.h>
63 , m_translucentBackground(
false)
66 m_translucentBackground =
w->connection()->hasXRender() &&
95 if (!platformWindow) {
96 qWarning(
"QXcbBackingStore::flush: QWindow has no platform window (QTBUG-32681)");
105 #if QT_CONFIG(xrender)
106 if (m_translucentBackground)
108 XWindowAttributes attrib;
109 XGetWindowAttributes(display(), wid, &attrib);
110 XRenderPictFormat *
format = XRenderFindVisualFormat(display(), attrib.visual);
113 Picture dstPic = XRenderCreatePicture(display(), wid,
format, 0, 0);
115 XRenderSetPictureClipRectangles(display(), dstPic, 0, 0, clipRects.
constData(), clipRects.
size());
117 XRenderComposite(display(), PictOpSrc, srcPic,
None, dstPic,
123 XRenderFreePicture(display(), dstPic);
128 GC gc = XCreateGC(display(), wid, 0,
nullptr);
130 if (clipRects.
size() != 1)
131 XSetClipRectangles(display(), gc, 0, 0, clipRects.
data(), clipRects.
size(), YXBanded);
134 XFreeGC(display(), gc);
157 #if QT_CONFIG(xrender)
158 if (m_translucentBackground && newPixmap.
depth() != 32)
168 GC gc = XCreateGC(display(), to, 0,
nullptr);
169 XCopyArea(display(), from, to, gc, br.
x(), br.
y(), br.
width(), br.
height(), br.
x(), br.
y());
170 XFreeGC(display(), gc);
174 m_pixmap = newPixmap;
185 GC gc = XCreateGC(display(),
pix, 0,
nullptr);
186 XCopyArea(display(),
pix,
pix, gc,
189 XFreeGC(display(), gc);
199 #if QT_CONFIG(xrender)
200 if (m_translucentBackground) {
202 const XRenderColor
color = { 0, 0, 0, 0 };
203 XRenderFillRectangles(display(), PictOpSrc,
212 Display *QXcbNativeBackingStore::display()
const
The QImage class provides a hardware-independent image representation that allows direct access to th...
static QPixelFormat toPixelFormat(QImage::Format format) noexcept
qsizetype size() const noexcept
const_pointer constData() const noexcept
The QPixmap class is an off-screen image representation that can be used as a paint device.
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
constexpr bool isEmpty() const noexcept
constexpr int height() const noexcept
constexpr bool isNull() const noexcept
QRect intersected(const QRect &other) const noexcept
constexpr int x() const noexcept
constexpr int width() const noexcept
constexpr QRect translated(int dx, int dy) const noexcept
constexpr int y() const noexcept
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr int height() const noexcept
constexpr int width() const noexcept
The QWindow class represents a window in the underlying windowing system.
void beginPaint(const QRegion ®ion) override
QXcbNativeBackingStore(QWindow *window)
void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override
QImage toImage() const override
~QXcbNativeBackingStore()
QPaintDevice * paintDevice() override
void resize(const QSize &size, const QRegion &staticContents) override
bool scroll(const QRegion &area, int dx, int dy) override
xcb_window_t xcb_window() const
void updateSyncRequestCounter()
[Window class definition]
T toNativePixels(const T &value, const C *context)
DBusConnection * connection
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
Pixmap qt_x11PixmapHandle(const QPixmap &pixmap)
Picture qt_x11PictureHandle(const QPixmap &pixmap)
QX11PlatformPixmap * qt_x11Pixmap(const QPixmap &pixmap)
QList< XRectangle > qt_region_to_xrectangles(const QRegion &r)