summaryrefslogtreecommitdiff
path: root/src/compositor/compositor_api/qwaylandsurfacenode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/compositor_api/qwaylandsurfacenode.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandsurfacenode.cpp55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurfacenode.cpp b/src/compositor/compositor_api/qwaylandsurfacenode.cpp
index 513704f1..d13b970d 100644
--- a/src/compositor/compositor_api/qwaylandsurfacenode.cpp
+++ b/src/compositor/compositor_api/qwaylandsurfacenode.cpp
@@ -52,17 +52,7 @@ QT_BEGIN_NAMESPACE
QWaylandSurfaceNode::QWaylandSurfaceNode(QWaylandSurfaceItem *item)
: m_item(item)
, m_textureUpdated(false)
- , m_useTextureAlpha(false)
- , m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
{
- m_textureMaterial = QWaylandSurfaceTextureMaterial::createMaterial();
- m_opaqueTextureMaterial = QWaylandSurfaceTextureOpaqueMaterial::createMaterial();
-
- m_currentMaterial = m_opaqueTextureMaterial;
-
- setGeometry(&m_geometry);
- setMaterial(m_currentMaterial);
-
if (m_item)
m_item->m_node = this;
setFlag(UsePreprocess,true);
@@ -74,8 +64,6 @@ QWaylandSurfaceNode::~QWaylandSurfaceNode()
QMutexLocker locker(QWaylandSurfaceItem::mutex);
if (m_item)
m_item->m_node = 0;
- delete m_textureMaterial;
- delete m_opaqueTextureMaterial;
}
void QWaylandSurfaceNode::preprocess()
@@ -96,53 +84,10 @@ void QWaylandSurfaceNode::preprocess()
void QWaylandSurfaceNode::updateTexture()
{
Q_ASSERT(m_item && m_item->textureProvider());
-
- //If m_item->useTextureAlpha has changed to true use m_texureMaterial
- //otherwise use m_opaqueTextureMaterial.
- if (m_item->useTextureAlpha() != m_useTextureAlpha) {
- m_useTextureAlpha = m_item->useTextureAlpha();
- if (m_useTextureAlpha) {
- m_currentMaterial = m_textureMaterial;
- } else {
- m_currentMaterial = m_opaqueTextureMaterial;
- }
- setMaterial(m_currentMaterial);
- }
-
QSGTexture *texture = m_item->textureProvider()->texture();
setTexture(texture);
}
-void QWaylandSurfaceNode::setRect(const QRectF &rect)
-{
- if (m_rect == rect)
- return;
- m_rect = rect;
-
- if (texture()) {
- QSize ts = texture()->textureSize();
- QRectF sourceRect(0, 0, ts.width(), ts.height());
- QSGGeometry::updateTexturedRectGeometry(&m_geometry, m_rect, texture()->convertToNormalizedSourceRect(sourceRect));
- }
-}
-
-void QWaylandSurfaceNode::setTexture(QSGTexture *texture)
-{
- if (m_currentMaterial->state()->texture() == texture)
- return;
- m_currentMaterial->state()->setTexture(texture);
-
- QSize ts = texture->textureSize();
- QRectF sourceRect(0, 0, ts.width(), ts.height());
- QSGGeometry::updateTexturedRectGeometry(&m_geometry, m_rect, texture->convertToNormalizedSourceRect(sourceRect));
- markDirty(DirtyMaterial);
-}
-
-QSGTexture *QWaylandSurfaceNode::texture() const
-{
- return m_currentMaterial->state()->texture();
-}
-
void QWaylandSurfaceNode::setItem(QWaylandSurfaceItem *item)
{
m_item = item;