summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoabackingstore.h
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-20 01:00:08 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-03-20 14:09:30 +0100
commit6893919b0c4cddfbd82ebf963cc7bebde816b1b3 (patch)
tree9bfa1b57707fe609f9401c5b3bd5cd85ec1ae777 /src/plugins/platforms/cocoa/qcocoabackingstore.h
parent3ca05b2a2e80863202bdb6a225f72debbb28b8fe (diff)
parent2bafd997ee515d3b6a6a8fb030e1265a4713713e (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/gui/kernel/qplatformintegration.cpp src/gui/kernel/qplatformintegration.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/xcb/qxcbconnection_screens.cpp Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoabackingstore.h')
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.h52
1 files changed, 49 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h
index b4cd506513..508f24d578 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.h
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h
@@ -44,13 +44,16 @@
#include <private/qcore_mac_p.h>
+#include <QScopedPointer>
+#include "qiosurfacegraphicsbuffer.h"
+
QT_BEGIN_NAMESPACE
-class QCocoaBackingStore : public QRasterBackingStore
+class QNSWindowBackingStore : public QRasterBackingStore
{
public:
- QCocoaBackingStore(QWindow *window);
- ~QCocoaBackingStore();
+ QNSWindowBackingStore(QWindow *window);
+ ~QNSWindowBackingStore();
void flush(QWindow *, const QRegion &, const QPoint &) override;
@@ -60,6 +63,49 @@ private:
void redrawRoundedBottomCorners(CGRect) const;
};
+class QCALayerBackingStore : public QPlatformBackingStore
+{
+public:
+ QCALayerBackingStore(QWindow *window);
+ ~QCALayerBackingStore();
+
+ void resize(const QSize &size, const QRegion &staticContents) override;
+
+ void beginPaint(const QRegion &region) override;
+ QPaintDevice *paintDevice() override;
+ void endPaint() override;
+
+ void flush(QWindow *, const QRegion &, const QPoint &) override;
+ void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
+ QPlatformTextureList *textures, bool translucentBackground) override;
+
+ QPlatformGraphicsBuffer *graphicsBuffer() const override;
+
+private:
+ QSize m_requestedSize;
+ QRegion m_paintedRegion;
+
+ class GraphicsBuffer : public QIOSurfaceGraphicsBuffer
+ {
+ public:
+ GraphicsBuffer(const QSize &size, qreal devicePixelRatio,
+ const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace);
+
+ QRegion dirtyRegion; // In unscaled coordinates
+ QImage *asImage();
+
+ private:
+ qreal m_devicePixelRatio;
+ QImage m_image;
+ };
+
+ void ensureBackBuffer();
+ bool recreateBackBufferIfNeeded();
+ bool prepareForFlush();
+
+ std::list<std::unique_ptr<GraphicsBuffer>> m_buffers;
+};
+
QT_END_NAMESPACE
#endif