194 Commits

Author SHA1 Message Date
Adam Barth
b83187d8f3 MultiChildLayoutDelegate should assert that all children have had layoutChild called exactly once
Fixes #692
Fixes #690
2015-12-04 12:31:58 -08:00
Adam Barth
eaab8fa18f Merge pull request #735 from abarth/custom_clip
Add custom clipping to ClipRect and ClipOval
2015-12-04 11:31:47 -08:00
Adam Barth
f66726609d Add custom clipping to ClipRect and ClipOval 2015-12-04 11:26:34 -08:00
Adam Barth
2a9de0aa97 Add the ability to custom paint foregrounds 2015-12-04 11:21:55 -08:00
Adam Barth
7e474f6d9c RenderFlex shouldn't assert when its out of space
Previously, we would assert with FlexJustifyContent.collapse if we ran out of
space. Now we do the same thing we do for the other types of justification,
which is to let the children's layout overflow.
2015-12-03 14:29:00 -08:00
Florian Loitsch
018bcbf2d9 Remove animation scheduler. 2015-12-01 20:36:52 -08:00
Ian Hickson
fbd612e662 Remove the assert when opening popup menus.
Some paint bounds are in fact empty, e.g. at the start of a growing
animation if there's also a fade, the initial 0x0 box will also be
opacity:0, and might get a dedicated layer and PaintingContext.
2015-12-01 01:52:25 -08:00
Adam Barth
c810b0501f PopupMenu shouldn't use CustomPaint
Align is now powerful enough to do all the work we need to do here.
2015-11-30 14:23:14 -08:00
Adam Barth
09cf84d9b6 Move RenderTogglable to material.dart
Fixes #219
2015-11-25 23:15:17 -08:00
Hixie
993a41a452 Fix minor typos and style nits. 2015-11-25 17:03:37 -08:00
Hixie
9c5c511517 Opacity was dropping stuff on the floor.
Turns out we passed the wrong bounds to the PaintingContext constructor.

Fix, and assert that we don't do that again.
2015-11-25 11:00:02 -08:00
Adam Barth
860547c1d4 Add support for system-level routing
Now you can supply a route argument to flutter start:

  $ flutter start --route /foo

which will start the app at /foo instead of /.
2015-11-24 16:13:20 -08:00
Adam Barth
a35344f439 Fix upload of composited scene with non-zero offsets
We weren't correctly offsetting the clips when uploading composited scenes. Now
we apply the proper offsets.
2015-11-23 15:44:41 -08:00
Ian Hickson
ebf032b82a Avoid using transforms when simple offsets will do. 2015-11-21 20:59:26 -08:00
Adam Barth
c1b076308d Elaborate HSVColor interface
Fixes #507
2015-11-20 12:14:58 -08:00
Adam Barth
efbea05eb6 Make stocks list scrolling 2x faster on the main thread
This patch improves the repaint strategy for HomogeneousViewport so that the
list itself and every entry in the list has a repaint boundary. That means that
we only record list items as they enter the view.
2015-11-20 10:25:34 -08:00
Adam Barth
72329cf422 Callback identity is too fragile for CustomPaint
Many of the widgets that use CustomPaint were spamming repaints because
CustomPaint repaints when the identity of the onPaint callback changes, which
it does every build for StatelessComponents.

This patch changes CustomPaint to use a CustomPainter, similar to the new
custom layout widgets. The CustomPainter has a `shouldRepaint` function along
with its `paint` function. This function gives clients explicit control over
when the custom paint object repaints.
2015-11-20 08:20:59 -08:00
Tony Gentilcore
6562c14948 Add a FractionalOffset alignment parameter to BackgroundImage 2015-11-19 22:28:28 -08:00
Adam Barth
8fa223ff19 Add a repaint rainbow to help debug repaint issues
The repaint raindbow tints each recording with a rotating set of colors so you
can see which pixels are repainting each frame.
2015-11-19 15:40:25 -08:00
Adam Barth
6bfcf9bf17 Merge pull request #503 from abarth/dump_layer_tree
Add debugDumpLayerTree to dump the layer tree
2015-11-19 15:10:02 -08:00
Adam Barth
dfbd8c6a8a Add debugDumpLayerTree to dump the layer tree
To help debugging issues with the layer tree.
2015-11-19 14:45:40 -08:00
Adam Barth
2232ee568a Re-enable support for debugPaintLayerBordersEnabled
We lost this feature at some point. This patch brings it back.
2015-11-19 13:51:17 -08:00
Adam Barth
d689362dc5 Some paint functions were using canvas.save/restore around children
This pattern breaks when using compositing because we need to lift those
operations into the compositing tree. This patch removes all the ones I could
find and adds an assert to help prevent more from getting introduced.

Fixes #191
2015-11-19 12:29:36 -08:00
Adam Barth
4fb5bcd863 Merge pull request #486 from abarth/painting_context
Refactor PaintingContext
2015-11-19 11:24:09 -08:00
Adam Barth
fc576814d5 Refactor PaintingContext
This patch simplifies PaintingContext with several goals:

1) We now call a callback instead of assuming the caller has a single child to
   paint. This change will let us handle render objects that wish to paint more
   than one child.
2) We now avoid creating lots of empty picture layers because we don't eagerly
   start recording pictures. Instead, we wait for the first caller to touch the
   canvas before creating the picture recorder.
3) We now are more consistent about which values have incorporated the painting
   offset.
2015-11-19 11:18:04 -08:00
Adam Barth
f97a125eee Merge pull request #487 from abarth/fix_menu_crash
Popup menu in Stocks throws exception
2015-11-19 01:53:01 -08:00
Adam Barth
2d82489406 Popup menu in Stocks throws exception
Previously, we were putting a ForcedLayer just below the overlay, but that
causes trouble for routes like the popup menu that want to position themselves
inside the overlay. Instead, I've moved the ForcedLayer down into ModalRoute.

Also, rename ForcedLayer to RepaintBoundary, which is more descriptive of what
this widget does.

Fixes #485
2015-11-19 01:40:56 -08:00
Adam Barth
d234c65df5 Add alignment to image widgets
We already had the code to implement this feature. We just needed to plumb it
out to the widget API.
2015-11-18 20:50:37 -08:00
Adam Barth
298f4a6eca Reduce record time in Stocks drawer animation by 55%
Now we use a ForcedLayer in the navigator overlay to cache the recording for
each entry in the overlay. This mechanism just caches the display list, not the
underlying pixels.

Also, remove the "dispose" notification in the Layer tree because it was
disposing layer too eagerly. We don't actually need this notification for
anything other than eagerly freeing some C++ memory.
2015-11-18 15:31:13 -08:00
Adam Barth
c964a1f1f8 Switch from ui.tracing to dart:Developer Timeline
This change will let us remove the tracing interface from dart:ui and also
makes these timeline events show up in Observatory.
2015-11-18 12:57:58 -08:00
Adam Barth
e69e6c3eb1 Rename StatisticsBox to RenderStatisticsBox
Fixes #441
2015-11-17 16:10:15 -08:00
Adam Barth
0585a44a14 Merge pull request #435 from abarth/event_duration
Convert PointerInputEvent to Duration for timestamp
2015-11-17 11:56:38 -08:00
Adam Barth
7b2004b0e9 Convert PointerInputEvent to Duration for timestamp
To make the units clear.
2015-11-17 11:07:50 -08:00
Adam Barth
c769d120c4 Add a Positioned constructor from a Rect
A common pattern is to use a Positioned with a Sized box to give both an offset
from the edge as well as a fixed size to the child. This patch rolls into into
the Stack layout algorithm for simplicity.

Fixes #250
2015-11-16 23:23:54 -08:00
Adam Barth
fc2e31b8aa You should be able to nest Scaffolds
Prior to this patch, MultiChildLayoutDelegate couldn't be re-entered because it
cleared _idToChild when unwinding its stack. Now we restore the previous value
of _idToChild when we unwind.
2015-11-13 15:35:39 -08:00
John McCutchan
d1e62a39e2 Update four callers of Message constructor to pass in required arguments 2015-11-13 14:39:06 -08:00
Adam Barth
69e511d207 Cursor is tiny when there's no text in an input
Now we use a zero-width space to force the engine to resolve the font and tell
us how large the text is likely to be once there's text in the widget.

