Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: sky/framework/fn.dart

Issue 1016093002: Begin work on the PopupMenu entrance animation (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/framework/components/popup_menu_item.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library fn; 5 library fn;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:sky' as sky; 9 import 'dart:sky' as sky;
10 import 'reflect.dart' as reflect; 10 import 'reflect.dart' as reflect;
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 672
673 var vdom = _vdom; 673 var vdom = _vdom;
674 while (vdom is Component) { 674 while (vdom is Component) {
675 vdom = vdom._vdom; 675 vdom = vdom._vdom;
676 } 676 }
677 677
678 assert(vdom._root != null); 678 assert(vdom._root != null);
679 _syncInternal(); 679 _syncInternal();
680 } 680 }
681 681
682 void scheduleBuild() {
683 setState(() {});
684 }
685
682 void setState(Function fn()) { 686 void setState(Function fn()) {
683 assert(_vdom != null || _defunct); // cannot setState before mounting. 687 assert(_vdom != null || _defunct); // cannot setState before mounting.
684 _stateful = true; 688 _stateful = true;
685 fn(); 689 fn();
686 if (!_defunct && _currentlyRendering != this) { 690 if (!_defunct && _currentlyRendering != this) {
687 _dirty = true; 691 _dirty = true;
688 _scheduleComponentForRender(this); 692 _scheduleComponentForRender(this);
689 } 693 }
690 } 694 }
691 695
(...skipping 11 matching lines...) Expand all
703 707
704 _mount(null, _host, null); 708 _mount(null, _host, null);
705 assert(_root is sky.Node); 709 assert(_root is sky.Node);
706 710
707 sw.stop(); 711 sw.stop();
708 if (_shouldLogRenderDuration) 712 if (_shouldLogRenderDuration)
709 print("Initial build: ${sw.elapsedMicroseconds} microseconds"); 713 print("Initial build: ${sw.elapsedMicroseconds} microseconds");
710 }); 714 });
711 } 715 }
712 } 716 }
OLDNEW
« no previous file with comments | « sky/framework/components/popup_menu_item.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698