From d89214f5edacfc880a3456f4b612780ece6c8a19 Mon Sep 17 00:00:00 2001 From: Hixie Date: Tue, 16 Jun 2015 09:28:59 -0700 Subject: [PATCH] Create an example app that demonstrates interactive coordination of an fn tree and a raw RenderObject tree. Sector changes: - implement the intrinsic sizing box API on RenderBoxToRenderSectorAdapter - remove some debug print statements - fix getIntrinsicDimensions() on RenderSolidColor to return true values - factor out the default demo RenderObject changes: - BoxConstraints.isInfinite() now returns true only if both dimensions are infinite fn changes: - implement UINodeToRenderBoxAdapter - rename RenderObjectToUINodeAdapter to RenderBoxToUINodeAdapter Tests: - add a test for sector layout - make TestRenderView support being run without the unit test framework R=abarth@chromium.org Review URL: https://codereview.chromium.org/1175423007. --- .../tests/raw/sector_layout-expected.txt | 27 +++++++++++++++++++ .../src/flutter/tests/raw/sector_layout.dart | 12 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 engine/src/flutter/tests/raw/sector_layout-expected.txt create mode 100644 engine/src/flutter/tests/raw/sector_layout.dart diff --git a/engine/src/flutter/tests/raw/sector_layout-expected.txt b/engine/src/flutter/tests/raw/sector_layout-expected.txt new file mode 100644 index 0000000000..6a9290c5f8 --- /dev/null +++ b/engine/src/flutter/tests/raw/sector_layout-expected.txt @@ -0,0 +1,27 @@ +CONSOLE: TestRenderView enabled +CONSOLE: +PAINT FOR FRAME #1 ---------------------------------------------- +1 | TestDisplayList() constructor: 800.0 x 600.0 +1 | paintChild RenderBoxToRenderSectorAdapter at Point(0.0, 0.0) +1 | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | paintChild RenderSectorRing at Point(400.0, 300.0) +1 | | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | | paintChild RenderSolidColor at Point(0.0, 0.0) +1 | | | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | | | drawPath(Instance of 'Path', Paint(Color(0xff00ffff))) +1 | | | paintChild RenderSolidColor at Point(0.0, 0.0) +1 | | | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | | | drawPath(Instance of 'Path', Paint(Color(0xff0000ff))) +1 | | | paintChild RenderSectorSlice at Point(0.0, 0.0) +1 | | | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | | | paintChild RenderSolidColor at Point(0.0, 0.0) +1 | | | | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | | | | drawPath(Instance of 'Path', Paint(Color(0xffffff00))) +1 | | | | paintChild RenderSolidColor at Point(0.0, 0.0) +1 | | | | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | | | | drawPath(Instance of 'Path', Paint(Color(0xffff9000))) +1 | | | | paintChild RenderSolidColor at Point(0.0, 0.0) +1 | | | | | TestDisplayList() constructor: 800.0 x 600.0 +1 | | | | | drawPath(Instance of 'Path', Paint(Color(0xff00ff00))) +------------------------------------------------------------------------ +PAINTED 1 FRAMES diff --git a/engine/src/flutter/tests/raw/sector_layout.dart b/engine/src/flutter/tests/raw/sector_layout.dart new file mode 100644 index 0000000000..e3abc94e4a --- /dev/null +++ b/engine/src/flutter/tests/raw/sector_layout.dart @@ -0,0 +1,12 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import '../../examples/rendering/sector_layout.dart'; +import '../resources/display_list.dart'; + +void main() { + new TestRenderView(buildSectorExample()).endTest(); +}