Fixes #302
2015-11-13 10:17:23 -08:00
Ian Hickson
16471d92b9 Merge pull request #353 from Hixie/hit-testing-cleanup
Hit Testing Cleanup
2015-11-12 22:22:36 -08:00
Ian Hickson
876459e898 Merge pull request #354 from Hixie/more-debugging-for-listeners
More detailed debugging info for RenderPointerListener et al
2015-11-12 22:22:34 -08:00
Ian Hickson
1aa2751ba8 Trivial whitespace fixes. 2015-11-12 22:10:16 -08:00
Ian Hickson
c78e81f566 More detailed debugging info for RenderPointerListener et al
Elaborate on the debugging information exposed by
RenderPointerListener, Listener, and GestureDetector.
2015-11-12 21:22:38 -08:00
Ian Hickson
92b9d91af1 Hit Testing Cleanup
- Drop the unused BindingHitTestEntry class. (Well, it was
  constructed, but its member was never used, so it wasn't doing
  anything a boring old HitTestEntry couldn't already do.)

- Add toString()s to HitTestEntry and HitTestResult, to aid in
  debugging hit-test related code.
2015-11-12 20:57:08 -08:00
Adam Barth
679a423b3d Explicitly dispose heavy C++ objects
This patch calls dispose() explicitly on a number of heavy C++ objects so that
they can be eagerly finalized instead of waiting for GC.
2015-11-12 17:07:49 -08:00
Hixie
a0227cab15 flutter analyze command
Other changes in this patch:
- Make the 'flutter' tool say "Updating flutter tool..." when it calls
  pub get, to avoid confusion about what the pub get output is about.
- Make the bash flutter tool call pub get when the revision has
  changed. (This was already happening on Windows.)
- Fix a raft of bugs found by the analyzer.
- Fix some style nits in various bits of code that happened to be near
  things the analyzer noticed.
- Remove the logic in "flutter test" that would run "pub get", since
  upon further reflexion it was determined it didn't work anyway.
  We'll probably have to add better diagnostics here and say to run the
  updater script.
- Remove the native velocity tracker script, since it was testing code
  that has since been removed.

Notes on ignored warnings:
- We ignore warnings in any packages that are not in the Flutter repo or
  in the author's current directory.
- We ignore various irrelevant Strong Mode warnings. We still enable
  strong mode because even though it's not really relevant to our needs,
  it does (more or less accidentally) catch a few things that are
  helpful to us.
- We allow CONSTANTS_LIKE_THIS, since we get some of those from other
  platforms that we are copying for sanity and consistency.
- We allow one-member abstract classes since we have a number of them
  where it's perfectly reasonable.
- We unfortunately still ignore warnings in mojom.dart autogenerated
  files. We should really fix those but that's a separate patch.
- We verify the actual source file when we see the 'Name non-constant
  identifiers using lowerCamelCase.' lint, to allow one-letter variables
  that use capital letters (e.g. for physics expressions) and to allow
  multiple-underscore variable names.
- We ignore all errors on lines that contain the following magic
  incantation and a "#" character:
    // analyzer doesn't like constructor tear-offs
- For all remaining errors, if the line contains a comment of the form
    // analyzer says "..."
  ...then we ignore any errors that have that "..." string in them.
2015-11-12 12:23:29 -08:00
Adam Barth
64a645352c Give loose contraints to text inside input widget
The input widget scrolls, so it should give its text loose constraints.  That
way the text ends up being its intrinsic size even if put in a context with
tight constraints.

Fixes #298
2015-11-11 09:37:01 -08:00
Jason Simmons
480c5ae4eb Receive pointer events through PointerPackets 2015-11-10 16:06:24 -08:00
Adam Barth
1d7cd6b7c0 Make layout_bench.dart 19% faster
Previously we would walk from every node in layout to the root to mark the root
as needing paint. Now we leave dirty bits throughout the tree so that we can
cut off the walk as soon as we find a dirty node.
2015-11-10 12:11:16 -08:00
Florian Loitsch
c5427fb9a8 Minor doc fixes. 2015-11-09 18:57:10 -08:00
Adam Barth
eed20996ba Merge pull request #1999 from abarth/null_width_factor
Don't crash if no widthFactor is set in an unbounded context
2015-11-06 14:52:12 -08:00
Adam Barth
5ee721fe68 Merge pull request #1995 from abarth/startup_assert
We throw an exception if you tap the screen during load
2015-11-06 14:52:03 -08:00