summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@theqtcompany.com>2014-11-21 13:52:00 +0200
committerMiikka Heikkinen <miikka.heikkinen@theqtcompany.com>2014-11-21 13:52:49 +0200
commit7c85e5674426ee8b2e6c73399dba7695f0141155 (patch)
treeb251992ee5d9782fa9b33adce19ca11e24a163f8
parentd7991f67ffa5708ff1b2a657cb49c9a538d2bfc9 (diff)
parentcf47756e17fe0a0ecffbe167cd66272668e2f3f2 (diff)
Merge branch 'develop'
-rw-r--r--examples/datavisualization/customitems/customitemgraph.cpp3
-rw-r--r--examples/datavisualization/customitems/main.cpp2
-rw-r--r--examples/datavisualization/texturesurface/main.cpp2
-rw-r--r--examples/datavisualization/texturesurface/topographicseries.cpp1
-rw-r--r--src/datavisualization/engine/abstract3drenderer.cpp9
-rw-r--r--src/datavisualizationqml2/glstatestore.cpp12
-rw-r--r--src/datavisualizationqml2/glstatestore_p.h2
7 files changed, 18 insertions, 13 deletions
diff --git a/examples/datavisualization/customitems/customitemgraph.cpp b/examples/datavisualization/customitems/customitemgraph.cpp
index 182bf7d7..404aa943 100644
--- a/examples/datavisualization/customitems/customitemgraph.cpp
+++ b/examples/datavisualization/customitems/customitemgraph.cpp
@@ -109,6 +109,9 @@ CustomItemGraph::CustomItemGraph(Q3DSurface *surface, QLabel *label)
titleLabel->setFacingCamera(true);
titleLabel->setBackgroundColor(QColor(0x66cdaa));
m_graph->addCustomItem(titleLabel);
+
+ toggleItemOne(true);
+ toggleItemTwo(true);
}
CustomItemGraph::~CustomItemGraph()
diff --git a/examples/datavisualization/customitems/main.cpp b/examples/datavisualization/customitems/main.cpp
index d89d9ad9..d7c301e7 100644
--- a/examples/datavisualization/customitems/main.cpp
+++ b/examples/datavisualization/customitems/main.cpp
@@ -53,10 +53,12 @@ int main(int argc, char **argv)
font.setBold(false);
QCheckBox *checkboxOne = new QCheckBox("Oil Rig 1");
+ checkboxOne->setChecked(true);
checkboxOne->setFont(font);
vLayoutLeft->addWidget(checkboxOne);
QCheckBox *checkboxTwo = new QCheckBox("Oil Rig 2");
+ checkboxTwo->setChecked(true);
checkboxTwo->setFont(font);
vLayoutLeft->addWidget(checkboxTwo);
diff --git a/examples/datavisualization/texturesurface/main.cpp b/examples/datavisualization/texturesurface/main.cpp
index eda6a54a..5d61b5d7 100644
--- a/examples/datavisualization/texturesurface/main.cpp
+++ b/examples/datavisualization/texturesurface/main.cpp
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
QLabel *label = new QLabel(widget);
label->setPixmap(pm);
- QGroupBox *heightMapGroupBox = new QGroupBox(QStringLiteral("Height color map"));
+ QGroupBox *heightMapGroupBox = new QGroupBox(QStringLiteral("Highlight color map"));
QVBoxLayout *colorMapVBox = new QVBoxLayout;
colorMapVBox->addWidget(label);
heightMapGroupBox->setLayout(colorMapVBox);
diff --git a/examples/datavisualization/texturesurface/topographicseries.cpp b/examples/datavisualization/texturesurface/topographicseries.cpp
index 2935244d..faeafbe9 100644
--- a/examples/datavisualization/texturesurface/topographicseries.cpp
+++ b/examples/datavisualization/texturesurface/topographicseries.cpp
@@ -29,6 +29,7 @@ TopographicSeries::TopographicSeries()
{
setDrawMode(QSurface3DSeries::DrawSurface);
setFlatShadingEnabled(true);
+ setBaseColor(Qt::white);
}
TopographicSeries::~TopographicSeries()
diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp
index c44eee7f..1f459930 100644
--- a/src/datavisualization/engine/abstract3drenderer.cpp
+++ b/src/datavisualization/engine/abstract3drenderer.cpp
@@ -464,8 +464,8 @@ void Abstract3DRenderer::reInitShaders()
QStringLiteral(":/shaders/fragmentES2"),
QStringLiteral(":/shaders/vertex"),
QStringLiteral(":/shaders/fragmentColorOnYES2"));
- initBackgroundShaders(QStringLiteral(":/shaders/vertexNoMatrices"),
- QStringLiteral(":/shaders/fragmentES2"));
+ initShaders(QStringLiteral(":/shaders/vertexNoMatrices"),
+ QStringLiteral(":/shaders/fragmentES2"));
} else {
initGradientShaders(QStringLiteral(":/shaders/vertex"),
QStringLiteral(":/shaders/fragmentColorOnYES2"));
@@ -1768,6 +1768,11 @@ void Abstract3DRenderer::queriedGraphPosition(const QMatrix4x4 &projectionViewMa
// Restore state
glEnable(GL_DITHER);
glCullFace(GL_BACK);
+
+ // Note: Zeroing the frame buffer before resetting it is a workaround for flickering that occurs
+ // during zoom in some environments.
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
glBindFramebuffer(GL_FRAMEBUFFER, defaultFboHandle);
glViewport(m_primarySubViewport.x(),
m_primarySubViewport.y(),
diff --git a/src/datavisualizationqml2/glstatestore.cpp b/src/datavisualizationqml2/glstatestore.cpp
index 4b146d7a..b1b2b1c8 100644
--- a/src/datavisualizationqml2/glstatestore.cpp
+++ b/src/datavisualizationqml2/glstatestore.cpp
@@ -80,8 +80,6 @@ void GLStateStore::storeGLState()
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &m_drawFramebuffer);
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &m_readFramebuffer);
glGetIntegerv(GL_RENDERBUFFER_BINDING, &m_renderbuffer);
-#else
- glGetIntegerv(GL_RENDERBUFFER, &m_renderbuffer);
#endif
glGetFloatv(GL_COLOR_CLEAR_VALUE, m_clearColor);
m_isBlendingEnabled = glIsEnabled(GL_BLEND);
@@ -138,8 +136,8 @@ void GLStateStore::printCurrentState(bool in)
#if !defined(QT_OPENGL_ES_2)
GLint drawFramebuffer;
GLint readFramebuffer;
-#endif
GLint renderbuffer;
+#endif
GLfloat clearColor[4];
GLfloat clearDepth;
GLboolean isBlendingEnabled = glIsEnabled(GL_BLEND);
@@ -178,8 +176,6 @@ void GLStateStore::printCurrentState(bool in)
glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &drawFramebuffer);
glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &readFramebuffer);
glGetIntegerv(GL_RENDERBUFFER_BINDING, &renderbuffer);
-#else
- glGetIntegerv(GL_RENDERBUFFER, &renderbuffer);
#endif
glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor);
glGetFloatv(GL_DEPTH_CLEAR_VALUE, &clearDepth);
@@ -223,8 +219,8 @@ void GLStateStore::printCurrentState(bool in)
msg << "---" << endl;
msg << " GL_DRAW_FRAMEBUFFER_BINDING "<< drawFramebuffer << endl;
msg << " GL_READ_FRAMEBUFFER_BINDING "<< readFramebuffer << endl;
-#endif
msg << " GL_RENDERBUFFER_BINDING " << renderbuffer << endl;
+#endif
msg << " GL_SCISSOR_TEST " << bool(isScissorTestEnabled) << endl;
msg << " GL_SCISSOR_BOX " << m_scissorBox[0] << m_scissorBox[1] << m_scissorBox[2]
<< m_scissorBox[3] << endl;
@@ -275,8 +271,6 @@ void GLStateStore::restoreGLState()
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_readFramebuffer);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_drawFramebuffer);
glBindRenderbuffer(GL_RENDERBUFFER_BINDING, m_renderbuffer);
-#else
- glBindRenderbuffer(GL_RENDERBUFFER, m_renderbuffer);
#endif
if (m_isScissorTestEnabled)
@@ -351,8 +345,8 @@ void GLStateStore::initGLDefaultState()
#if !defined(QT_OPENGL_ES_2)
m_drawFramebuffer = 0;
m_readFramebuffer = 0;
-#endif
m_renderbuffer = 0;
+#endif
m_clearColor[0] = m_clearColor[1] = m_clearColor[2] = m_clearColor[3] = 1.0f;
m_clearDepth = 1.0f;
m_isBlendingEnabled = GL_FALSE;
diff --git a/src/datavisualizationqml2/glstatestore_p.h b/src/datavisualizationqml2/glstatestore_p.h
index 36484f28..db3f555a 100644
--- a/src/datavisualizationqml2/glstatestore_p.h
+++ b/src/datavisualizationqml2/glstatestore_p.h
@@ -55,8 +55,8 @@ public:
#if !defined(QT_OPENGL_ES_2)
GLint m_drawFramebuffer;
GLint m_readFramebuffer;
-#endif
GLint m_renderbuffer;
+#endif
GLfloat m_clearColor[4];
GLfloat m_clearDepth;
GLboolean m_isBlendingEnabled;