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

Unified Diff: sky/examples/widgets/spinning_mixed.dart

Issue 1186653003: Make it easier to debug examples/widgets/container.dart, since it is currently showing a crazy clip… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/framework/widgets/raised_button.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/widgets/spinning_mixed.dart
diff --git a/sky/examples/widgets/spinning_mixed.dart b/sky/examples/widgets/spinning_mixed.dart
index b42a5bf366b691945443760fc8ebfea6fd013109..324d0429726d631f8f1f2e194ea0da25bf87f6f8 100644
--- a/sky/examples/widgets/spinning_mixed.dart
+++ b/sky/examples/widgets/spinning_mixed.dart
@@ -13,6 +13,7 @@ import 'package:sky/framework/widgets/wrappers.dart';
import 'package:vector_math/vector_math.dart';
import '../lib/solid_color_box.dart';
+import '../../tests/resources/display_list.dart';
// Solid colour, RenderObject version
void addFlexChildSolidColor(RenderFlex parent, sky.Color backgroundColor, { int flex: 0 }) {
@@ -59,6 +60,8 @@ UINode builder() {
double timeBase;
RenderTransform transformBox;
+final TestRenderView tester = new TestRenderView();
+
void rotate(double timeStamp) {
if (timeBase == null)
timeBase = timeStamp;
@@ -68,9 +71,21 @@ void rotate(double timeStamp) {
transformBox.translate(transformBox.size.width / 2.0, transformBox.size.height / 2.0);
transformBox.rotateZ(delta);
transformBox.translate(-transformBox.size.width / 2.0, -transformBox.size.height / 2.0);
+
+ // tester.checkFrame();
}
+final bool debugDisplayList = false; // set this to true to use the test rendering logic
+
void main() {
+ // Because we're going to use UINodes, we want to initialise its
+ // AppView, not use the default one. We don't really need to do
+ // this, because RenderObjectToUINodeAdapter does it for us, but
+ // it's good practice in case we happen to not have a
+ // RenderObjectToUINodeAdapter in our tree at startup, or in case we
+ // want a renderViewOverride.
+ UINodeAppView.initUINodeAppView(renderViewOverride: debugDisplayList ? tester : null);
+
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical);
RenderProxyBox proxy = new RenderProxyBox();
@@ -83,13 +98,6 @@ void main() {
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child: transformBox);
- // Because we're going to use UINodes, we want to initialise its
- // AppView, not use the default one. We don't really need to do
- // this, because RenderObjectToUINodeAdapter does it for us, but
- // it's good practice in case we happen to not have a
- // RenderObjectToUINodeAdapter in our tree at startup.
- UINodeAppView.initUINodeAppView();
UINodeAppView.appView.root = root;
-
addPersistentFrameCallback(rotate);
}
« no previous file with comments | « no previous file | sky/sdk/lib/framework/widgets/raised_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698