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
qsgtexturereader.cpp
Go to the documentation of this file.
1
// Copyright (C) 2017 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
4
#
include
"qsgtexturereader_p.h"
5
#
include
<
private
/
qtexturefilereader_p
.
h
>
6
7
#
include
<
private
/
qsgcompressedtexture_p
.
h
>
8
9
QT_BEGIN_NAMESPACE
10
11
QSGTextureReader
::
QSGTextureReader
(
QIODevice
*
device
,
const
QString
&
fileName
)
12
{
13
m_reader =
new
QTextureFileReader(device, fileName);
14
}
15
16
QSGTextureReader::~QSGTextureReader()
17
{
18
delete
m_reader;
19
}
20
21
QQuickTextureFactory *
QSGTextureReader
::
read
()
22
{
23
if
(!m_reader)
24
return
nullptr
;
25
26
QTextureFileData texData = m_reader->read();
27
if
(!texData.isValid())
28
return
nullptr
;
29
30
return
new
QSGCompressedTextureFactory(texData);
31
}
32
33
bool
QSGTextureReader
::
isTexture
()
34
{
35
return
m_reader ? m_reader->canRead() :
false
;
36
}
37
38
QList<QByteArray>
QSGTextureReader
::supportedFileFormats()
39
{
40
return
QTextureFileReader::supportedFileFormats();
41
}
42
43
QT_END_NAMESPACE
QIODevice
\inmodule QtCore \reentrant
Definition
qiodevice.h:38
QSGTextureReader
Definition
qsgtexturereader_p.h:29
QSGTextureReader::read
QQuickTextureFactory * read()
Definition
qsgtexturereader.cpp:21
QSGTextureReader::isTexture
bool isTexture()
Definition
qsgtexturereader.cpp:33
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtdeclarative
src
quick
scenegraph
util
qsgtexturereader.cpp
Generated on
for Qt by
1.14.0