1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qssgrendertexturedata_p.h"
5
6QT_BEGIN_NAMESPACE
7
8QSSGRenderTextureData::QSSGRenderTextureData()
9 : QSSGRenderGraphObject(QSSGRenderGraphObject::Type::TextureData)
10{
11
12}
13
14QSSGRenderTextureData::QSSGRenderTextureData(QSSGRenderGraphObject::Type type)
15 : QSSGRenderGraphObject(type)
16{
17
18}
19
20QSSGRenderTextureData::~QSSGRenderTextureData()
21{
22
23}
24
25const QByteArray &QSSGRenderTextureData::textureData() const
26{
27 return m_textureData;
28}
29
30void QSSGRenderTextureData::setTextureData(const QByteArray &data)
31{
32 m_textureData = data;
33 markDirty();
34}
35
36QSize QSSGRenderTextureData::size() const
37{
38 return m_size;
39}
40
41void QSSGRenderTextureData::setSize(const QSize &size)
42{
43 if (m_size == size)
44 return;
45 m_size = size;
46 markDirty();
47}
48
49int QSSGRenderTextureData::depth() const
50{
51 return m_depth;
52}
53
54void QSSGRenderTextureData::setDepth(int depth)
55{
56 if (m_depth == depth)
57 return;
58 m_depth = depth;
59 markDirty();
60}
61
62QSSGRenderTextureFormat QSSGRenderTextureData::format() const
63{
64 return m_format;
65}
66
67void QSSGRenderTextureData::setFormat(QSSGRenderTextureFormat format)
68{
69 if (m_format == format)
70 return;
71
72 m_format = format;
73 markDirty();
74}
75
76bool QSSGRenderTextureData::hasTransparancy() const
77{
78 return m_hasTransparency;
79}
80
81void QSSGRenderTextureData::setHasTransparency(bool hasTransparency)
82{
83 if (m_hasTransparency == hasTransparency)
84 return;
85
86 m_hasTransparency = hasTransparency;
87 markDirty();
88}
89
90uint32_t QSSGRenderTextureData::generationId() const
91{
92 return m_generationId;
93}
94
95void QSSGRenderTextureData::markDirty()
96{
97 // The generation ID changes every time a property of this texture
98 // changes so that the buffer manager can compare the generation it
99 // holds vs the current generation.
100 m_generationId++;
101}
102
103QT_END_NAMESPACE
104

source code of qtquick3d/src/runtimerender/graphobjects/qssgrendertexturedata.cpp