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// Qt-Security score:significant reason:default
4
5#ifndef QIOSURFACEGRAPHICSBUFFER_H
6#define QIOSURFACEGRAPHICSBUFFER_H
7
8#include <qpa/qplatformgraphicsbuffer.h>
9#include <private/qcore_mac_p.h>
10
11#include <CoreGraphics/CGColorSpace.h>
12#include <IOSurface/IOSurface.h>
13
14QT_BEGIN_NAMESPACE
15
16class QIOSurfaceGraphicsBuffer : public QPlatformGraphicsBuffer
17{
18public:
19 QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format);
20 ~QIOSurfaceGraphicsBuffer();
21
22 void setColorSpace(QCFType<CGColorSpaceRef> colorSpace);
23
24 const uchar *data() const override;
25 uchar *data() override;
26 int bytesPerLine() const override;
27
28 IOSurfaceRef surface();
29 bool isInUse() const;
30
31protected:
32 bool doLock(AccessTypes access, const QRect &rect) override;
33 void doUnlock() override;
34
35private:
36 QCFType<IOSurfaceRef> m_surface;
37
38 friend QDebug operator<<(QDebug, const QIOSurfaceGraphicsBuffer *);
39};
40
41#ifndef QT_NO_DEBUG_STREAM
42QDebug operator<<(QDebug, const QIOSurfaceGraphicsBuffer *);
43#endif
44
45QT_END_NAMESPACE
46
47#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...
FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion &region, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground, qreal sourceTransformFactor) override
Flushes the given region from the specified window, and compositing it with the specified textures li...
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.
void resize(const QSize &size, const QRegion &staticContents) override
#define USE_LAZY_BUFFER_ALLOCATION_DURING_LIVE_WINDOW_RESIZE
QDebug operator<<(QDebug debug, const QIOSurfaceGraphicsBuffer *graphicsBuffer)
QT_BEGIN_NAMESPACE void qt_scrollRectInImage(QImage &, const QRect &, const QPoint &)