OpenCoverage

qsgsoftwareinternalimagenode_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QSGSOFTWAREINTERNALIMAGENODE_H-
41#define QSGSOFTWAREINTERNALIMAGENODE_H-
42-
43//-
44// W A R N I N G-
45// --------------
46//-
47// This file is not part of the Qt API. It exists purely as an-
48// implementation detail. This header file may change from version to-
49// version without notice, or even be removed.-
50//-
51// We mean it.-
52//-
53-
54#include <private/qsgadaptationlayer_p.h>-
55#include <private/qsgtexturematerial_p.h>-
56-
57QT_BEGIN_NAMESPACE-
58-
59namespace QSGSoftwareHelpers {-
60-
61typedef QVarLengthArray<QPainter::PixmapFragment, 16> QPixmapFragmentsArray;-
62-
63struct QTileRules-
64{-
65 inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)-
66 : horizontal(horizontalRule), vertical(verticalRule) {}
never executed: end of block
0
67 inline QTileRules(Qt::TileRule rule = Qt::StretchTile)-
68 : horizontal(rule), vertical(rule) {}
never executed: end of block
0
69 Qt::TileRule horizontal;-
70 Qt::TileRule vertical;-
71};-
72-
73#ifndef Q_QDOC-
74// For internal use only.-
75namespace QDrawBorderPixmap-
76{-
77 enum DrawingHint-
78 {-
79 OpaqueTopLeft = 0x0001,-
80 OpaqueTop = 0x0002,-
81 OpaqueTopRight = 0x0004,-
82 OpaqueLeft = 0x0008,-
83 OpaqueCenter = 0x0010,-
84 OpaqueRight = 0x0020,-
85 OpaqueBottomLeft = 0x0040,-
86 OpaqueBottom = 0x0080,-
87 OpaqueBottomRight = 0x0100,-
88 OpaqueCorners = OpaqueTopLeft | OpaqueTopRight | OpaqueBottomLeft | OpaqueBottomRight,-
89 OpaqueEdges = OpaqueTop | OpaqueLeft | OpaqueRight | OpaqueBottom,-
90 OpaqueFrame = OpaqueCorners | OpaqueEdges,-
91 OpaqueAll = OpaqueCenter | OpaqueFrame-
92 };-
93-
94 Q_DECLARE_FLAGS(DrawingHints, DrawingHint)-
95}-
96#endif-
97-
98void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins,-
99 const QPixmap &pixmap, const QRect &sourceRect,const QMargins &sourceMargins,-
100 const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints);-
101-
102} // QSGSoftwareHelpers namespace-
103-
104class QSGSoftwareInternalImageNode : public QSGInternalImageNode-
105{-
106public:-
107 QSGSoftwareInternalImageNode();-
108-
109 void setTargetRect(const QRectF &rect) override;-
110 void setInnerTargetRect(const QRectF &rect) override;-
111 void setInnerSourceRect(const QRectF &rect) override;-
112 void setSubSourceRect(const QRectF &rect) override;-
113 void setTexture(QSGTexture *texture) override;-
114 void setMirror(bool mirror) override;-
115 void setMipmapFiltering(QSGTexture::Filtering filtering) override;-
116 void setFiltering(QSGTexture::Filtering filtering) override;-
117 void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) override;-
118 void setVerticalWrapMode(QSGTexture::WrapMode wrapMode) override;-
119 void update() override;-
120-
121 void preprocess() override;-
122-
123 void paint(QPainter *painter);-
124-
125 QRectF rect() const;-
126-
127 const QPixmap &pixmap() const;-
128private:-
129-
130 QRectF m_targetRect;-
131 QRectF m_innerTargetRect;-
132 QRectF m_innerSourceRect;-
133 QRectF m_subSourceRect;-
134-
135 QSGTexture *m_texture;-
136 QPixmap m_cachedMirroredPixmap;-
137-
138 bool m_mirror;-
139 bool m_textureIsLayer;-
140 bool m_smooth;-
141 bool m_tileHorizontal;-
142 bool m_tileVertical;-
143 bool m_cachedMirroredPixmapIsDirty;-
144};-
145-
146QT_END_NAMESPACE-
147-
148#endif // QSGSOFTWAREINTERNALIMAGENODE_H-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0