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
qhaikurasterbackingstore.cpp
Go to the documentation of this file.
1// Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias Koenig <tobias.koenig@kdab.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6
7#include <Bitmap.h>
8#include <View.h>
9
11
17
19{
20 delete m_bitmap;
21 m_bitmap = nullptr;
22}
23
25{
26 if (!m_bufferSize.isEmpty() && m_bitmap)
27 return m_buffer.image();
28
29 return nullptr;
30}
31
33{
34 Q_UNUSED(region);
36
37 if (!window)
38 return;
39
40 QHaikuRasterWindow *targetWindow = static_cast<QHaikuRasterWindow*>(window->handle());
41
42 BView *view = targetWindow->nativeViewHandle();
43
44 view->LockLooper();
45 view->DrawBitmap(m_bitmap);
46 view->UnlockLooper();
47}
48
49void QHaikuRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
50{
51 Q_UNUSED(staticContents);
52
53 if (m_bufferSize == size)
54 return;
55
56 delete m_bitmap;
57 m_bitmap = new BBitmap(BRect(0, 0, size.width(), size.height()), B_RGB32, false, true);
58 m_buffer = QHaikuBuffer(m_bitmap);
59 m_bufferSize = size;
60}
61
const QImage * image() const
void flush(QWindow *window, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
void resize(const QSize &size, const QRegion &staticContents) override
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
BView * nativeViewHandle() const
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
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
Definition qsize.h:124
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLintptr offset
#define Q_UNUSED(x)
QObject::connect nullptr
aWidget window() -> setWindowTitle("New Window Title")
[2]
QQuickView * view
[0]