浏览代码

review rendering code from A to P

/siyaoH-1.17-PlatformMessage
guanghuispark 4 年前
当前提交
de729244
共有 6 个文件被更改,包括 327 次插入169 次删除
  1. 1
      com.unity.uiwidgets/Runtime/rendering/debug.cs
  2. 2
      com.unity.uiwidgets/Runtime/rendering/object.cs
  3. 40
      com.unity.uiwidgets/Runtime/rendering/paragraph.cs
  4. 7
      com.unity.uiwidgets/Runtime/rendering/performance_overlay.cs
  5. 399
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  6. 47
      com.unity.uiwidgets/Runtime/rendering/proxy_sliver.cs

1
com.unity.uiwidgets/Runtime/rendering/debug.cs


namespace Unity.UIWidgets.rendering {
public static class RenderingDebugUtils {
public static bool debugDisableShadows = false;
public static bool debugCheckElevationsEnabled = false;
public static bool debugRepaintTextRainbowEnabled = false;
static readonly HSVColor _kDebugDefaultRepaintColor = HSVColor.fromAHSV(0.4f, 60.0f, 1.0f, 1.0f);

2
com.unity.uiwidgets/Runtime/rendering/object.cs


_needsCompositingBitsUpdate = false;
}
bool debugNeedsPaint {
public bool debugNeedsPaint {
get {
bool result = false;
D.assert(() => {

40
com.unity.uiwidgets/Runtime/rendering/paragraph.cs


_needsClipping = true;
break;
}*/
//[!!!]need to replace it?
switch (_overflow) {
case TextOverflow.visible:
_needsClipping = false;

paintParagraph(context, offset);
}
} */
// need to replace it?
public override void paint(PaintingContext context2, Offset offset2) {
public override void paint(PaintingContext context, Offset offset) {
_layoutTextWithConstraints(constraints);
D.assert(() => {

context2.canvas.drawRect(offset2 & size, paint);
context.canvas.drawRect(offset & size, paint);
Rect bounds = offset2 & size;
Rect bounds = offset & size;
context2.canvas.saveLayer(bounds, new Paint());
context.canvas.saveLayer(bounds, new Paint());
context2.canvas.save();
context.canvas.save();
context2.canvas.clipRect(bounds);
context.canvas.clipRect(bounds);
_textPainter.paint(context2.canvas, offset2);
_textPainter.paint(context.canvas, offset);
RenderBox child = firstChild;
int childIndex = 0;

float scale = textParentData.scale;
context2.pushTransform(
context.pushTransform(
offset2 + textParentData.offset,
offset + textParentData.offset,
(PaintingContext context, Offset offset) => {
context.paintChild(
(PaintingContext context2, Offset offset2) => {
context2.paintChild(
offset
offset2
}
);
});
context2.canvas.translate(offset2.dx, offset2.dy);
context.canvas.translate(offset.dx, offset.dy);
context2.canvas.drawRect(Offset.zero & size, paint);
context.canvas.drawRect(Offset.zero & size, paint);
context2.canvas.restore();
context.canvas.restore();
}
}

_textPainter.layout(minWidth, widthMatters ? maxWidth : float.PositiveInfinity);
}
/*public override void systemFontsDidChange() {
base.systemFontsDidChange();
_textPainter.markNeedsLayout();
}*/
List<PlaceholderDimensions> _placeholderDimensions;
void _layoutTextWithConstraints(BoxConstraints constraints) {

7
com.unity.uiwidgets/Runtime/rendering/performance_overlay.cs


bool checkerboardRasterCacheImages = false,
bool checkerboardOffscreenLayers = false
) {
D.assert(optionsMask != null);
D.assert(rasterizerThreshold != null);
D.assert(checkerboardRasterCacheImages != null);
D.assert(checkerboardOffscreenLayers != null);
_optionsMask = optionsMask;
_rasterizerThreshold = rasterizerThreshold;
_checkerboardRasterCacheImages = checkerboardRasterCacheImages;

return _rasterizerThreshold;
}
set {
D.assert(value != null);
if (value == _rasterizerThreshold)
return;
_rasterizerThreshold = value;

return _checkerboardRasterCacheImages;
}
set {
D.assert(value != null);
if (value == _checkerboardRasterCacheImages)
return;
_checkerboardRasterCacheImages = value;

public bool checkerboardOffscreenLayers {
get { return _checkerboardOffscreenLayers; }
set {
D.assert(value != null);
if (value == _checkerboardOffscreenLayers)
return;
_checkerboardOffscreenLayers = value;

399
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

BlendMode blendMode = BlendMode.modulate
) : base(child) {
D.assert(shaderCallback != null);
D.assert(blendMode != null);
_shaderCallback = shaderCallback;
_blendMode = blendMode;
}

public BlendMode blendMode {
get { return _blendMode;}
set {
D.assert(value != null);
if (_blendMode == value)
return;
_blendMode = value;

get;
}
bool _currentlyNeedsCompositing { get; set; }
Animation<float> opacity {
get;
set;
}
Animation<float> _opacity { get; set; }
bool alwaysIncludeSemantics {
Animation<float> _opacity {
bool _alwaysIncludeSemantics { get; set; }
void attach(PipelineOwner owner);
void detach();

}
protected override void performLayout() {
BoxConstraints constraints = this.constraints;
if (child != null) {
child.layout(_additionalConstraints.enforce(constraints), parentUsesSize: true);
size = child.size;

protected override void performLayout() {
if (child != null) {
BoxConstraints constraints = this.constraints;
child.layout(_limitConstraints(constraints), parentUsesSize: true);
size = constraints.constrain(child.size);
}

public RenderAspectRatio(
float aspectRatio,
RenderBox child = null) : base(child) {
D.assert(aspectRatio > 0.0);
D.assert(aspectRatio.isFinite());
_aspectRatio = aspectRatio;
}

float width = constraints.maxWidth;
float height = width / _aspectRatio;
if (width.isFinite()) {
height = width / _aspectRatio;
} else {
height = constraints.maxHeight;
width = height * _aspectRatio;
}
if (width > constraints.maxWidth) {
width = constraints.maxWidth;
height = width / _aspectRatio;

public override void paint(PaintingContext context, Offset offset) {
if (child != null) {
if (_alpha == 0) {
layer = null;
layer = null;
context.pushOpacity(offset, _alpha, base.paint);
layer = context.pushOpacity(offset, _alpha, base.paint, oldLayer: layer as OpacityLayer);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

public override void paint(PaintingContext context, Offset offset) {
if (child != null) {
D.assert(needsCompositing);
context.pushLayer(new BackdropFilterLayer(filter), base.paint, offset);
layer = layer?? new BackdropFilterLayer(_filter);
context.pushLayer(layer, base.paint, offset);
} else {
layer = null;
}
}
}

}
_clipBehavior = value;
markNeedsPaint();
}
}

new List<Color> {
new Color(0x00000000),
new Color(0xFFFF00FF),
}, null, TileMode.repeated);
new Color(0xFFFF00FF),
new Color(0x00000000)
},
new List<float>{0.25f,0.25f,0.75f,0.75f},
TileMode.repeated);
_debugPaint.strokeWidth = 2.0f;
_debugPaint.style = PaintingStyle.stroke;
}

text: new TextSpan(
text: "x",
text: "✂",
));
),
textDirection: TextDirection.rtl
);
_debugText.layout();
}

child: child,
clipper: clipper,
clipBehavior: clipBehavior) {
D.assert(clipBehavior != Clip.none);
}
protected override Rect _defaultClip {

public override void paint(PaintingContext context, Offset offset) {
if (child != null) {
_updateClip();
context.pushClipRect(needsCompositing, offset, _clip,
base.paint, clipBehavior: clipBehavior);
layer = context.pushClipRect(
needsCompositing,
offset,
_clip,
base.paint,
clipBehavior: clipBehavior,
oldLayer: layer as ClipRectLayer
);
} else {
layer = null;
}
}

public override void paint(PaintingContext context, Offset offset) {
if (child != null) {
_updateClip();
context.pushClipRRect(needsCompositing, offset, _clip.outerRect, _clip,
base.paint, clipBehavior: clipBehavior);
layer = context.pushClipRRect(
needsCompositing,
offset,
_clip.outerRect,
_clip,
base.paint,
clipBehavior: clipBehavior,
oldLayer: layer as ClipRRectLayer
);
} else {
layer = null;
}
}

get { return Offset.zero & size; }
}
public override bool hitTest(BoxHitTestResult result,
Offset position = null
) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
_updateClip();
D.assert(_clip != null);
Offset center = _clip.center;

public override void paint(PaintingContext context, Offset offset) {
if (child != null) {
_updateClip();
context.pushClipPath(needsCompositing, offset, _clip, _getClipPath(_clip),
base.paint, clipBehavior: clipBehavior);
layer = context.pushClipPath(
needsCompositing,
offset,
_clip,
_getClipPath(_clip),
base.paint,
clipBehavior: clipBehavior,
oldLayer: layer as ClipPathLayer
);
} else {
layer = null;
}
}

public override void paint(PaintingContext context, Offset offset) {
if (child != null) {
_updateClip();
context.pushClipPath(needsCompositing, offset, Offset.zero & size,
_clip, base.paint, clipBehavior: clipBehavior);
layer = context.pushClipPath(
needsCompositing,
offset,
Offset.zero & size,
_clip,
base.paint,
clipBehavior: clipBehavior,
oldLayer: layer as ClipPathLayer
);
} else {
layer = null;
}
}

_shape = shape;
_borderRadius = borderRadius;
}
public PhysicalModelLayer layer { // [!!!] override
get {
return base.layer as PhysicalModelLayer;
}
set {
if (layer == value) {
return;
}
base.layer = value;
}
}
public BoxShape shape {
get { return _shape; }

Rect offsetBounds = offsetRRect.outerRect;
Path offsetRRectAsPath = new Path();
offsetRRectAsPath.addRRect(offsetRRect);
PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipPath: offsetRRectAsPath,
clipBehavior: clipBehavior,
elevation: elevation,
color: color,
shadowColor: shadowColor);
bool paintShadows = true;
physicalModel.debugCreator = debugCreator;
if (RenderingDebugUtils.debugDisableShadows) {
if (elevation > 0.0) {
Paint paint = new Paint();
paint.color = shadowColor;
paint.style = PaintingStyle.stroke;
paint.strokeWidth = elevation * 2.0f;
context.canvas.drawRRect(
offsetRRect,
paint
);
}
paintShadows = false;
}
context.pushLayer(physicalModel, base.paint, offset, childPaintBounds: offsetBounds);
layer = layer?? new PhysicalModelLayer();
layer.clipPath = offsetRRectAsPath;
layer.clipBehavior = clipBehavior;
layer.elevation = paintShadows ? elevation : 0.0f;
layer.color = color;
layer.shadowColor = shadowColor;
context.pushLayer(layer, base.paint, offset, childPaintBounds: offsetBounds);
D.assert(() => {
layer.debugCreator = debugCreator;
return true;
});
} else {
layer = null;
}
}

clipBehavior: clipBehavior) {
D.assert(clipper != null);
D.assert(color != null);
D.assert(elevation >= 0.0);
}
public PhysicalModelLayer layer { // [!!!] override
get {
return base.layer as PhysicalModelLayer;
}
set {
if (layer == value) {
return;
}
base.layer = value;
}
}
protected override Path _defaultClip {

_updateClip();
Rect offsetBounds = offset & size;
Path offsetPath = _clip.shift(offset);
PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipPath: offsetPath,
clipBehavior: clipBehavior,
elevation: elevation,
color: color,
shadowColor: shadowColor);
context.pushLayer(physicalModel, base.paint, offset, childPaintBounds: offsetBounds);
bool paintShadows = true;
D.assert(() => {
if (RenderingDebugUtils.debugDisableShadows) {
if (elevation > 0.0) {
Paint paint = new Paint();
paint.color = shadowColor;
paint.style = PaintingStyle.stroke;
paint.strokeWidth = elevation * 2.0f;
context.canvas.drawPath(
offsetPath,
paint
);
}
paintShadows = false;
}
return true;
});
layer = layer?? new PhysicalModelLayer();
layer.clipPath = offsetPath;
layer.clipBehavior = clipBehavior;
layer.elevation = paintShadows ? elevation : 0.0f;
layer.color = color;
layer.shadowColor = shadowColor;
context.pushLayer(layer, base.paint, offset, childPaintBounds: offsetBounds);
D.assert(() => {
layer.debugCreator = debugCreator;
return true;
});
} else {
layer = null;
}
}

