summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r--src/core/delegated_frame_node.cpp55
1 files changed, 13 insertions, 42 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index e1ff2f56c..9805e3333 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -185,10 +185,8 @@ public:
virtual void setupRenderPassNode(QSGTexture *, const QRect &, QSGNode *) = 0;
virtual void setupTextureContentNode(QSGTexture *, const QRect &, const QRectF &,
- QSGTextureNode::TextureCoordinatesTransformMode,
+ QSGImageNode::TextureCoordinatesTransformMode,
QSGNode *) = 0;
- virtual void setupTiledContentNode(QSGTexture *, const QRect &, const QRectF &,
- QSGNode *) = 0;
virtual void setupSolidColorNode(const QRect &, const QColor &, QSGNode *) = 0;
#ifndef QT_NO_OPENGL
@@ -227,15 +225,18 @@ public:
}
void setupTextureContentNode(QSGTexture *texture, const QRect &rect, const QRectF &sourceRect,
- QSGTextureNode::TextureCoordinatesTransformMode texCoordTransForm,
+ QSGImageNode::TextureCoordinatesTransformMode texCoordTransForm,
QSGNode *) override
{
Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
- QSGTextureNode *textureNode = static_cast<QSGTextureNode*>(*m_nodeIterator++);
+ QSGImageNode *textureNode = static_cast<QSGImageNode*>(*m_nodeIterator++);
if (textureNode->texture() != texture) {
+ // Chromium sometimes uses textures that doesn't completely fit
+ // in which case the geometry needs to be recalculated even if
+ // rect and src-rect matches.
+ if (textureNode->texture()->textureSize() != texture->textureSize())
+ textureNode->markDirty(QSGImageNode::DirtyGeometry);
textureNode->setTexture(texture);
- // @TODO: This is a workaround for funky rendering, figure out why this is needed.
- textureNode->markDirty(QSGTextureNode::DirtyGeometry);
}
if (textureNode->textureCoordinatesTransform() != texCoordTransForm)
textureNode->setTextureCoordinatesTransform(texCoordTransForm);
@@ -246,23 +247,6 @@ public:
if (textureNode->filtering() != texture->filtering())
textureNode->setFiltering(texture->filtering());
}
- void setupTiledContentNode(QSGTexture *texture, const QRect &rect, const QRectF &sourceRect,
- QSGNode *) override
- {
- Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
- QSGTextureNode *textureNode = static_cast<QSGTextureNode*>(*m_nodeIterator++);
- if (textureNode->texture() != texture) {
- textureNode->setTexture(texture);
- // @TODO: This is a workaround for funky rendering, figure out why this is needed.
- textureNode->markDirty(QSGTextureNode::DirtyGeometry);
- }
- if (textureNode->rect() != rect)
- textureNode->setRect(rect);
- if (textureNode->sourceRect() != sourceRect)
- textureNode->setSourceRect(sourceRect);
- if (textureNode->filtering() != texture->filtering())
- textureNode->setFiltering(texture->filtering());
- }
void setupSolidColorNode(const QRect &rect, const QColor &color, QSGNode *) override
{
Q_ASSERT(m_nodeIterator != m_sceneGraphNodes->end());
@@ -330,10 +314,10 @@ public:
}
void setupTextureContentNode(QSGTexture *texture, const QRect &rect, const QRectF &sourceRect,
- QSGTextureNode::TextureCoordinatesTransformMode texCoordTransForm,
+ QSGImageNode::TextureCoordinatesTransformMode texCoordTransForm,
QSGNode *layerChain) override
{
- QSGTextureNode *textureNode = m_apiDelegate->createTextureNode();
+ QSGImageNode *textureNode = m_apiDelegate->createImageNode();
textureNode->setTextureCoordinatesTransform(texCoordTransForm);
textureNode->setRect(rect);
textureNode->setSourceRect(sourceRect);
@@ -344,19 +328,6 @@ public:
m_sceneGraphNodes->append(textureNode);
}
- void setupTiledContentNode(QSGTexture *texture, const QRect &rect, const QRectF &sourceRect,
- QSGNode *layerChain) override
- {
- QSGTextureNode *textureNode = m_apiDelegate->createTextureNode();
- textureNode->setRect(rect);
- textureNode->setSourceRect(sourceRect);
- textureNode->setFiltering(texture->filtering());
- textureNode->setTexture(texture);
-
- layerChain->appendChildNode(textureNode);
- m_sceneGraphNodes->append(textureNode);
- }
-
void setupSolidColorNode(const QRect &rect, const QColor &color,
QSGNode *layerChain) override
{
@@ -1124,7 +1095,7 @@ void DelegatedFrameNode::handleQuad(
nodeHandler->setupTextureContentNode(
texture, toQt(quad->rect), toQt(uv_rect),
- tquad->y_flipped ? QSGTextureNode::MirrorVertically : QSGTextureNode::NoTransform,
+ tquad->y_flipped ? QSGImageNode::MirrorVertically : QSGImageNode::NoTransform,
currentLayerChain);
break;
}
@@ -1164,10 +1135,10 @@ void DelegatedFrameNode::handleQuad(
case viz::DrawQuad::TILED_CONTENT: {
const viz::TileDrawQuad *tquad = viz::TileDrawQuad::MaterialCast(quad);
ResourceHolder *resource = findAndHoldResource(tquad->resource_id(), resourceCandidates);
- nodeHandler->setupTiledContentNode(
+ nodeHandler->setupTextureContentNode(
initAndHoldTexture(resource, quad->ShouldDrawWithBlending(), apiDelegate),
toQt(quad->rect), toQt(tquad->tex_coord_rect),
- currentLayerChain);
+ QSGImageNode::NoTransform, currentLayerChain);
break;
#ifndef QT_NO_OPENGL
}