aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2012-06-12 09:19:35 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-13 01:41:58 +0200
commit86cbb55522f9a4ca76854be860a8131f006553a8 (patch)
tree9c1489de62ab7efb0038f393b8e1ab7ef9d5c925 /src
parenteba101e4974b3f6150e299f3f2e513124c69eadf (diff)
Set a non-zero default cacheBuffer.
The likelihood of constant framerate when flicking is considerably improved by having a cacheBuffer. Since there is only a minimal cost in having a modest cacheBuffer, it is better to have a more optimal default value - 320 seems a good starting point. Change-Id: Id3c8a153821573b5b08c6fbd80d34152908d358d Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickgridview.cpp6
-rw-r--r--src/quick/items/qquickitemview.cpp7
-rw-r--r--src/quick/items/qquicklistview.cpp6
3 files changed, 14 insertions, 5 deletions
diff --git a/src/quick/items/qquickgridview.cpp b/src/quick/items/qquickgridview.cpp
index 331f23e4c8..fa1e96c824 100644
--- a/src/quick/items/qquickgridview.cpp
+++ b/src/quick/items/qquickgridview.cpp
@@ -1533,8 +1533,10 @@ void QQuickGridView::setHighlightFollowsCurrentItem(bool autoHighlight)
area may be created/retained. The buffered delegates are created asynchronously,
allowing creation to occur across multiple frames and reducing the
likelihood of skipping frames. In order to improve painting performance
- delegates outside the visible area have their \l visible property set to
- false until they are moved into the visible area.
+ delegates outside the visible area are not painted.
+
+ The default value of this property is platform dependent, but will usually
+ be a non-zero value.
Note that cacheBuffer is not a pixel buffer - it only maintains additional
instantiated delegates.
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index 26580e0346..8b8f9356c9 100644
--- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp
@@ -41,9 +41,14 @@
#include "qquickitemview_p_p.h"
#include <QtQuick/private/qquicktransition_p.h>
+#include "qplatformdefs.h"
QT_BEGIN_NAMESPACE
+// Default cacheBuffer for all views.
+#ifndef QML_VIEW_DEFAULTCACHEBUFFER
+#define QML_VIEW_DEFAULTCACHEBUFFER 320
+#endif
FxViewItem::FxViewItem(QQuickItem *i, bool own, bool trackGeometry)
: item(i)
@@ -1410,7 +1415,7 @@ void QQuickItemView::componentComplete()
QQuickItemViewPrivate::QQuickItemViewPrivate()
: itemCount(0)
- , buffer(0), bufferMode(BufferBefore | BufferAfter)
+ , buffer(QML_VIEW_DEFAULTCACHEBUFFER), bufferMode(BufferBefore | BufferAfter)
, layoutDirection(Qt::LeftToRight), verticalLayoutDirection(QQuickItemView::TopToBottom)
, moveReason(Other)
, visibleIndex(0)
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 75d4933862..5401abc442 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -2094,8 +2094,10 @@ void QQuickListView::setOrientation(QQuickListView::Orientation orientation)
area may be created/retained. The buffered delegates are created asynchronously,
allowing creation to occur across multiple frames and reducing the
likelihood of skipping frames. In order to improve painting performance
- delegates outside the visible area have their \l visible property set to
- false until they are moved into the visible area.
+ delegates outside the visible area are not painted.
+
+ The default value of this property is platform dependent, but will usually
+ be a non-zero value.
Note that cacheBuffer is not a pixel buffer - it only maintains additional
instantiated delegates.