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
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
4
#
include
"qhaikurasterbackingstore.h"
5
#
include
"qhaikurasterwindow.h"
6
7
#
include
<
Bitmap
.
h
>
8
#
include
<
View
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
QHaikuRasterBackingStore
::
QHaikuRasterBackingStore
(
QWindow
*
window
)
13
: QPlatformBackingStore(window)
14
, m_bitmap(
nullptr
)
15
{
16
}
17
18
QHaikuRasterBackingStore
::~
QHaikuRasterBackingStore
()
19
{
20
delete
m_bitmap;
21
m_bitmap =
nullptr
;
22
}
23
24
QPaintDevice
*
QHaikuRasterBackingStore
::
paintDevice
()
25
{
26
if
(!m_bufferSize.isEmpty() && m_bitmap)
27
return
m_buffer.image();
28
29
return
nullptr
;
30
}
31
32
void
QHaikuRasterBackingStore
::flush(QWindow *window,
const
QRegion ®ion,
const
QPoint &offset)
33
{
34
Q_UNUSED(region);
35
Q_UNUSED(offset);
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
49
void
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
62
QT_END_NAMESPACE
QHaikuRasterBackingStore
Definition
qhaikurasterbackingstore.h:17
QHaikuRasterBackingStore::~QHaikuRasterBackingStore
~QHaikuRasterBackingStore()
Definition
qhaikurasterbackingstore.cpp:18
QHaikuRasterBackingStore::resize
void resize(const QSize &size, const QRegion &staticContents) override
Definition
qhaikurasterbackingstore.cpp:49
QHaikuRasterBackingStore::paintDevice
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
Definition
qhaikurasterbackingstore.cpp:24
QWindow
\inmodule QtGui
Definition
qwindow.h:63
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtbase
src
plugins
platforms
haiku
qhaikurasterbackingstore.cpp
Generated on
for Qt by
1.14.0