aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-07-22 13:43:43 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-07-22 13:43:43 +0200
commit3a6f5735ee723ff998114314c5ccdf6609667f6f (patch)
tree9c877dd1e35972fa336cea8a61986594f168b49c /src/quick/scenegraph
parent000b6330d4ca7165ff241b21ee728ed28d82fba1 (diff)
parent17ded06804576dfde1b19f82f168f7ceb09ec92c (diff)
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts: src/quick/items/context2d/qquickcontext2d.cpp tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro Change-Id: I36a4fd28b3156839aecd70039a3ba566bf19a0bc
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.cpp1
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.h1
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp9
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp6
-rw-r--r--src/quick/scenegraph/util/qsgsimplematerial.cpp18
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp3
6 files changed, 21 insertions, 17 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
index 9346236db9..c0794d0d69 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
@@ -556,7 +556,6 @@ static void qt_print_material_count()
QSGMaterial::QSGMaterial()
: m_flags(0)
- , m_reserved(0)
{
#ifndef QT_NO_DEBUG
if (qsg_leak_check) {
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h
index 20ab21ad28..ee8889deac 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.h
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.h
@@ -133,7 +133,6 @@ public:
void setFlag(Flags flags, bool on = true);
private:
- friend class QSGContext;
Flags m_flags;
void *m_reserved;
Q_DISABLE_COPY(QSGMaterial)
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 866d678412..a142a23c67 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -507,16 +507,10 @@ QSGDepthStencilBufferManager *QSGContext::depthStencilBufferManager()
QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material)
{
Q_D(QSGContext);
-
- if (material->m_reserved)
- return reinterpret_cast<QSGMaterialShader *>(material->m_reserved);
-
QSGMaterialType *type = material->type();
QSGMaterialShader *shader = d->materials.value(type);
- if (shader) {
- material->m_reserved = shader;
+ if (shader)
return shader;
- }
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing || QQmlProfilerService::enabled)
@@ -524,7 +518,6 @@ QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material)
#endif
shader = material->createShader();
- material->m_reserved = shader;
shader->compile();
shader->initialize();
d->materials[type] = shader;
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
index bdbce6165b..3556a4ebe5 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
@@ -219,7 +219,7 @@ QSGMaterialShader *QSGDistanceFieldTextMaterial::createShader() const
bool QSGDistanceFieldTextMaterial::updateTextureSize()
{
if (!m_texture)
- m_texture = m_glyph_cache->glyphTexture(-1); // invalid texture
+ m_texture = m_glyph_cache->glyphTexture(0); // invalid texture
if (m_texture->size != m_size) {
m_size = m_texture->size;
@@ -240,8 +240,8 @@ int QSGDistanceFieldTextMaterial::compare(const QSGMaterial *o) const
}
if (m_color != other->m_color)
return &m_color < &other->m_color ? -1 : 1;
- int t0 = m_texture ? m_texture->textureId : -1;
- int t1 = other->m_texture ? other->m_texture->textureId : -1;
+ int t0 = m_texture ? m_texture->textureId : 0;
+ int t1 = other->m_texture ? other->m_texture->textureId : 0;
return t0 - t1;
}
diff --git a/src/quick/scenegraph/util/qsgsimplematerial.cpp b/src/quick/scenegraph/util/qsgsimplematerial.cpp
index ee7a272fbe..35ad56a44b 100644
--- a/src/quick/scenegraph/util/qsgsimplematerial.cpp
+++ b/src/quick/scenegraph/util/qsgsimplematerial.cpp
@@ -180,17 +180,29 @@
/*!
\fn void QSGSimpleMaterialShader::resolveUniforms()
- \internal
+
+ Reimplement this function to resolve the location of named uniforms
+ in the shader program.
+
+ This function is called when the material shader is initialized.
*/
/*!
\fn const char *QSGSimpleMaterialShader::uniformMatrixName() const
- \internal
+
+ Reimplement this function to give a different name to the uniform for
+ item transformation. The default value is \c qt_Matrix.
+
*/
/*!
\fn const char *QSGSimpleMaterialShader::uniformOpacityName() const
- \internal
+
+ Reimplement this function to give a different name to the uniform for
+ item opacity. The default value is \c qt_Opacity.
+
+ If the shader program does not implement the item opacity, the
+ implemented function should return a null pointer.
*/
/*!
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index a69f43f8d6..f17aa59e3e 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -222,7 +222,7 @@ static void qt_debug_remove_texture(QSGTexture* texture)
\section1 Texture Atlasses
- Some scene graph backens use texture atlasses, grouping multiple
+ Some scene graph backends use texture atlasses, grouping multiple
small textures into one large texture. If this is the case, the
function isAtlasTexture() will return true. Atlasses are used to
aid the rendering algorithm to do better sorting which increases
@@ -528,6 +528,7 @@ QSGPlainTexture::QSGPlainTexture()
, m_texture_id(0)
, m_has_alpha(false)
, m_has_mipmaps(false)
+ , m_dirty_texture(false)
, m_dirty_bind_options(false)
, m_owns_texture(true)
, m_mipmaps_generated(false)