Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwasmbackingstore.h
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWASMBACKINGSTORE_H
5#define QWASMBACKINGSTORE_H
6
7#include <qpa/qplatformbackingstore.h>
8#include <QtGui/qimage.h>
9
10#include <emscripten/val.h>
11
13
14class QOpenGLTexture;
15class QRegion;
16class QWasmCompositor;
17class QWasmWindow;
18
20{
21public:
24
25 QPaintDevice *paintDevice() override;
26
27 void beginPaint(const QRegion &) override;
28 void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
29 void resize(const QSize &size, const QRegion &staticContents) override;
30 QImage toImage() const override;
31 const QImage &getImageRef() const;
32
33 emscripten::val getUpdatedWebImage(QWasmWindow *window);
34
35protected:
37
38private:
39 QWasmCompositor *m_compositor;
40 QImage m_image;
41 QRegion m_dirty;
42 emscripten::val m_webImageDataArray = emscripten::val::undefined();
43};
44
46
47#endif // QWASMBACKINGSTORE_H
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
The QPlatformBackingStore class provides the drawing area for top-level windows.
QWindow * window() const
Returns a pointer to the top-level window associated with this surface.
\inmodule QtCore\reentrant
Definition qpoint.h:25
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtCore
Definition qsize.h:25
void flush(QWindow *window, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
QWasmBackingStore(QWasmCompositor *compositor, QWindow *window)
emscripten::val getUpdatedWebImage(QWasmWindow *window)
void beginPaint(const QRegion &) override
This function is called before painting onto the surface begins, with the region in which the paintin...
void resize(const QSize &size, const QRegion &staticContents) override
void updateTexture(QWasmWindow *window)
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
const QImage & getImageRef() const
QImage toImage() const override
Implemented in subclasses to return the content of the backingstore as a QImage.
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
static QOpenGLCompositor * compositor
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLintptr offset