| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 4 |
|
| 5 |
#ifndef QXCBBACKINGSTORE_H |
| 6 |
#define QXCBBACKINGSTORE_H |
| 7 |
|
| 8 |
#include <qpa/qplatformbackingstore.h> |
| 9 |
#include <QtCore/QStack> |
| 10 |
|
| 11 |
#include <xcb/xcb.h> |
| 12 |
|
| 13 |
#include "qxcbobject.h" |
| 14 |
|
| 15 |
QT_BEGIN_NAMESPACE |
| 16 |
|
| 17 |
class QXcbShmImage; |
| 18 |
|
| 19 |
class QXcbBackingStore : public QXcbObject, public QPlatformBackingStore |
| 20 |
{ |
| 21 |
public: |
| 22 |
QXcbBackingStore(QWindow *window); |
| 23 |
~QXcbBackingStore(); |
| 24 |
|
| 25 |
QPaintDevice *paintDevice() override; |
| 26 |
void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; |
| 27 |
#ifndef QT_NO_OPENGL |
| 28 |
void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, |
| 29 |
QPlatformTextureList *textures, |
| 30 |
bool translucentBackground) override; |
| 31 |
#endif |
| 32 |
QImage toImage() const override; |
| 33 |
|
| 34 |
QPlatformGraphicsBuffer *graphicsBuffer() const override; |
| 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 |
private: |
| 43 |
QXcbShmImage *m_image; |
| 44 |
QStack<QRegion> m_paintRegions; |
| 45 |
QImage m_rgbImage; |
| 46 |
}; |
| 47 |
|
| 48 |
QT_END_NAMESPACE |
| 49 |
|
| 50 |
#endif |