提交 2e884389 编写于 作者: A Adam Barth

Merge pull request #515 from abarth/remove_mimic_flicker

Remove the flicker from MimicOverlay
......@@ -116,7 +116,7 @@ abstract class GlobalKey extends Key {
}
static void _notifyListeners() {
assert(!_inRenderDirtyComponents);
assert(!_inBuildDirtyComponents);
assert(!Widget._notifyingMountStatus);
assert(_debugDuplicates.isEmpty);
_notifyingListeners = true;
......@@ -161,7 +161,7 @@ abstract class Widget {
}
// you should not build the UI tree ahead of time, build it only during build()
bool _isConstructedDuringBuild() => this is AbstractWidgetRoot || this is App || _inRenderDirtyComponents || _inLayoutCallbackBuilder > 0;
bool _isConstructedDuringBuild() => this is AbstractWidgetRoot || this is App || _inBuildDirtyComponents || _inLayoutCallbackBuilder > 0;
Key _key;
......@@ -755,7 +755,7 @@ abstract class StatefulComponent extends Component {
Set<Component> _dirtyComponents = new Set<Component>();
bool _buildScheduled = false;
bool _inRenderDirtyComponents = false;
bool _inBuildDirtyComponents = false;
int _inLayoutCallbackBuilder = 0;
class LayoutCallbackBuilderHandle { bool _active = true; }
......@@ -793,7 +793,8 @@ void _buildDirtyComponents() {
if (_shouldLogRenderDuration)
sw = new Stopwatch()..start();
_inRenderDirtyComponents = true;
while (!_dirtyComponents.isEmpty) {
_inBuildDirtyComponents = true;
try {
sky.tracing.begin('Component.flushBuild');
List<Component> sortedDirtyComponents = new List<Component>();
......@@ -813,11 +814,12 @@ void _buildDirtyComponents() {
}
} finally {
_buildScheduled = false;
_inRenderDirtyComponents = false;
_inBuildDirtyComponents = false;
sky.tracing.end('Component.flushBuild');
}
Widget._notifyMountStatusChanged();
}
if (_shouldLogRenderDuration) {
sw.stop();
......
......@@ -70,8 +70,9 @@ class MimicOverlay extends AnimatedComponent {
setState(() {
// TODO(abarth): We need to convert global bounds into local coordinates.
_mimicBounds.begin = globalToLocal(globalBounds.topLeft) & globalBounds.size;
_expandPerformance.forward();
_mimicBounds.value = _mimicBounds.begin;
});
_expandPerformance.forward();
}
Widget build() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册