168 Commits

Author SHA1 Message Date
Adam Barth
5b1e7c0a37 Rename TransferMode to BlendMode (#7357)
Skia calls this BlendMode now and that's a better name.

Fixes #7200
2017-01-06 00:07:47 -08:00
Ian Hickson
b0e8520ae6 Make LayoutCallback generic and other minor changes (#7367)
LayoutCallback passes constraints to the callback, but the constraints
object has a different type for different subclasses. This lets you
call invokeLayoutCallback() with a specific type to verify that
everything is working as expected.

Other changes:

Slightly improve the error reporting in RenderObject.

Allow toStringShallow on RenderObject to have its separator configured.
2017-01-05 22:12:08 -08:00
Alexandre Ardhuin
9eaaa91df7 use isEmpty and isNotEmpty (#7207) 2016-12-09 15:37:42 -08:00
Ian Hickson
9c1a24fa72 Reexport meta from foundation. (#6938) 2016-11-18 21:22:32 -08:00
Ian Hickson
15fb5c4ca6 Clean up some RenderObject layer stuff (#6883)
More idiomatic use of constraints in performResize.

Trivial fixes to comments.

Make ProxyBox not use BoxParentData since it ignores the field.

Make applyPaintTransform more helpful if you use a different ParentData
subclass than RenderBox expects.

Make debugAssertIsValid actually fulfill its contract in RenderObject as
documented.

Add a childBefore for symmetry (we already had childAfter).

Fix the way we dump the child list when there's no children in a
multichild render object.

More asserts in the rendering test library.
2016-11-15 17:55:51 -08:00
Ian Hickson
18362ec61d Improve the debugDumpFoo output (#6882) 2016-11-15 16:53:03 -08:00
Ian Hickson
ece851d5cd Minor improvements to the render tree dump. (#6831)
Also fixes https://github.com/flutter/flutter/issues/6510
2016-11-14 11:18:46 -08:00
Ian Hickson
106ff33255 Detailed RenderBox and RenderObject docs (#6745) 2016-11-08 15:16:33 -08:00
Andrew Wilson
01ca34cd0c Add profiling for building and painting. (#6652) 2016-11-07 13:46:42 -08:00
Ian Hickson
2d9d4c2d3a Document typedefs better. (#6671) 2016-11-02 21:14:59 -07:00
Adam Barth
c77798a384 PaintingContext should say when alwaysNeedsCompositing is needed (#6338)
Also, update the docs to point to the correct property.

Fixes #6224
2016-10-17 12:35:19 -07:00
Adam Barth
3b56f12219 Fix composited transform bounds calculations (#6302)
We weren't computing the bounds for composited transforms correctly. We
need to conjugate the transform by the offset in order to get the
correct paint bounds for the composited layer. We now also use the same
math in the non-composited case for consistency.

Also, don't scale the z-coordinate in RenderFittedBox.

Fixes #6293
2016-10-13 15:00:34 -07:00
Adam Barth
5af922edb0 Use antialiased clips (#6298)
The Skia team tells us that these go faster.
2016-10-12 18:27:40 -07:00
Adam Barth
f5b9d388cd Switch to the new semantics backend (#6259)
This match switches the framework to use the semantics backend in `dart:ui`
rather than the Mojo backend.
2016-10-11 10:51:41 -07:00
Adam Barth
2c21d795a4 Deploy @checked (#6244)
This patch adds `@checked` everywhere is needed to remove the
`strong_mode_invalid_method_override` strong mode error.
2016-10-07 11:27:54 -07:00
Adam Barth
41a91a7a68 Use "SemanticsFoo" consistently instead of "SemanticFoo" (#6233)
This change might make our grammar less perfect, but it will increase our
sanity.
2016-10-06 10:52:46 -07:00
Adam Barth
8071a82d51 Isolate Mozart dependencies (#6194)
This patch removes the Mozart dependencies from object.dart and
layer.dart, which will make it easier for us to move the Mozart
dependencies purely into the Fuchsia tree.
2016-10-03 22:46:12 -07:00
James Robinson
a95c9fdb58 Isolate imports of generated Dart code from generated path (#5960)
This rewrites imports of various mojom.dart files from the Flutter
engine repo to instead import normal-looking dart files from the
(new) flutter_services package. This package handles exporting the
correct symbols from generated code wherever that may live.

Includes an engine roll to 3551e7a48e2e336777b15c7637af92fd7605b6c5
which contains the new flutter_services package.
2016-09-21 14:00:29 -07:00
Ian Hickson
4f0eff31bc Fix crash when a RenderObject tree is rooted in a non-RenderObject environment (#5933) 2016-09-20 14:14:05 -07:00
Ian Hickson
5c4c1b8d65 Cleaning up minor issues (#5779)
I did a pass through some of the code cleaning minor things up.
2016-09-09 14:25:41 -07:00
Ian Hickson
5bc8888e7d Make tests more realistic (#5762)
Previously, pumpWidget() would do a partial pump (it didn't trigger
Ticker callbacks or post-frame callbacks), and pump() would do a full
pump. This patch brings them closer together. It also makes runApp run a
full actual frame, rather than skipping the transient callback part of
the frame logic. Having "half-frames" in the system was confusing and
could lead to bugs where code expecting to run before the next layout
pass didn't because a "half-frame" ran first.

Also, make Tickers start ticking in the frame that they were started in,
if they were started during a frame. This means we no longer spin a
frame for t=0, we jump straight to the first actual frame.

Other changes in this patch:

* rename WidgetsBinding._runApp to WidgetsBinding.attachRootWidget, so
  that tests can use it to more accurately mock out runApp.

* allow loadStructuredData to return synchronously.

* make handleBeginFrame handle not being given a time stamp.

* make DataPipeImageProvider.loadAsync protected (rather than private),
  and document it. There wasn't really a reason for it to be private.

* fix ImageConfiguration.toString.

* introduce debugPrintBuildScope and debugPrintScheduleBuildForStacks,
  which can help debug problems with widgets getting marked as dirty but
  not cleaned.

* make debugPrintRebuildDirtyWidgets say "Building" the first time and
  "Rebuilding" the second, to make it clearer when a widget is first
  created. This makes debugging widget lifecycle issues much easier.

* make debugDumpApp more resilient.

* debugPrintStack now takes a label that is printed before the stack.

* improve the banner shown for debugPrintBeginFrameBanner.

* various and sundry documentation fixes
2016-09-08 13:54:21 -07:00
Ian Hickson
663596bc54 Handle GlobalKey reparenting inside LayoutBuilder (#5673) 2016-09-01 11:54:42 -07:00
Ian Hickson
ea6bf4706a Fix the losing of state when pushing opaque routes (#5624)
Fixes https://github.com/flutter/flutter/issues/5283

Other changes in this patch:

Rename OffStage to Offstage.
Fixes https://github.com/flutter/flutter/issues/5378

Add a lot of docs.

Some minor punctuation and whitespace fixes.
2016-08-29 11:28:37 -07:00
Ian Hickson
43d0eeb8e1 Update the docs for hitTest() (#5520) 2016-08-29 11:25:39 -07:00
Adam Barth
39e759212f Improve compositing strategy for Shrine (#5014)
This patch includes a number of improvements:

 * Material page routes now put a repaint boundary inside their transition so
   they don't repaint during the transition.
 * Heroes that are on a quest now get a repaint boundary so we repaint them
   individually.
 * I've hoisted the transparent material for the product items up in the widget
   tree, which doesn't affect performance but makes the ink splashes reach the
   edge of the product cards.
 * I've changed the repaint rainbow visualization to make it easier to see
   what's going on.
2016-07-22 14:09:48 -07:00
Adam Barth
1a292ff66a Hint that painting shadows are complex (#5000)
Previously, we considered them one operation in the compositor, which didn't
trigger caching. Now we have a way to explicitly hint that the compositor
should cache a layer.
2016-07-22 13:42:16 -07:00
Adam Barth
04dca44f27 Be consistent about method versus function (#4828)
Fixes #4761
2016-07-06 18:45:42 -07:00
Adam Barth
3cbb20d176 Just use SemanticAnnotator instead of Iterable<SemanticAnnotator> (#4813) 2016-07-03 21:16:21 -07:00
Adam Barth
839def55ba Teach the system to shutdown semantics (#4811)
We now stop updating semantics when there are no remaining clients.
2016-07-01 17:57:10 -07:00
Adam Barth
5ed8f1a1fd Add semantics for Sliders (#4808)
Also, make SemanticsOwner into a real class and use it instead of a static in
several places.
2016-07-01 13:38:24 -07:00
Adam Barth
8c535ad7d7 Update use of @protected (#4805)
Now that protected can be accessed from inside the same library, we can
use protected in a number of new places and we can remove some
trampolines we were using to work around its previous semantics.
2016-07-01 10:06:40 -07:00
pq
543f705adb Cleanup empty statements.
The new `empty_statements` lint (in the next DEV roll), flags these empty statements.  Harmless, except the one in `basic.dart` that fixes a real-life bug. :)
2016-06-28 13:42:22 -07:00
Ali Ghassemi
6befb6308a Updating Reference: FlutterBinding -> RendererBinding (#4602) 2016-06-16 16:12:58 -07:00
Adam Barth
4e3e40a174 Rename relayoutSubtreeRoot -> relayoutBoundary (#4483)
Fixes #4425
2016-06-09 08:44:48 -07:00
Ian Hickson
007d0a2f39 Cache intrinsic dimensions (#4446)
Also, make sure that the parent is notified when they change.

Fixes #2298
2016-06-07 22:07:12 -07:00
Adam Barth
d9916bbb33 Complete the dartdoc for servics.dart (#4383)
Also, add more dartdoc to widgets.dart.
2016-06-05 23:58:38 -07:00
Ian Hickson
0618da7ca2 PaginatedDataTable (part 1) (#4306)
This introduces the key parts of a paginated data table, not including
the built-in pagination features.

* Provide more data for the data table demo, so there's data to page.

* Introduce a ChangeNotifier class which abstracts out
  addListener/removeListener/notifyListeners. We might be able to use
  this to simplify existing classes as well, though this patch doesn't
  do that.

* Introduce DataTableSource, a delegate for getting data for data
  tables. This will also be used by ScrollingDataTable in due course.

* Introduce PaginatedDataTable, a widget that wraps DataTable and only
  shows N rows at a time, fed by a DataTableSource.
2016-06-01 16:13:40 -07:00
Adam Barth
020b068896 Use protected and mustCallSuper in more places (#4291) 2016-06-01 08:27:19 -07:00
Adam Barth
887e339641 Start using protected annotation (#4288)
There are many more places we can use this annotation. This patch starts out
small to test the waters.
2016-05-31 17:41:34 -07:00
Adam Barth
7cf4c694b1 Complete docs for RenderObject (#4266) 2016-05-29 22:31:27 -07:00
Adam Barth
76772608e2 Remove OverlayPainter mechanism (#4264)
We used to use this mechanism to paint scrollbars, but it's awkward. The
new approach to scrollbars is much cleaner. This mechanism has no other
clients, so we should remove it.
2016-05-29 16:37:29 -07:00
Adam Barth
6f3382aa57 Add more dartdoc to rendering.dart (#4232)
There are still many more left before rendering.dart is complete.
2016-05-27 08:59:04 -07:00
Adam Barth
6da0429375 Add more dartdoc to PaintingContext (#4229)
We now explain what coordinate system each argument is expected to be in.

Fixes #4205
2016-05-26 16:51:46 -07:00
Adam Barth
b1b6271683 Use "call" instead of "invoke" (#4177)
For consistency.

Fixes #4142
2016-05-24 17:53:04 -07:00
Adam Barth
8294b96f94 Complete dartdocs for painting.dart (#4003) 2016-05-18 09:01:03 -07:00
Ian Hickson
3252701753 Make it possible to run tests live on a device (#3936)
This makes it possible to substitute 'flutter run' for 'flutter test'
and actually watch a test run on a device.

For any test that depends on flutter_test:

1. Remove any import of 'package:test/test.dart'.

2. Replace `testWidgets('...', (WidgetTester tester) {`
      with `testWidgets('...', (WidgetTester tester) async {`

3. Add an "await" in front of calls to any of the following:
    * tap()
    * tapAt()
    * fling()
    * flingFrom()
    * scroll()
    * scrollAt()
    * pump()
    * pumpWidget()

4. Replace any calls to `tester.flushMicrotasks()` with calls to
   `await tester.idle()`.

There's a guarding API that you can use, if you have particularly
complicated tests, to get better error messages. Search for
TestAsyncUtils.
2016-05-16 12:53:13 -07:00
pq
e54196d7fc Turn on avoid_return_types_on_setters and cleanup annotated setters.
It's safe to remove the unneeded `void`s from setters since the blocking issues in the
`always_declare_return_types` lint have been fixed (https://github.com/dart-lang/linter/).  We can also safely flip the bit on  `avoid_return_types_on_setters`.
2016-05-12 11:45:30 -07:00
Ian Hickson
4b401a3e75 Track the worst frame in perf tests (#3642)
* Track the worst frame in perf tests

* Use backticks in "/// Returns `null` if"
2016-05-03 14:00:10 -07:00
Ian Hickson
b5a827bfa1 Clean up our timeline events. (#3504)
This adds in particular the ability to track the time at which the
framework boots up, and the time at which we are confident we have
completed the first useful frame.
2016-04-22 13:04:06 -07:00
Ian Hickson
e968d91ca4 Rename binding abstract classes (#3482)
The old names were getting silly and started stepping on valuable namespace.

The new names are consistent and clear.
2016-04-21 17:18:46 -07:00