Commit cb3ddf0b authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Second round of huge memory usage improvment: disable qml components on...

Second round of huge memory usage improvment: disable qml components on clip/compositions that are out of sight
parent 246c9931
...@@ -70,6 +70,7 @@ Rectangle { ...@@ -70,6 +70,7 @@ Rectangle {
property color borderColor: 'black' property color borderColor: 'black'
property bool forceReloadThumb property bool forceReloadThumb
property bool isComposition: false property bool isComposition: false
property bool hideClipViews
property var groupTrimData property var groupTrimData
property int scrollStart: scrollView.flickableItem.contentX - clipRoot.modelStart * timeline.scaleFactor property int scrollStart: scrollView.flickableItem.contentX - clipRoot.modelStart * timeline.scaleFactor
width : clipDuration * timeScale; width : clipDuration * timeScale;
...@@ -80,6 +81,10 @@ Rectangle { ...@@ -80,6 +81,10 @@ Rectangle {
signal initGroupTrim(var clip) signal initGroupTrim(var clip)
signal trimmingOut(var clip, real newDuration, var mouse, bool shiftTrim, bool controlTrim) signal trimmingOut(var clip, real newDuration, var mouse, bool shiftTrim, bool controlTrim)
signal trimmedOut(var clip, bool shiftTrim, bool controlTrim) signal trimmedOut(var clip, bool shiftTrim, bool controlTrim)
onScrollStartChanged: {
clipRoot.hideClipViews = scrollStart > width || scrollStart + scrollView.viewport.width < 0
}
onIsGrabbedChanged: { onIsGrabbedChanged: {
if (clipRoot.isGrabbed) { if (clipRoot.isGrabbed) {
...@@ -298,7 +303,7 @@ Rectangle { ...@@ -298,7 +303,7 @@ Rectangle {
asynchronous: true asynchronous: true
visible: status == Loader.Ready visible: status == Loader.Ready
anchors.fill: parent anchors.fill: parent
source: parentTrack.isAudio ? (timeline.showAudioThumbnails ? "ClipAudioThumbs.qml" : "") : itemType == ProducerType.Color ? "" : timeline.showThumbnails ? "ClipThumbs.qml" : "" source: clipRoot.hideClipViews ? "" : parentTrack.isAudio ? (timeline.showAudioThumbnails ? "ClipAudioThumbs.qml" : "") : itemType == ProducerType.Color ? "" : timeline.showThumbnails ? "ClipThumbs.qml" : ""
onLoaded: { onLoaded: {
item.reload() item.reload()
} }
...@@ -462,7 +467,7 @@ Rectangle { ...@@ -462,7 +467,7 @@ Rectangle {
inPoint: clipRoot.inPoint inPoint: clipRoot.inPoint
outPoint: clipRoot.outPoint outPoint: clipRoot.outPoint
masterObject: clipRoot masterObject: clipRoot
kfrModel: clipRoot.keyframeModel kfrModel: clipRoot.hideClipViews ? 0 : clipRoot.keyframeModel
} }
} }
......
...@@ -61,6 +61,8 @@ Item { ...@@ -61,6 +61,8 @@ Item {
property double speed: 1.0 property double speed: 1.0
property color color: displayRect.color property color color: displayRect.color
property color borderColor: 'black' property color borderColor: 'black'
property bool hideCompoViews
property int scrollStart: scrollView.flickableItem.contentX - modelStart * timeline.scaleFactor
signal moved(var clip) signal moved(var clip)
signal dragged(var clip, var mouse) signal dragged(var clip, var mouse)
...@@ -71,6 +73,10 @@ Item { ...@@ -71,6 +73,10 @@ Item {
signal trimmingOut(var clip, real newDuration, var mouse) signal trimmingOut(var clip, real newDuration, var mouse)
signal trimmedOut(var clip) signal trimmedOut(var clip)
onScrollStartChanged: {
compositionRoot.hideCompoViews = compositionRoot.scrollStart > width || compositionRoot.scrollStart + scrollView.viewport.width < 0
}
onKeyframeModelChanged: { onKeyframeModelChanged: {
if (effectRow.keyframecanvas) { if (effectRow.keyframecanvas) {
effectRow.keyframecanvas.requestPaint() effectRow.keyframecanvas.requestPaint()
...@@ -236,7 +242,7 @@ Item { ...@@ -236,7 +242,7 @@ Item {
inPoint: 0 inPoint: 0
outPoint: compositionRoot.clipDuration outPoint: compositionRoot.clipDuration
masterObject: compositionRoot masterObject: compositionRoot
kfrModel: compositionRoot.keyframeModel kfrModel: compositionRoot.hideCompoViews ? 0 : compositionRoot.keyframeModel
} }
} }
/*Drag.active: mouseArea.drag.active /*Drag.active: mouseArea.drag.active
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment