Merge remote-tracking branch 'origin/5.3' into 5.4
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Tue, 14 Oct 2014 12:04:48 +0000 (14:04 +0200)
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Tue, 14 Oct 2014 16:11:09 +0000 (18:11 +0200)
Conflicts:
src/qml/jsruntime/qv4objectiterator.cpp
src/qml/jsruntime/qv4objectiterator_p.h
src/quick/scenegraph/qsgthreadedrenderloop.cpp

Change-Id: Ia54a9acd96530aa6683c228597af0ca25eadec4f

1  2 
src/qml/jsruntime/qv4objectiterator.cpp
src/qml/jsruntime/qv4objectiterator_p.h
src/quick/scenegraph/qsgthreadedrenderloop.cpp

@@@ -46,35 -54,39 +46,44 @@@ ObjectIterator::ObjectIterator(Value *s
      , memberIndex(0)
      , flags(flags)
  {
-     object->o = o;
-     current->o = o;
- #if QT_POINTER_SIZE == 4
-     object->tag = QV4::Value::Managed_Type;
-     current->tag = QV4::Value::Managed_Type;
- #endif
-     if (object->as<ArgumentsObject>()) {
-         Scope scope(object->engine());
-         Scoped<ArgumentsObject> (scope, object->asReturnedValue())->fullyCreate();
-     }
+     init(o);
  }
  
 -ObjectIterator::ObjectIterator(Scope &scope, const ObjectRef o, uint flags)
 -    : object(ObjectRef::fromValuePointer(scope.alloc(1)))
 -    , current(ObjectRef::fromValuePointer(scope.alloc(1)))
 +ObjectIterator::ObjectIterator(Scope &scope, Object *o, uint flags)
 +    : object(scope.alloc(1))
 +    , current(scope.alloc(1))
      , arrayNode(0)
      , arrayIndex(0)
      , memberIndex(0)
      , flags(flags)
  {
 -    : object(ObjectRef::fromValuePointer(scratch1))
 -    , current(ObjectRef::fromValuePointer(scratch2))
+     init(o);
+ }
+ ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, uint flags)
 -    object = (Object*)0;
 -    current = (Object*)0;
++    : object(scratch1)
++    , current(scratch2)
+     , arrayNode(0)
+     , arrayIndex(0)
+     , memberIndex(0)
+     , flags(flags)
+ {
 -void ObjectIterator::init(const ObjectRef o)
++    object->o = (Object*)0;
++    current->o = (Object*)0;
+     // Caller needs to call init!
+ }
 -    object = o.getPointer();
 -    current = o.getPointer();
++void ObjectIterator::init(Object *o)
+ {
 -    if (!!object && object->asArgumentsObject()) {
 +    object->o = o;
 +    current->o = o;
 +#if QT_POINTER_SIZE == 4
 +    object->tag = QV4::Value::Managed_Type;
 +    current->tag = QV4::Value::Managed_Type;
 +#endif
 +
 +    if (object->as<ArgumentsObject>()) {
          Scope scope(object->engine());
          Scoped<ArgumentsObject> (scope, object->asReturnedValue())->fullyCreate();
      }
@@@ -66,9 -75,10 +67,10 @@@ struct Q_QML_EXPORT ObjectIterato
      uint memberIndex;
      uint flags;
  
 -    ObjectIterator(Value *scratch1, Value *scratch2, const ObjectRef o, uint flags);
 -    ObjectIterator(Scope &scope, const ObjectRef o, uint flags);
 -    void init(const ObjectRef o);
 -    void next(StringRef name, uint *index, Property *pd, PropertyAttributes *attributes = 0);
 +    ObjectIterator(Value *scratch1, Value *scratch2, Object *o, uint flags);
 +    ObjectIterator(Scope &scope, Object *o, uint flags);
++    void init(Object *o);
 +    void next(String *&name, uint *index, Property *pd, PropertyAttributes *attributes = 0);
      ReturnedValue nextPropertyName(ValueRef value);
      ReturnedValue nextPropertyNameAsString(ValueRef value);
      ReturnedValue nextPropertyNameAsString();
@@@ -545,26 -578,28 +545,27 @@@ void QSGRenderThread::syncAndRender(
  
      syncResultedInChanges = false;
  
 -    bool repaintRequested = pendingUpdate & RepaintRequest;
 -    bool syncRequested = pendingUpdate & SyncRequest;
 +    uint pending = pendingUpdate;
      pendingUpdate = 0;
  
 -    if (syncRequested) {
 -        QSG_RT_DEBUG(" - update pending, doing sync");
 -        sync();
 +    if (pending & SyncRequest) {
 +        qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- updatePending, doing sync";
 +        sync(pending == ExposeRequest);
      }
+ #ifndef QSG_NO_RENDER_TIMING
+     if (profileFrames)
+         syncTime = threadTimer.nsecsElapsed();
+ #endif
  
 -    if (!syncResultedInChanges && !(repaintRequested)) {
 -        QSG_RT_DEBUG(" - no changes, rendering aborted");
 +    if (!syncResultedInChanges && ((pending & RepaintRequest) == 0)) {
 +        qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- no changes, render aborted";
          int waitTime = vsyncDelta - (int) waitTimer.elapsed();
          if (waitTime > 0)
              msleep(waitTime);
          return;
      }
  
-     if (profileFrames)
-         syncTime = threadTimer.nsecsElapsed();
 -    QSG_RT_DEBUG(" - rendering starting");
 +    qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- rendering started";
  
      QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);