| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/util/qsgdefaultimagenode.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | QSGDefaultImageNode::QSGDefaultImageNode() | - | ||||||||||||
| 5 | : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4) | - | ||||||||||||
| 6 | , m_texCoordMode(QSGDefaultImageNode::NoTransform) | - | ||||||||||||
| 7 | , m_isAtlasTexture(false) | - | ||||||||||||
| 8 | , m_ownsTexture(false) | - | ||||||||||||
| 9 | { | - | ||||||||||||
| 10 | setGeometry(&m_geometry); | - | ||||||||||||
| 11 | setMaterial(&m_material); | - | ||||||||||||
| 12 | setOpaqueMaterial(&m_opaque_material); | - | ||||||||||||
| 13 | m_material.setMipmapFiltering(QSGTexture::None); | - | ||||||||||||
| 14 | m_opaque_material.setMipmapFiltering(QSGTexture::None); | - | ||||||||||||
| 15 | - | |||||||||||||
| 16 | qsgnode_set_description(this, QLatin1String("image")); | - | ||||||||||||
| 17 | - | |||||||||||||
| 18 | } never executed: end of block | 0 | ||||||||||||
| 19 | - | |||||||||||||
| 20 | QSGDefaultImageNode::~QSGDefaultImageNode() | - | ||||||||||||
| 21 | { | - | ||||||||||||
| 22 | if (m_ownsTexture
| 0 | ||||||||||||
| 23 | delete m_material.texture(); never executed: delete m_material.texture(); | 0 | ||||||||||||
| 24 | } never executed: end of block | 0 | ||||||||||||
| 25 | - | |||||||||||||
| 26 | void QSGDefaultImageNode::setFiltering(QSGTexture::Filtering filtering) | - | ||||||||||||
| 27 | { | - | ||||||||||||
| 28 | if (m_material.filtering() == filtering
| 0 | ||||||||||||
| 29 | return; never executed: return; | 0 | ||||||||||||
| 30 | - | |||||||||||||
| 31 | m_material.setFiltering(filtering); | - | ||||||||||||
| 32 | m_opaque_material.setFiltering(filtering); | - | ||||||||||||
| 33 | markDirty(DirtyMaterial); | - | ||||||||||||
| 34 | } never executed: end of block | 0 | ||||||||||||
| 35 | - | |||||||||||||
| 36 | QSGTexture::Filtering QSGDefaultImageNode::filtering() const | - | ||||||||||||
| 37 | { | - | ||||||||||||
| 38 | return never executed: m_material.filtering();return m_material.filtering();never executed: return m_material.filtering(); | 0 | ||||||||||||
| 39 | } | - | ||||||||||||
| 40 | - | |||||||||||||
| 41 | void QSGDefaultImageNode::setMipmapFiltering(QSGTexture::Filtering filtering) | - | ||||||||||||
| 42 | { | - | ||||||||||||
| 43 | if (m_material.mipmapFiltering() == filtering
| 0 | ||||||||||||
| 44 | return; never executed: return; | 0 | ||||||||||||
| 45 | - | |||||||||||||
| 46 | m_material.setMipmapFiltering(filtering); | - | ||||||||||||
| 47 | m_opaque_material.setMipmapFiltering(filtering); | - | ||||||||||||
| 48 | markDirty(DirtyMaterial); | - | ||||||||||||
| 49 | } never executed: end of block | 0 | ||||||||||||
| 50 | - | |||||||||||||
| 51 | QSGTexture::Filtering QSGDefaultImageNode::mipmapFiltering() const | - | ||||||||||||
| 52 | { | - | ||||||||||||
| 53 | return never executed: m_material.mipmapFiltering();return m_material.mipmapFiltering();never executed: return m_material.mipmapFiltering(); | 0 | ||||||||||||
| 54 | } | - | ||||||||||||
| 55 | - | |||||||||||||
| 56 | void QSGDefaultImageNode::setAnisotropyLevel(QSGTexture::AnisotropyLevel level) | - | ||||||||||||
| 57 | { | - | ||||||||||||
| 58 | if (m_material.anisotropyLevel() == level
| 0 | ||||||||||||
| 59 | return; never executed: return; | 0 | ||||||||||||
| 60 | - | |||||||||||||
| 61 | m_material.setAnisotropyLevel(level); | - | ||||||||||||
| 62 | m_opaque_material.setAnisotropyLevel(level); | - | ||||||||||||
| 63 | markDirty(DirtyMaterial); | - | ||||||||||||
| 64 | } never executed: end of block | 0 | ||||||||||||
| 65 | - | |||||||||||||
| 66 | QSGTexture::AnisotropyLevel QSGDefaultImageNode::anisotropyLevel() const | - | ||||||||||||
| 67 | { | - | ||||||||||||
| 68 | return never executed: m_material.anisotropyLevel();return m_material.anisotropyLevel();never executed: return m_material.anisotropyLevel(); | 0 | ||||||||||||
| 69 | } | - | ||||||||||||
| 70 | - | |||||||||||||
| 71 | void QSGDefaultImageNode::setRect(const QRectF &r) | - | ||||||||||||
| 72 | { | - | ||||||||||||
| 73 | if (m_rect == r
| 0 | ||||||||||||
| 74 | return; never executed: return; | 0 | ||||||||||||
| 75 | - | |||||||||||||
| 76 | m_rect = r; | - | ||||||||||||
| 77 | rebuildGeometry(&m_geometry, texture(), m_rect, m_sourceRect, m_texCoordMode); | - | ||||||||||||
| 78 | markDirty(DirtyGeometry); | - | ||||||||||||
| 79 | } never executed: end of block | 0 | ||||||||||||
| 80 | - | |||||||||||||
| 81 | QRectF QSGDefaultImageNode::rect() const | - | ||||||||||||
| 82 | { | - | ||||||||||||
| 83 | return never executed: m_rect;return m_rect;never executed: return m_rect; | 0 | ||||||||||||
| 84 | } | - | ||||||||||||
| 85 | - | |||||||||||||
| 86 | void QSGDefaultImageNode::setSourceRect(const QRectF &r) | - | ||||||||||||
| 87 | { | - | ||||||||||||
| 88 | if (m_sourceRect == r
| 0 | ||||||||||||
| 89 | return; never executed: return; | 0 | ||||||||||||
| 90 | - | |||||||||||||
| 91 | m_sourceRect = r; | - | ||||||||||||
| 92 | rebuildGeometry(&m_geometry, texture(), m_rect, m_sourceRect, m_texCoordMode); | - | ||||||||||||
| 93 | markDirty(DirtyGeometry); | - | ||||||||||||
| 94 | } never executed: end of block | 0 | ||||||||||||
| 95 | - | |||||||||||||
| 96 | QRectF QSGDefaultImageNode::sourceRect() const | - | ||||||||||||
| 97 | { | - | ||||||||||||
| 98 | return never executed: m_sourceRect;return m_sourceRect;never executed: return m_sourceRect; | 0 | ||||||||||||
| 99 | } | - | ||||||||||||
| 100 | - | |||||||||||||
| 101 | void QSGDefaultImageNode::setTexture(QSGTexture *texture) | - | ||||||||||||
| 102 | { | - | ||||||||||||
| 103 | ((texture) ? static_cast<void>(0) : qt_assert("texture", __FILE__, 144)); | - | ||||||||||||
| 104 | if (m_ownsTexture
| 0 | ||||||||||||
| 105 | delete m_material.texture(); never executed: delete m_material.texture(); | 0 | ||||||||||||
| 106 | m_material.setTexture(texture); | - | ||||||||||||
| 107 | m_opaque_material.setTexture(texture); | - | ||||||||||||
| 108 | rebuildGeometry(&m_geometry, texture, m_rect, m_sourceRect, m_texCoordMode); | - | ||||||||||||
| 109 | - | |||||||||||||
| 110 | DirtyState dirty = DirtyMaterial; | - | ||||||||||||
| 111 | - | |||||||||||||
| 112 | - | |||||||||||||
| 113 | - | |||||||||||||
| 114 | bool wasAtlas = m_isAtlasTexture; | - | ||||||||||||
| 115 | m_isAtlasTexture = texture->isAtlasTexture(); | - | ||||||||||||
| 116 | if (wasAtlas
| 0 | ||||||||||||
| 117 | dirty |= DirtyGeometry; never executed: dirty |= DirtyGeometry; | 0 | ||||||||||||
| 118 | markDirty(dirty); | - | ||||||||||||
| 119 | } never executed: end of block | 0 | ||||||||||||
| 120 | - | |||||||||||||
| 121 | QSGTexture *QSGDefaultImageNode::texture() const | - | ||||||||||||
| 122 | { | - | ||||||||||||
| 123 | return never executed: m_material.texture();return m_material.texture();never executed: return m_material.texture(); | 0 | ||||||||||||
| 124 | } | - | ||||||||||||
| 125 | - | |||||||||||||
| 126 | void QSGDefaultImageNode::setTextureCoordinatesTransform(TextureCoordinatesTransformMode mode) | - | ||||||||||||
| 127 | { | - | ||||||||||||
| 128 | if (m_texCoordMode == mode
| 0 | ||||||||||||
| 129 | return; never executed: return; | 0 | ||||||||||||
| 130 | m_texCoordMode = mode; | - | ||||||||||||
| 131 | rebuildGeometry(&m_geometry, texture(), m_rect, m_sourceRect, m_texCoordMode); | - | ||||||||||||
| 132 | markDirty(DirtyMaterial); | - | ||||||||||||
| 133 | } never executed: end of block | 0 | ||||||||||||
| 134 | - | |||||||||||||
| 135 | QSGDefaultImageNode::TextureCoordinatesTransformMode QSGDefaultImageNode::textureCoordinatesTransform() const | - | ||||||||||||
| 136 | { | - | ||||||||||||
| 137 | return never executed: m_texCoordMode;return m_texCoordMode;never executed: return m_texCoordMode; | 0 | ||||||||||||
| 138 | } | - | ||||||||||||
| 139 | - | |||||||||||||
| 140 | void QSGDefaultImageNode::setOwnsTexture(bool owns) | - | ||||||||||||
| 141 | { | - | ||||||||||||
| 142 | m_ownsTexture = owns; | - | ||||||||||||
| 143 | } never executed: end of block | 0 | ||||||||||||
| 144 | - | |||||||||||||
| 145 | bool QSGDefaultImageNode::ownsTexture() const | - | ||||||||||||
| 146 | { | - | ||||||||||||
| 147 | return never executed: m_ownsTexture;return m_ownsTexture;never executed: return m_ownsTexture; | 0 | ||||||||||||
| 148 | } | - | ||||||||||||
| 149 | - | |||||||||||||
| 150 | - | |||||||||||||
| Switch to Source code | Preprocessed file |