protected override bool hitTestSelf(Offset position) {
return _decoration.hitTest(size, position);
// [!!!] hitTest no textDirection
// return _decoration.hitTest(size, position, textDirection: configuration.textDirection);
}
public override void paint(PaintingContext context, Offset offset) {

D.assert(() => {
if (debugSaveCount != context.canvas.getSaveCount()) {
throw new UIWidgetsError(
_decoration.GetType() + " painter had mismatching save and restore calls.\n" +
"Before painting the decoration, the canvas save count was $debugSaveCount. " +
"After painting it, the canvas save count was " + context.canvas.getSaveCount() + ". " +
"Every call to save() or saveLayer() must be matched by a call to restore().\n" +
"The decoration was:\n" +
" " + decoration + "\n" +
"The painter was:\n" +
" " + _painter
);
throw new UIWidgetsError(new List<DiagnosticsNode>{
new ErrorSummary($"{_decoration.GetType()} painter had mismatching save and restore calls."),
new ErrorDescription(
"Before painting the decoration, the canvas save count was $debugSaveCount. " +
"After painting it, the canvas save count was ${context.canvas.getSaveCount()}. " +
"Every call to save() or saveLayer() must be matched by a call to restore()."
),
new DiagnosticsProperty<Decoration>("The decoration was", decoration, style: DiagnosticsTreeStyle.errorProperty),
new DiagnosticsProperty<BoxPainter>("The painter was", _painter, style: DiagnosticsTreeStyle.errorProperty),
});
}
return true;

bool transformHitTests = true,
RenderBox child = null
) : base(child) {
D.assert(transform != null);
this.transform = transform;
this.origin = origin;
this.alignment = alignment;

return;
_textDirection = value;
markNeedsPaint();
//markNeedsSemanticsUpdate();
}
}

}
_transform = value;
//_transform = Matrix4.copy(value);
markNeedsPaint();
}
}

