Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qiosurfacegraphicsbuffer.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QIOSURFACEGRAPHICSBUFFER_H
5#define QIOSURFACEGRAPHICSBUFFER_H
6
7#include <qpa/qplatformgraphicsbuffer.h>
8#include <private/qcore_mac_p.h>
9
10#include <CoreGraphics/CGColorSpace.h>
11#include <IOSurface/IOSurface.h>
12
13QT_BEGIN_NAMESPACE
14
15class QIOSurfaceGraphicsBuffer : public QPlatformGraphicsBuffer
16{
17public:
18 QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format);
19 ~QIOSurfaceGraphicsBuffer();
20
21 void setColorSpace(QCFType<CGColorSpaceRef> colorSpace);
22
23 const uchar *data() const override;
24 uchar *data() override;
25 int bytesPerLine() const override;
26
27 IOSurfaceRef surface();
28 bool isInUse() const;
29
30protected:
31 bool doLock(AccessTypes access, const QRect &rect) override;
32 void doUnlock() override;
33
34private:
35 QCFType<IOSurfaceRef> m_surface;
36
37 friend QDebug operator<<(QDebug, const QIOSurfaceGraphicsBuffer *);
38};
39
40#ifndef QT_NO_DEBUG_STREAM
41QDebug operator<<(QDebug, const QIOSurfaceGraphicsBuffer *);
42#endif
43
44QT_END_NAMESPACE
45
46#endif // QIOSURFACEGRAPHICSBUFFER_H
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
bool scroll(const QRegion &region, 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 endPaint() override
This function is called after painting onto the surface has ended.
void flush(QWindow *, const QRegion &, const QPoint &) override
Flushes the given region from the specified window.
void beginPaint(const QRegion &region) override
This function is called before painting onto the surface begins, with the region in which the paintin...
QPlatformGraphicsBuffer * graphicsBuffer() const override
Accessor for a backingstores graphics buffer abstraction.
bool eventFilter(QObject *watched, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
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...
void resize(const QSize &size, const QRegion &staticContents) override
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
#define USE_LAZY_BUFFER_ALLOCATION_DURING_LIVE_WINDOW_RESIZE
QDebug operator<<(QDebug debug, const QIOSurfaceGraphicsBuffer *graphicsBuffer)