aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util/qsgpainternode.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-06-17 14:23:15 +0200
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-07-02 13:28:19 +0200
commitd1af0a90e6663d49c3e78ac674b0a1ae040c2085 (patch)
treefd8b386b2602887872ecd51b50f40e0f76a5f99d /src/quick/scenegraph/util/qsgpainternode.cpp
parentbf3594196f7166be6e843679b77210ab5f5da337 (diff)
Use qNextPowerOfTwo instead of reimplementing it
This patch uses the new shared qNextPowerOfTwo implementation introduced in qtbase. Change-Id: I831d056f584897a99df2ceb8c1d840764464e344 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/scenegraph/util/qsgpainternode.cpp')
-rw-r--r--src/quick/scenegraph/util/qsgpainternode.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/quick/scenegraph/util/qsgpainternode.cpp b/src/quick/scenegraph/util/qsgpainternode.cpp
index 8ccb9d2ffb..c9bb5daed1 100644
--- a/src/quick/scenegraph/util/qsgpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgpainternode.cpp
@@ -53,19 +53,7 @@
QT_BEGIN_NAMESPACE
-#define QT_MINIMUM_DYNAMIC_FBO_SIZE 64
-
-static inline int qt_next_power_of_two(int v)
-{
- v--;
- v |= v >> 1;
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
- ++v;
- return v;
-}
+#define QT_MINIMUM_DYNAMIC_FBO_SIZE 64U
QSGPainterTexture::QSGPainterTexture()
: QSGPlainTexture()
@@ -322,8 +310,8 @@ void QSGPainterNode::updateFBOSize()
int fboWidth;
int fboHeight;
if (m_fastFBOResizing) {
- fboWidth = qMax(QT_MINIMUM_DYNAMIC_FBO_SIZE, qt_next_power_of_two(m_size.width()));
- fboHeight = qMax(QT_MINIMUM_DYNAMIC_FBO_SIZE, qt_next_power_of_two(m_size.height()));
+ fboWidth = qMax(QT_MINIMUM_DYNAMIC_FBO_SIZE, qNextPowerOfTwo(m_size.width() - 1));
+ fboHeight = qMax(QT_MINIMUM_DYNAMIC_FBO_SIZE, qNextPowerOfTwo(m_size.height() - 1));
} else {
QSize minimumFBOSize = m_context->sceneGraphContext()->minimumFBOSize();
fboWidth = qMax(minimumFBOSize.width(), m_size.width());