public void setIdentity() {
_transform.setIdentity();
_transform = Matrix4.identity();
markNeedsPaint();
}

Offset childOffset = transform.getAsTranslation();
if (childOffset == null) {
context.pushTransform(needsCompositing, offset, transform, base.paint);
}
else {
layer = context.pushTransform(
needsCompositing,
offset,
transform,
base.paint,
oldLayer: layer as TransformLayer
);
} else {
layer = null;
}
}
}

Rect sourceRect = _resolvedAlignment.inscribe(sizes.source, Offset.zero & childSize);
Rect destinationRect = _resolvedAlignment.inscribe(sizes.destination, Offset.zero & size);
_hasVisualOverflow = sourceRect.width < childSize.width || sourceRect.height < childSize.height;
D.assert(scaleX.isFinite() && scaleY.isFinite());
bool result = true;
foreach (var value in _transform.storage) {
if (!value.isFinite()) {
result = false;
}
}
D.assert(result);
context.pushTransform(needsCompositing, offset, _transform, base.paint);
context.pushTransform(needsCompositing, offset, _transform, base.paint,
oldLayer: layer is TransformLayer ? layer as TransformLayer : null);
/*TransformLayer _paintChildWithTransform(PaintingContext context, Offset offset) {
Offset childOffset = _transform.getAsTranslation();
if (childOffset == null) {
return context.pushTransform(needsCompositing, offset, _transform, base.paint,
oldLayer: layer is TransformLayer ? layer as TransformLayer : null);
}
else {
base.paint(context, offset + childOffset);
return null;
}
}*/
//[!!!]
if (size.isEmpty) {
if (size.isEmpty || child.size.isEmpty) {
return;
}

context.pushClipRect(needsCompositing, offset, Offset.zero & size,
_paintChildWithTransform);
painter: _paintChildWithTransform,
oldLayer: layer is ClipRectLayer ? layer as ClipRectLayer : null);
else {
else{
_paintChildWithTransform(context, offset);
}
}

}
public override void applyPaintTransform(RenderObject child, Matrix4 transform) {
if (size.isEmpty) {
if (size.isEmpty || ((RenderBox)child).size.isEmpty) {
transform.setZero();
}
else {

Offset _translation;
public override bool hitTest(BoxHitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
D.assert(!debugNeedsLayout);
return result.addWithPaintOffset(
offset: transformHitTests

{"cancel", onPointerCancel},
{"signal", onPointerSignal}
},
ifEmpty: "<none>"));
ifEmpty: "<none>"
));
}
}

