OLD | NEW |
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 import 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
6 | 6 |
7 import '../base/scheduler.dart' as scheduler; | 7 import '../base/scheduler.dart' as scheduler; |
8 import '../base/hit_test.dart'; | 8 import '../base/hit_test.dart'; |
9 import 'box.dart'; | 9 import 'box.dart'; |
10 import 'object.dart'; | 10 import 'object.dart'; |
(...skipping 30 matching lines...) Expand all Loading... |
41 assert(_instance == this); | 41 assert(_instance == this); |
42 } | 42 } |
43 | 43 |
44 static SkyBinding _instance; // used to enforce that we're a singleton | 44 static SkyBinding _instance; // used to enforce that we're a singleton |
45 static SkyBinding get instance => _instance; | 45 static SkyBinding get instance => _instance; |
46 | 46 |
47 RenderView _renderView; | 47 RenderView _renderView; |
48 RenderView get renderView => _renderView; | 48 RenderView get renderView => _renderView; |
49 | 49 |
50 ViewConstraints _createConstraints() { | 50 ViewConstraints _createConstraints() { |
51 return new ViewConstraints(width: sky.view.width, height: sky.view.height); | 51 return new ViewConstraints(size: new Size(sky.view.width, sky.view.height)); |
52 } | 52 } |
53 void _handleMetricsChanged() { | 53 void _handleMetricsChanged() { |
54 _renderView.rootConstraints = _createConstraints(); | 54 _renderView.rootConstraints = _createConstraints(); |
55 } | 55 } |
56 | 56 |
57 Function onFrame; | 57 Function onFrame; |
58 RenderBox get root => _renderView.child; | 58 RenderBox get root => _renderView.child; |
59 void set root(RenderBox value) { | 59 void set root(RenderBox value) { |
60 _renderView.child = value; | 60 _renderView.child = value; |
61 } | 61 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 entry.target.handleEvent(event, entry); | 126 entry.target.handleEvent(event, entry); |
127 } | 127 } |
128 | 128 |
129 String toString() => 'Render Tree:\n${_renderView}'; | 129 String toString() => 'Render Tree:\n${_renderView}'; |
130 | 130 |
131 void debugDumpRenderTree() { | 131 void debugDumpRenderTree() { |
132 toString().split('\n').forEach(print); | 132 toString().split('\n').forEach(print); |
133 } | 133 } |
134 | 134 |
135 } | 135 } |
OLD | NEW |