summaryrefslogtreecommitdiffstats
path: root/src/scenegraph/convenience
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenegraph/convenience')
-rw-r--r--src/scenegraph/convenience/texturematerial.cpp12
-rw-r--r--src/scenegraph/convenience/texturematerial.h8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/scenegraph/convenience/texturematerial.cpp b/src/scenegraph/convenience/texturematerial.cpp
index 021d4b1..8e03884 100644
--- a/src/scenegraph/convenience/texturematerial.cpp
+++ b/src/scenegraph/convenience/texturematerial.cpp
@@ -118,7 +118,7 @@ void TextureMaterialData::updateEffectState(Renderer *renderer, AbstractEffect *
TextureMaterial *tx = static_cast<TextureMaterial *>(newEffect);
TextureMaterial *oldTx = static_cast<TextureMaterial *>(oldEffect);
- if (oldEffect == 0 || tx->texture() != oldTx->texture()) {
+ if (oldEffect == 0 || tx->texture().texture() != oldTx->texture().texture()) {
renderer->setTexture(0, tx->texture());
oldEffect = 0; // Force filtering update.
}
@@ -131,7 +131,7 @@ void TextureMaterialData::updateEffectState(Renderer *renderer, AbstractEffect *
}
-void TextureMaterial::setTexture(const TextureReference *texture, bool opaque)
+void TextureMaterial::setTexture(const QSGTextureRef &texture, bool opaque)
{
m_texture = texture;
m_opaque = opaque;
@@ -152,7 +152,7 @@ int TextureMaterial::compare(const AbstractEffect *o) const
{
Q_ASSERT(o && type() == o->type());
const TextureMaterial *other = static_cast<const TextureMaterial *>(o);
- if (int diff = m_texture - other->texture())
+ if (int diff = m_texture->textureId() - other->texture()->textureId())
return diff;
return int(m_linear_filtering) - int(other->m_linear_filtering);
}
@@ -205,14 +205,14 @@ int TextureMaterialWithOpacity::compare(const AbstractEffect *o) const
{
Q_ASSERT(o && type() == o->type());
const TextureMaterialWithOpacity *other = static_cast<const TextureMaterialWithOpacity *>(o);
- if (int diff = m_texture - other->texture())
+ if (int diff = m_texture->textureId() - other->texture()->textureId())
return diff;
if (int diff = int(m_linear_filtering) - int(other->m_linear_filtering))
return diff;
return int(other->m_opacity < m_opacity) - int(m_opacity < other->m_opacity);
}
-void TextureMaterialWithOpacity::setTexture(const TextureReference *texture, bool opaque)
+void TextureMaterialWithOpacity::setTexture(const QSGTextureRef &texture, bool opaque)
{
m_texture = texture;
m_opaque = opaque;
@@ -230,7 +230,7 @@ void TextureMaterialWithOpacityData::updateEffectState(Renderer *renderer, Abstr
TextureMaterialWithOpacity *tx = static_cast<TextureMaterialWithOpacity *>(newEffect);
TextureMaterialWithOpacity *oldTx = static_cast<TextureMaterialWithOpacity *>(oldEffect);
- if (oldEffect == 0 || tx->texture() != oldTx->texture()) {
+ if (oldEffect == 0 || tx->texture().texture() != oldTx->texture().texture()) {
renderer->setTexture(0, tx->texture());
oldEffect = 0; // Force filtering update.
}
diff --git a/src/scenegraph/convenience/texturematerial.h b/src/scenegraph/convenience/texturematerial.h
index 5cce7ed..166bca1 100644
--- a/src/scenegraph/convenience/texturematerial.h
+++ b/src/scenegraph/convenience/texturematerial.h
@@ -55,8 +55,8 @@ public:
virtual int compare(const AbstractEffect *other) const;
// ### gunnar: opaque -> alpha, as "hasAlphaChannel()" is what we normally use
- void setTexture(const TextureReference *texture, bool opaque = false);
- const TextureReference *texture() const { return m_texture; }
+ void setTexture(const QSGTextureRef &texture, bool opaque = false);
+ const QSGTextureRef &texture() const { return m_texture; }
void setLinearFiltering(bool linearFiltering) { m_linear_filtering = linearFiltering; }
bool linearFiltering() const { return m_linear_filtering; }
@@ -64,7 +64,7 @@ public:
static bool is(const AbstractEffect *effect);
protected:
- const TextureReference *m_texture;
+ QSGTextureRef m_texture;
bool m_opaque;
bool m_linear_filtering;
};
@@ -96,7 +96,7 @@ public:
virtual AbstractEffectType *type() const;
virtual AbstractEffectProgram *createProgram() const;
virtual int compare(const AbstractEffect *other) const;
- void setTexture(const TextureReference *texture, bool opaque = false);
+ void setTexture(const QSGTextureRef &texture, bool opaque = false);
void setOpacity(qreal opacity);
qreal opacity() const { return m_opacity; }