bool opaque = true,
RenderBox child = null
) : base(child) {
D.assert(opaque != null);
_onEnter = onEnter;
_onHover = onHover;
_onExit = onExit;

}
}
PointerEnterEventListener _onEnter;
public void _handleEnter(PointerEnterEvent Event) {
public void _handleEnter(PointerEnterEvent _event) {
_onEnter(Event);
_onEnter(_event);
}
public PointerHoverEventListener onHover {

}
PointerHoverEventListener _onHover;
void _handleHover(PointerHoverEvent Event) {
void _handleHover(PointerHoverEvent _event) {
_onHover(Event);
_onHover(_event);
}
public PointerExitEventListener onExit {

}
PointerExitEventListener _onExit;
void _handleExit(PointerExitEvent Event) {
void _handleExit(PointerExitEvent _event) {
_onExit(Event);
_onExit(_event);
}
MouseTrackerAnnotation _hoverAnnotation;

owner = (PipelineOwner)owner;
base.attach(owner);
// todo
//RendererBinding.instance.mouseTracker.addListener(_handleUpdatedMouseIsConnected);
RendererBinding.instance.mouseTracker.addListener(_handleUpdatedMouseIsConnected);
// RendererBinding.instance.mouseTracker.removeListener(_handleUpdatedMouseIsConnected);
RendererBinding.instance.mouseTracker.removeListener(_handleUpdatedMouseIsConnected);
base.detach();
}
public bool _annotationIsActive;

AnnotatedRegionLayer<MouseTrackerAnnotation> layer = new AnnotatedRegionLayer<MouseTrackerAnnotation>(
_hoverAnnotation,
size: size,
offset: offset
//opaque: opaque // todo
offset: offset,
opaque: opaque // TODO
);
context.pushLayer(layer, base.paint, offset);
} else {

public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
// todo
/* properties.add(FlagsSummary<Function>(
properties.add(new FlagsSummary<Delegate>(
<string, Function>{
"enter": onEnter,
"hover": onHover,
"exit": onExit,
}
ifEmpty: "<none>",
));*/
new Dictionary<string, Delegate>{
{"enter", onEnter},
{"hover", onHover},
{"exit", onExit},
},
ifEmpty: "<none>"
));
properties.add(new DiagnosticsProperty<bool>("opaque", opaque, defaultValue: true));
}
}

