summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-22 14:08:53 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-22 14:08:53 (GMT)
commit571f0dc0a33b22bfc1f1ffd4521e7c4e5151647c (patch)
tree88f85beb8700ce745738a19417aca30f3743ca6b /src
parentb7ba409b0dabd382876310a6c110a96cf0e3c6bf (diff)
parent3263e0d971ac263e42078064b3f275dff4f62650 (diff)
downloadQt-571f0dc0a33b22bfc1f1ffd4521e7c4e5151647c.zip
Qt-571f0dc0a33b22bfc1f1ffd4521e7c4e5151647c.tar.gz
Qt-571f0dc0a33b22bfc1f1ffd4521e7c4e5151647c.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix warning on MSVC QThread: make sure start works even if called after exit Revert "Fixed painter path drawing on FBO without stencil buffer." Fix a crash with D&d on mingw Revert "Keep other text format with QTextOption::SuppressColors tag on" Fixed stencil buffer on FBOs with OpenGL ES. Keep other text format with QTextOption::SuppressColors tag on QTreeView: do not scroll to top if last item is removed
Diffstat (limited to 'src')
-rw-r--r--src/corelib/thread/qthread_unix.cpp2
-rw-r--r--src/corelib/thread/qthread_win.cpp2
-rw-r--r--src/gui/itemviews/qtreeview.cpp4
-rw-r--r--src/gui/kernel/qdnd_win.cpp12
-rw-r--r--src/gui/styles/qstylehelper_p.h2
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp26
-rw-r--r--src/opengl/qglframebufferobject.cpp105
-rw-r--r--src/opengl/qglframebufferobject_p.h5
8 files changed, 94 insertions, 64 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 2824e15..a7601b6 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -514,6 +514,8 @@ void QThread::start(Priority priority)
d->running = true;
d->finished = false;
d->terminated = false;
+ d->returnCode = 0;
+ d->exited = false;
pthread_attr_t attr;
pthread_attr_init(&attr);
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 37d5b87..f0cbe8d 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -405,6 +405,8 @@ void QThread::start(Priority priority)
d->running = true;
d->finished = false;
d->terminated = false;
+ d->exited = false;
+ d->returnCode = 0;
/*
NOTE: we create the thread in the suspended state, set the
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index b797776..40b51fe 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -3435,6 +3435,10 @@ void QTreeViewPrivate::updateScrollBars()
if (!viewportSize.isValid())
viewportSize = QSize(0, 0);
+ if (viewItems.isEmpty()) {
+ q->doItemsLayout();
+ }
+
int itemsInViewport = 0;
if (uniformRowHeights) {
if (defaultItemHeight <= 0)
diff --git a/src/gui/kernel/qdnd_win.cpp b/src/gui/kernel/qdnd_win.cpp
index a164c2a..7083886 100644
--- a/src/gui/kernel/qdnd_win.cpp
+++ b/src/gui/kernel/qdnd_win.cpp
@@ -515,7 +515,7 @@ static inline Qt::MouseButtons keystate_to_mousebutton(DWORD grfKeyState)
//---------------------------------------------------------------------
// IDropSource Methods
//---------------------------------------------------------------------
-STDMETHODIMP
+QT_ENSURE_STACK_ALIGNED_FOR_SSE STDMETHODIMP
QOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
{
#ifdef QDND_DEBUG
@@ -545,7 +545,7 @@ QOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
}
}
-STDMETHODIMP
+QT_ENSURE_STACK_ALIGNED_FOR_SSE STDMETHODIMP
QOleDropSource::GiveFeedback(DWORD dwEffect)
{
Qt::DropAction action = translateToQDragDropAction(dwEffect);
@@ -626,7 +626,7 @@ QOleDropTarget::Release(void)
// IDropTarget Methods
//---------------------------------------------------------------------
-STDMETHODIMP
+QT_ENSURE_STACK_ALIGNED_FOR_SSE STDMETHODIMP
QOleDropTarget::DragEnter(LPDATAOBJECT pDataObj, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
{
#ifdef QDND_DEBUG
@@ -688,7 +688,7 @@ void QOleDropTarget::sendDragEnterEvent(QWidget *dragEnterWidget, DWORD grfKeySt
}
-STDMETHODIMP
+QT_ENSURE_STACK_ALIGNED_FOR_SSE STDMETHODIMP
QOleDropTarget::DragOver(DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
{
#ifdef QDND_DEBUG
@@ -758,7 +758,7 @@ QOleDropTarget::DragOver(DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
return NOERROR;
}
-STDMETHODIMP
+QT_ENSURE_STACK_ALIGNED_FOR_SSE STDMETHODIMP
QOleDropTarget::DragLeave()
{
#ifdef QDND_DEBUG
@@ -785,7 +785,7 @@ QOleDropTarget::DragLeave()
#define KEY_STATE_BUTTON_MASK (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)
-STDMETHODIMP
+QT_ENSURE_STACK_ALIGNED_FOR_SSE STDMETHODIMP
QOleDropTarget::Drop(LPDATAOBJECT /*pDataObj*/, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
{
#ifdef QDND_DEBUG
diff --git a/src/gui/styles/qstylehelper_p.h b/src/gui/styles/qstylehelper_p.h
index 71fce55..3759929 100644
--- a/src/gui/styles/qstylehelper_p.h
+++ b/src/gui/styles/qstylehelper_p.h
@@ -108,7 +108,7 @@ template <typename T>
{
typedef HexString<T> type;
enum { ExactSize = true };
- static int size(const HexString<T> &str) { return sizeof(str.val) * 2; }
+ static int size(const HexString<T> &) { return sizeof(T) * 2; }
static inline void appendTo(const HexString<T> &str, QChar *&out) { str.write(out); }
};
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 2347e66..aa217f6 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -866,32 +866,6 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
if (do_vectorpath_cache)
path.makeCacheable();
- if (!device->format().stencil()) {
- // If there is no stencil buffer, triangulate the path instead.
-
- QRectF bbox = path.controlPointRect();
- // If the path doesn't fit within these limits, it is possible that the triangulation will fail.
- bool withinLimits = (bbox.left() > -0x8000 * inverseScale)
- && (bbox.right() < 0x8000 * inverseScale)
- && (bbox.top() > -0x8000 * inverseScale)
- && (bbox.bottom() < 0x8000 * inverseScale);
- if (withinLimits) {
- QTriangleSet polys = qTriangulate(path, QTransform().scale(1 / inverseScale, 1 / inverseScale));
-
- QVarLengthArray<float> vertices(polys.vertices.size());
- for (int i = 0; i < polys.vertices.size(); ++i)
- vertices[i] = float(inverseScale * polys.vertices.at(i));
-
- prepareForDraw(currentBrush.isOpaque());
- setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, vertices.constData());
- glDrawElements(GL_TRIANGLES, polys.indices.size(), GL_UNSIGNED_INT, polys.indices.constData());
- } else {
- // We can't handle big, concave painter paths with OpenGL without stencil buffer.
- qWarning("Painter path exceeds +/-32767 pixels.");
- }
- return;
- }
-
// The path is too complicated & needs the stencil technique
vertexCoordinateArray.clear();
vertexCoordinateArray.addPath(path, inverseScale, false);
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index adbba85..ba23cab 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -324,10 +324,6 @@ void QGLFBOGLPaintDevice::setFBO(QGLFramebufferObject* f,
fboFormat.setStencil(true);
} else if (attachment == QGLFramebufferObject::Depth) {
fboFormat.setDepth(true);
- fboFormat.setStencil(false);
- } else {
- fboFormat.setDepth(false);
- fboFormat.setStencil(false);
}
GLenum format = f->format().internalTextureFormat();
@@ -472,13 +468,17 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
glGetRenderbufferParameteriv(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_SAMPLES_EXT, &samples);
}
+ // In practice, a combined depth-stencil buffer is supported by all desktop platforms, while a
+ // separate stencil buffer is not. On embedded devices however, a combined depth-stencil buffer
+ // might not be supported while separate buffers are, according to QTBUG-12861.
+
if (attachment == QGLFramebufferObject::CombinedDepthStencil
&& (QGLExtensions::glExtensions() & QGLExtensions::PackedDepthStencil)) {
// depth and stencil buffer needs another extension
- glGenRenderbuffers(1, &depth_stencil_buffer);
- Q_ASSERT(!glIsRenderbuffer(depth_stencil_buffer));
- glBindRenderbuffer(GL_RENDERBUFFER_EXT, depth_stencil_buffer);
- Q_ASSERT(glIsRenderbuffer(depth_stencil_buffer));
+ glGenRenderbuffers(1, &depth_buffer);
+ Q_ASSERT(!glIsRenderbuffer(depth_buffer));
+ glBindRenderbuffer(GL_RENDERBUFFER_EXT, depth_buffer);
+ Q_ASSERT(glIsRenderbuffer(depth_buffer));
if (samples != 0 && glRenderbufferStorageMultisampleEXT)
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
GL_DEPTH24_STENCIL8_EXT, size.width(), size.height());
@@ -486,24 +486,26 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
glRenderbufferStorage(GL_RENDERBUFFER_EXT,
GL_DEPTH24_STENCIL8_EXT, size.width(), size.height());
- GLint i = 0;
- glGetRenderbufferParameteriv(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
+ stencil_buffer = depth_buffer;
glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, depth_stencil_buffer);
+ GL_RENDERBUFFER_EXT, depth_buffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, depth_stencil_buffer);
- fbo_attachment = QGLFramebufferObject::CombinedDepthStencil;
+ GL_RENDERBUFFER_EXT, stencil_buffer);
valid = checkFramebufferStatus();
- if (!valid)
- glDeleteRenderbuffers(1, &depth_stencil_buffer);
- } else if (attachment == QGLFramebufferObject::Depth
- || attachment == QGLFramebufferObject::CombinedDepthStencil)
+ if (!valid) {
+ glDeleteRenderbuffers(1, &depth_buffer);
+ stencil_buffer = depth_buffer = 0;
+ }
+ }
+
+ if (depth_buffer == 0 && (attachment == QGLFramebufferObject::CombinedDepthStencil
+ || (attachment == QGLFramebufferObject::Depth)))
{
- glGenRenderbuffers(1, &depth_stencil_buffer);
- Q_ASSERT(!glIsRenderbuffer(depth_stencil_buffer));
- glBindRenderbuffer(GL_RENDERBUFFER_EXT, depth_stencil_buffer);
- Q_ASSERT(glIsRenderbuffer(depth_stencil_buffer));
+ glGenRenderbuffers(1, &depth_buffer);
+ Q_ASSERT(!glIsRenderbuffer(depth_buffer));
+ glBindRenderbuffer(GL_RENDERBUFFER_EXT, depth_buffer);
+ Q_ASSERT(glIsRenderbuffer(depth_buffer));
if (samples != 0 && glRenderbufferStorageMultisampleEXT) {
#ifdef QT_OPENGL_ES
#define GL_DEPTH_COMPONENT16 0x81A5
@@ -521,14 +523,53 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, size.width(), size.height());
#endif
}
- GLint i = 0;
- glGetRenderbufferParameteriv(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_DEPTH_SIZE_EXT, &i);
glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, depth_stencil_buffer);
- fbo_attachment = QGLFramebufferObject::Depth;
+ GL_RENDERBUFFER_EXT, depth_buffer);
valid = checkFramebufferStatus();
- if (!valid)
- glDeleteRenderbuffers(1, &depth_stencil_buffer);
+ if (!valid) {
+ glDeleteRenderbuffers(1, &depth_buffer);
+ depth_buffer = 0;
+ }
+ }
+
+ if (stencil_buffer == 0 && (attachment == QGLFramebufferObject::CombinedDepthStencil)) {
+ glGenRenderbuffers(1, &stencil_buffer);
+ Q_ASSERT(!glIsRenderbuffer(stencil_buffer));
+ glBindRenderbuffer(GL_RENDERBUFFER_EXT, stencil_buffer);
+ Q_ASSERT(glIsRenderbuffer(stencil_buffer));
+ if (samples != 0 && glRenderbufferStorageMultisampleEXT) {
+#ifdef QT_OPENGL_ES
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ GL_STENCIL_INDEX8_EXT, size.width(), size.height());
+#else
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ GL_STENCIL_INDEX_EXT, size.width(), size.height());
+#endif
+ } else {
+#ifdef QT_OPENGL_ES
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX8_EXT,
+ size.width(), size.height());
+#else
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX_EXT,
+ size.width(), size.height());
+#endif
+ }
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, stencil_buffer);
+ valid = checkFramebufferStatus();
+ if (!valid) {
+ glDeleteRenderbuffers(1, &stencil_buffer);
+ stencil_buffer = 0;
+ }
+ }
+
+ // The FBO might have become valid after removing the depth or stencil buffer.
+ valid = checkFramebufferStatus();
+
+ if (depth_buffer && stencil_buffer) {
+ fbo_attachment = QGLFramebufferObject::CombinedDepthStencil;
+ } else if (depth_buffer) {
+ fbo_attachment = QGLFramebufferObject::Depth;
} else {
fbo_attachment = QGLFramebufferObject::NoAttachment;
}
@@ -539,6 +580,10 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
glDeleteRenderbuffers(1, &color_buffer);
else
glDeleteTextures(1, &texture);
+ if (depth_buffer)
+ glDeleteRenderbuffers(1, &depth_buffer);
+ if (stencil_buffer && depth_buffer != stencil_buffer)
+ glDeleteRenderbuffers(1, &stencil_buffer);
glDeleteFramebuffers(1, &fbo);
fbo_guard.setId(0);
}
@@ -821,8 +866,10 @@ QGLFramebufferObject::~QGLFramebufferObject()
glDeleteTextures(1, &d->texture);
if (d->color_buffer)
glDeleteRenderbuffers(1, &d->color_buffer);
- if (d->depth_stencil_buffer)
- glDeleteRenderbuffers(1, &d->depth_stencil_buffer);
+ if (d->depth_buffer)
+ glDeleteRenderbuffers(1, &d->depth_buffer);
+ if (d->stencil_buffer && d->stencil_buffer != d->depth_buffer)
+ glDeleteRenderbuffers(1, &d->stencil_buffer);
GLuint fbo = d->fbo();
glDeleteFramebuffers(1, &fbo);
}
diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h
index d8ff012..58b4e9e 100644
--- a/src/opengl/qglframebufferobject_p.h
+++ b/src/opengl/qglframebufferobject_p.h
@@ -126,7 +126,7 @@ private:
class QGLFramebufferObjectPrivate
{
public:
- QGLFramebufferObjectPrivate() : fbo_guard(0), texture(0), depth_stencil_buffer(0)
+ QGLFramebufferObjectPrivate() : fbo_guard(0), texture(0), depth_buffer(0), stencil_buffer(0)
, color_buffer(0), valid(false), engine(0) {}
~QGLFramebufferObjectPrivate() {}
@@ -136,7 +136,8 @@ public:
bool checkFramebufferStatus() const;
QGLSharedResourceGuard fbo_guard;
GLuint texture;
- GLuint depth_stencil_buffer;
+ GLuint depth_buffer;
+ GLuint stencil_buffer;
GLuint color_buffer;
GLenum target;
QSize size;