|
|
|
|
|
|
get { return (ContainerLayer) base.parent; } |
|
|
|
} |
|
|
|
|
|
|
|
bool _needsAddToScene = true; |
|
|
|
public bool _needsAddToScene = true; |
|
|
|
if (_needsAddToScene) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_needsAddToScene = true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
EngineLayer _engineLayer; |
|
|
|
|
|
|
|
internal virtual void updateSubtreeNeedsAddToScene() { |
|
|
|
_subtreeNeedsAddToScene = _needsAddToScene || alwaysNeedsAddToScene; |
|
|
|
_needsAddToScene = _needsAddToScene || alwaysNeedsAddToScene; |
|
|
|
} |
|
|
|
|
|
|
|
public Layer nextSibling { |
|
|
|
|
|
|
internal Layer _previousSibling; |
|
|
|
|
|
|
|
protected override void dropChild(AbstractNodeMixinDiagnosticableTree child) { |
|
|
|
markNeedsAddToScene(); |
|
|
|
if (!alwaysNeedsAddToScene) { |
|
|
|
markNeedsAddToScene(); |
|
|
|
} |
|
|
|
|
|
|
|
markNeedsAddToScene(); |
|
|
|
if (!alwaysNeedsAddToScene) { |
|
|
|
markNeedsAddToScene(); |
|
|
|
} |
|
|
|
|
|
|
|
base.adoptChild(child); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
internal abstract void addToScene(SceneBuilder builder, Offset layerOffset = null); |
|
|
|
|
|
|
|
internal void _addToSceneWithRetainedRendering(SceneBuilder builder) { |
|
|
|
if (!_subtreeNeedsAddToScene && _engineLayer != null) { |
|
|
|
if (!_needsAddToScene && _engineLayer != null) { |
|
|
|
builder.addRetained(_engineLayer); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
Layer child = firstChild; |
|
|
|
while (child != null) { |
|
|
|
child.updateSubtreeNeedsAddToScene(); |
|
|
|
_subtreeNeedsAddToScene = _subtreeNeedsAddToScene || child._subtreeNeedsAddToScene; |
|
|
|
_needsAddToScene = _needsAddToScene || child._needsAddToScene; |
|
|
|
child = child.nextSibling; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
_lastEffectiveTransform.multiply(transform); |
|
|
|
} |
|
|
|
|
|
|
|
builder.pushTransform(_lastEffectiveTransform.toMatrix3()); |
|
|
|
engineLayer = builder.pushTransform( |
|
|
|
_lastEffectiveTransform._m4storage, |
|
|
|
oldLayer: engineLayer as TransformEngineLayer); |
|
|
|
|
|
|
|
addChildrenToScene(builder); |
|
|
|
builder.pop(); |
|
|
|
} |
|
|
|
|
|
|
enabled = !D.debugDisableOpacityLayers; |
|
|
|
return true; |
|
|
|
}); |
|
|
|
|
|
|
|
if (enabled) { |
|
|
|
engineLayer = builder.pushOpacity( |
|
|
|
alpha, |
|
|
|
|
|
|
D.assert(offset != null); |
|
|
|
_lastOffset = offset + layerOffset; |
|
|
|
if (_lastOffset != Offset.zero) { |
|
|
|
builder.pushTransform(new Matrix4() |
|
|
|
engineLayer = builder.pushTransform( |
|
|
|
new Matrix4() |
|
|
|
.toMatrix3()); |
|
|
|
._m4storage, |
|
|
|
oldLayer: engineLayer as TransformEngineLayer); |
|
|
|
} |
|
|
|
|
|
|
|
addChildrenToScene(builder, Offset.zero); |
|
|
|
|
|
|
_lastTransform = null; |
|
|
|
_lastOffset = null; |
|
|
|
_inverseDirty = true; |
|
|
|
engineLayer = null; |
|
|
|
builder.pushTransform(_lastTransform.toMatrix3()); |
|
|
|
engineLayer = builder.pushTransform( |
|
|
|
_lastTransform._m4storage, |
|
|
|
oldLayer: engineLayer as TransformEngineLayer); |
|
|
|
addChildrenToScene(builder); |
|
|
|
builder.pop(); |
|
|
|
_lastOffset = unlinkedOffset + layerOffset; |
|
|
|
|
|
|
var matrix = new Matrix4().translationValues(unlinkedOffset.dx, unlinkedOffset.dy, 0); |
|
|
|
builder.pushTransform(matrix.toMatrix3()); |
|
|
|
engineLayer = builder.pushTransform( |
|
|
|
matrix._m4storage, |
|
|
|
oldLayer: engineLayer as TransformEngineLayer); |
|
|
|
addChildrenToScene(builder); |
|
|
|
builder.pop(); |
|
|
|
} |
|
|
|
|
|
|
ancestor = ancestor.parent; |
|
|
|
} |
|
|
|
|
|
|
|
return clipPath.transform(matrix.toMatrix3()); |
|
|
|
return clipPath.transform(matrix._m4storage); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|