Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsgsoftwarepixmaptexture.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 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
#
include
"qsgsoftwarepixmaptexture_p.h"
6
#
include
<
private
/
qsgcontext_p
.
h
>
7
8
QT_BEGIN_NAMESPACE
9
10
QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(
const
QImage &image, uint flags)
11
{
12
// Prevent pixmap format conversion to reduce memory consumption
13
// and surprises in calling code. (See QTBUG-47328)
14
if
(flags & QSGRenderContext::CreateTexture_Alpha) {
15
//If texture should have an alpha
16
m_pixmap = QPixmap::fromImage(image, Qt::NoFormatConversion);
17
}
else
{
18
//Force opaque texture
19
m_pixmap = QPixmap::fromImage(image.convertToFormat(QImage::Format_RGB32), Qt::NoFormatConversion);
20
}
21
}
22
23
QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(
const
QPixmap &pixmap)
24
: m_pixmap(pixmap)
25
{
26
}
27
28
QSize QSGSoftwarePixmapTexture::textureSize()
const
29
{
30
return
m_pixmap.size();
31
}
32
33
bool
QSGSoftwarePixmapTexture::hasAlphaChannel()
const
34
{
35
return
m_pixmap.hasAlphaChannel();
36
}
37
38
bool
QSGSoftwarePixmapTexture::hasMipmaps()
const
39
{
40
return
false
;
41
}
42
43
qint64 QSGSoftwarePixmapTexture::comparisonKey()
const
44
{
45
return
0;
46
}
47
48
QT_END_NAMESPACE
49
50
#
include
"moc_qsgsoftwarepixmaptexture_p.cpp"
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtdeclarative
src
quick
scenegraph
adaptations
software
qsgsoftwarepixmaptexture.cpp
Generated on
for Qt by
1.18.0