public override bool isRepaintBoundary {
get { return true; }
}
Future<ui.Image> toImage( float pixelRatio = 1.0f) {
D.assert(!debugNeedsPaint);
OffsetLayer offsetLayer = layer as OffsetLayer;
return offsetLayer.toImage(Offset.zero & size, pixelRatio: pixelRatio);
}
public int debugSymmetricPaintCount {
get { return _debugSymmetricPaintCount; }

bool _ignoring;
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
return ignoring ? false : base.hitTest(result, position: position);
return !ignoring && base.hitTest(result, position: position);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

}
public class RenderOffstage : RenderProxyBox {
public RenderOffstage(bool offstage = true,
RenderBox child = null) : base(child) {
public RenderOffstage(bool offstage = true, RenderBox child = null) : base(child) {
_offstage = offstage;
}

}
}
public override bool hitTest(BoxHitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
return !offstage && base.hitTest(result, position: position);
}

public bool absorbing {
get { return _absorbing; }
set { _absorbing = value; }
set {
if (_absorbing == value)
return;
_absorbing = value;
}
public override bool hitTest(BoxHitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
return absorbing
? size.contains(position)
: base.hitTest(result, position: position);

}
public override void paint(PaintingContext context, Offset offset) {
context.pushLayer(new LeaderLayer(link: link, offset: offset), base.paint, Offset.zero);
if (layer == null) {
layer = new LeaderLayer(link: link, offset: offset);
} else {
LeaderLayer leaderLayer = (LeaderLayer)layer;
leaderLayer.link = link;
leaderLayer.offset = offset;
}
context.pushLayer(layer, base.paint, Offset.zero);
D.assert(layer != null);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

Offset offset = null,
RenderBox child = null
) : base(child) {
D.assert(link != null);
this.offset = offset;
this.offset = offset?? Offset.zero;
}
public LayerLink link {

Offset _offset;
public override void detach() {
_layer = null;
layer = null;
base.detach();
}

new FollowerLayer _layer;
public FollowerLayer layer { // [!!!] override
get {
return base.layer as FollowerLayer;
}
set {
if (layer == value)
return;
layer = value;
}
}
return _layer?.getLastTransform() ?? Matrix4.identity();
return layer?.getLastTransform() ?? Matrix4.identity();
public override bool hitTest(BoxHitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return result.addWithPaintTransform(
transform: getCurrentTransform(),
position: position,

}
public override void paint(PaintingContext context, Offset offset) {
_layer = new FollowerLayer(
link: link,
showWhenUnlinked: showWhenUnlinked,
linkedOffset: this.offset,
unlinkedOffset: offset
);
context.pushLayer(_layer,
if (layer == null) {
layer = new FollowerLayer(
link: link,
showWhenUnlinked: showWhenUnlinked,
linkedOffset: this.offset,
unlinkedOffset: offset
);
}
else {
layer.link = link;
layer.showWhenUnlinked = showWhenUnlinked;
layer.linkedOffset = this.offset;
layer.unlinkedOffset = offset;
}
context.pushLayer(
layer,
base.paint,
Offset.zero,
childPaintBounds: Rect.fromLTRB(

47
com.unity.uiwidgets/Runtime/rendering/proxy_sliver.cs


RenderSliver sliver = null,
float opacity = 1.0f
) : base( child:sliver) {
D.assert(opacity != null && opacity >= 0.0 && opacity <= 1.0);
D.assert(opacity >= 0.0 && opacity <= 1.0);
child = sliver;
}

public float opacity {
get { return _opacity; }
set {
D.assert(value != null);
set {
D.assert(value >= 0.0 && value <= 1.0);
if (_opacity == value)
return;

_alpha = ui.Color.getAlphaFromOpacity(_opacity);
if (didNeedCompositing != alwaysNeedsCompositing)
markNeedsCompositingBitsUpdate();
markNeedsPaint();
//if (wasVisible != (_alpha != 0) && !alwaysIncludeSemantics)
// markNeedsSemanticsUpdate();
markNeedsPaint();
}
}
float _opacity;

return;
}
D.assert(needsCompositing);
var opacity = context.pushOpacity(
layer = context.pushOpacity(
layer = opacity;
/*public override void visitChildrenForSemantics(RenderObject visitor) {
visitor = (RenderObjectVisitor)visitor;
if (child != null && (_alpha != 0 || alwaysIncludeSemantics))
visitor(child);
}*/
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new FloatProperty("opacity", opacity));

RenderSliver sliver = null,
bool ignoring = true,
bool? ignoringSemantics = null
):base(child:sliver){
child = sliver;
D.assert(ignoring != null);
_ignoring = ignoring;
) : base(child:sliver){
_ignoring = ignoring;
}

D.assert(value != null);
//if (_ignoringSemantics == null || !_ignoringSemantics)
// markNeedsSemanticsUpdate();
}
}
bool _ignoring;

crossAxisPosition: crossAxisPosition
);
}
/*public override void visitChildrenForSemantics(RenderObjectVisitor visitor) {
if (child != null && !_effectiveIgnoringSemantics)
visitor(child);
}*/
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<bool>("ignoring", ignoring));

public RenderSliverOffstage(
RenderSliver sliver = null,
bool offstage = true): base(child:sliver) {
D.assert(offstage != null);
_offstage = offstage;
child = sliver;
bool offstage = true): base(child:sliver) {
_offstage = offstage;
D.assert(value != null);
if (value == _offstage)
return;
_offstage = value;

return;
context.paintChild(child, offset);
}
/*public override void visitChildrenForSemantics(RenderObjectVisitor visitor) {
if (offstage)
return;
base.visitChildrenForSemantics(visitor);
}*/
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<bool>("offstage", offstage));

正在加载...
取消
保存