diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-22 15:04:42 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-22 15:32:19 +0200 |
commit | 07782f48f4318a7261f1b0ddcd686b19ec812e36 (patch) | |
tree | 3fa2aa3a1170ad7ebaf5b1641cdce19a941ca480 /src/quick/scenegraph | |
parent | 50fcdfd705c2ad9560641986bf4152b017ee8bb6 (diff) | |
parent | f15a90e5d10465e66698209a5d88f1e63ae336fa (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/qml/qml/qqmlbinding.cpp
src/qml/jsruntime/qv4arraybuffer.cpp
src/qml/jsruntime/qv4functionobject.cpp
Change-Id: Ic752e9dfd69b282093651c9234c110a49762f06d
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgwindowsrenderloop.cpp | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 4 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 100861bfc1..dd071d757e 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -256,12 +256,12 @@ public: advanceAnimation(); } - float m_time; - float m_vsync; + double m_time; + double m_vsync; Mode m_mode; QElapsedTimer m_timer; QElapsedTimer m_wallTime; - float m_lag; + double m_lag; int m_bad; int m_good; }; diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index b88d21ce66..0e22fa8b7b 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -35,6 +35,7 @@ #include <QtCore/QCoreApplication> #include <QtCore/QLibraryInfo> +#include <QtCore/QThread> #include <QtGui/QScreen> #include <QtGui/QGuiApplication> @@ -355,13 +356,20 @@ bool QSGWindowsRenderLoop::event(QEvent *event) void QSGWindowsRenderLoop::render() { RLDEBUG("render"); + bool rendered = false; foreach (const WindowData &wd, m_windows) { if (wd.pendingUpdate) { const_cast<WindowData &>(wd).pendingUpdate = false; renderWindow(wd.window); + rendered = true; } } + if (!rendered) { + RLDEBUG("no changes, sleep"); + QThread::msleep(m_vsyncDelta); + } + if (m_animationDriver->isRunning()) { RLDEBUG("advancing animations"); QSG_LOG_TIME_SAMPLE(time_start); diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index 09418ecfd7..076b068f27 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -394,8 +394,8 @@ void Atlas::bind(QSGTexture::Filtering filtering) t->releaseImage(); qCDebug(QSG_LOG_TIME_TEXTURE).nospace() << "atlastexture uploaded in: " << qsg_renderer_timer.elapsed() - << "ms (" << m_pending_uploads.at(i)->image().width() << "x" - << m_pending_uploads.at(i)->image().height() << ")"; + << "ms (" << t->textureSize().width() << "x" + << t->textureSize().height() << ")"; // Skip mipmap; unused Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare); |