diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-08-11 13:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-08-23 07:56:30 +0200 |
commit | 15ee12508ec8663ae09ebfc61cc4f0725311bdec (patch) | |
tree | 7f788285afbde14f0d1eaab9065b21410c277ac5 /src/quick/scenegraph/qsgadaptationlayer.cpp | |
parent | 253e9257e1f586d1c1dfa585aa6f862d310cdec3 (diff) |
Cleanup: Separate the sub-tree layering out of QtQuick into the scene graph
This basically renames QQuickShaderEffectTexture to QSGDefaultLayer and
introduces QSGLayer as interface to be used. QQuickShaderEffectTexture is
generic for the scene graph and has no QtQuick dependencies. The interface
separation allows scene graph backends to customize layers.
Change-Id: I9a7f37addaa4b80a34ff9a1456b0cb9b16d4e9f3
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/scenegraph/qsgadaptationlayer.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index ee077dbaf1..68b1882c3f 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -328,6 +328,7 @@ void QSGNodeVisitorEx::visitChildren(QSGNode *node) } break; } + case QSGNode::RootNodeType: // fall through case QSGNode::BasicNodeType: { visitChildren(child); break; @@ -339,4 +340,25 @@ void QSGNodeVisitorEx::visitChildren(QSGNode *node) } } +void QSGLayer::markDirtyTextureLater() +{ + QCoreApplication::postEvent(this, new QEvent(static_cast<QEvent::Type>(markDirtyEventType()))); +} + +void QSGLayer::customEvent(QEvent *event) +{ + if (event->type() == markDirtyEventType()) + markDirtyTexture(); + else + QObject::customEvent(event); +} + +int QSGLayer::markDirtyEventType() +{ + static int type = QEvent::None; + if (type == QEvent::None) + type = QEvent::registerEventType(); + return type; +} + QT_END_NAMESPACE |