61 Commits

Author SHA1 Message Date
Hixie
ab01c7bf73 Less tree walking for compositing bits updates.
Use the same technique for updating compositing bits as layout and
painting. This avoids walking the entire rendering tree when all you
need to update is a small subtree.
2015-12-17 13:55:53 -08:00
Hixie
b5e7e1ce7a Close some sentences. (rendering dartdocs) 2015-12-16 13:30:33 -08:00
Ian Hickson
ade93651ac Refactor bindings. 2015-12-13 23:34:41 -08:00
Ian Hickson
d1364643db applyPaintTransform() improvements
Previously, applyPaintTransform() had to know how it was positioned in
its parent, even though that's really the parent's responsibility.

Now, applyPaintTransform() is given a child and applies the transform
that it would give the child during paint.

This makes it possible for applyPaintTransform() to work across
coordinate system boundaries (e.g. box to sector, or view to box --
previously, view to box only worked because we explicitly skipped that
step -- since view doesn't actually apply a transform, it doesn't
really matter).
2015-12-10 22:22:00 -08:00
Hixie
3c4442cecb Remove debugDoingPaint setter.
debugDoingPaint is an internal flag and really shouldn't be globally settable.
2015-12-10 10:42:35 -08:00
Ian Hickson
1a049c14e5 Catch un-normalized BoxConstraints
Add BoxConstraints.isNormalized feature.

Use this feature in asserts in all the intrinsic dimension methods, in
various relevant BoxConstraints methods, and in layout().

Wrap the _DebugSize logic in BoxConstraints.constrain() in an assert
block to avoid a branch in release mode.

Remove the logic in BoxConstraints.isSatisfiedBy() that dealt with
non-normalized values.

Add BoxConstraints.normalize().

Make RenderCustomOneChildLayoutBox.performLayout() only set
parentUsesSize on the child if the constraints aren't tight.
2015-12-08 21:35:39 -08:00
Collin Jackson
d05c564cef Fix hero transition when using dynamic routes 2015-12-08 13:08:16 -08:00
Ian Hickson
f162555648 PointerInput refactor
Instead of PointerInputEvent having a "type" field, we now have a
different class for each pointer type.

This has ripple effects throughout the system.

I also did code cleanup in affected files while I was there.
2015-12-04 22:42:38 -08:00
Adam Barth
abf0359569 Remove PaintingCanvas
We can just use Canvas now.  The two are the same thing.
2015-12-04 20:26:08 -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
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
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
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
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
Ian Hickson
1aa2751ba8 Trivial whitespace fixes. 2015-11-12 22:10:16 -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
Hixie
6d389722a5 Get more debug info into the rendering layer
- change how we expose settings at the RenderObject layer so that it's
  easier to maintain.
- expose the Widget owner chain in the RenderObject layer debug output
- add debug info to RenderOpacity, RenderIgnorePointer, RenderListener
- make the output for text nodes prettier
2015-11-04 12:37:39 -08:00
Adam Barth
c44dd17d47 Always reset parentData when dropping children
Previously, we'd leave the old values in the parent data if the types matches,
but not all render objects would reset these values during layout. For example,
RenderProxyBox doesn't set the position field because it doesn't read the
position field. However, leaving the old data there violates the invariants of
the box protocol and can cause trouble (e.g., localToGlobal giving the wrong
result).

Fixes #1939
2015-11-04 08:02:05 -08:00
Ian Hickson
76381b8f42 debugPaintPointersEnabled mode
Implements a mode that highlights RenderBoxes while events are being
routed through them.

Also, moves the size painting to after paint, so that opaque boxes
don't obscure the debugging lines.
2015-10-25 18:30:52 -07:00
Hixie
f67bd7d745 Fix size magic
The magic for updating DebugSize's knowledge about whether it was
allowed to be used by the parent or not previously failed to correctly
deal with sizedByParent.
2015-10-22 15:41:24 -07:00
Adam Barth
9baf8eb372 Remove ColorFilter widget
This widget is slow and not commonly used. The original reason we added it was
to colorize images, but now that feature is built into the image and background
image widgets.

Fixes #1646
2015-10-19 12:39:22 -07:00
Adam Barth
2aa79d5694 Remove old setFoo functions on Paint
We now just use Dart properties, which is more idiomatic.
2015-10-19 12:21:34 -07:00
Hixie
d0d84e1666 Sundry debugging aids and fixes
(These are all the debugging-related fixes and trivial typo fixes that I
extracted out of my heroes branch.)

Fix rendering.dart import order.

Introduce a debugLabel for Performances so that when you create a
performance, you can tag it so that if later you print it out, you can
figure out which performance it is.

Allow the progress of a PerformanceView to be determined (but not set).

Allow subclasses of PerformanceView that are constants to be created by
defining a constant constructor for PerformanceView.

Introduce a debugPrint() method that throttles its output. This is a
test to see if it resolves the problems people have been having with
debugDumpRenderTree() et al having their output corrupted on Android. It
turns out (according to some things I read On The Internets) that
Android only has a 64KB kernel buffer for its logs and and if you output
to it too fast, it'll drop data on the floor. If this does in fact
reliably resolve this problem, we should probably move the fix over to
C++ land (where "print" is implemented) so that any use of print is
handled (avoiding the interleaving problem we have now if you use both
debugPrint() and print()).

Fix a bug with the debugging code for "size". In the specific case of a
RenderBox having a parent that doesn't set parentUsesSize, then later
the parent setting parentUsesSize but the child having its layout
short-circuited (e.g. because the constraints didn't change), we didn't
update the _DebugSize object to know that now it's ok that the size be
used by the parent, and we'd assert.

Also, allow a _DebugSize to be used to set the size of yourself.
Previously you could only set your size from a regular Size or from your
child's _DebugSize.

Add more debugging information to various Widgets where it might be
helpful.

Make GlobalKey's toString() include the runtimeType so that when
subclassing it the new class doesn't claim to be a GlobalKey instance.

Include the Widget's key in the Element's description since we don't
include it in the detailed description normally (it's in the name part).

Fix a test that was returning null from a route.
2015-10-16 16:41:56 -07:00
Adam Barth
7b31d9b2e4 Rationalize exports a bit more
The goal is to follow the guidelines in
https://github.com/flutter/engine/blob/master/sky/specs/style-guide.md#packages

Fixes #1638
2015-10-16 00:09:00 -07:00
Hixie
1f40d96fbf Improve debugging output
Teach dumpRenderTree() to draw actual trees.
Make the TextStyle output terser so it doesn't overflow the output.
Make debugDumpApp() say what mode we're in (checked vs release).
Hide lifecycle state from release mode dumps (since it's checked-only state).
2015-10-15 11:23:23 -07:00
krisgiesing
2032d3e41f Merge pull request #1605 from krisgiesing/events-merge
Add dart-layer input event abstraction
2015-10-14 13:36:07 -07:00
Hans Muller
921d432092 Added Painter, ScrollingListPainter, MaterialScrollbarPainter
Enabled displaying a scrollbar in ScrollingLists. The scrollbar is painted as an "overlay", i.e. it's painted on top of the scrolling list's visible children.

Added an abstract Painter base class that encapsulates a paint method and the renderer that it's attached to. RenderBlockViewport and HomogenousViewport now support an overlayPainter property. If specified, RenderBlockViewport attaches itself to the overlayPainter when it's attached to the rendering tree. RenderBlockViewport now calls overlayPainter.paint() after it has painted its children.

Added an abstract ScrollingListPainter class that exposes ScrollingList's state which might be needed for painting. Like its scroll direction and scrollOffset. The ScrollingListPainter is notified when a scroll starts and ends.

Defined a Material-specific ScrollingListPainter that renders a scrollbar. The scrollbar thumb is faded in/out when the scroll starts/ends.

Added onScrollStart and onScrollEnd listeners to Scrollable.
2015-10-14 07:59:41 -07:00
Kris Giesing
ec205ac5c5 Add dart-layer input event abstraction 2015-10-13 15:16:04 -07:00
Hixie
f2cc43a483 Lots of trivial warning fixes
Add type annotations in many places.
Fix some identifiers to have more lint-satisfying names.
Make all operator==s consistent in style.
Reorder some functions for consistency.
Make ParentData no longer dynamic, and fix all the code around that.
2015-10-12 16:31:20 -07:00
Adam Barth
ecce1eb389 Import dart:ui as ui (instead of as sky) 2015-10-09 20:55:54 -07:00
Adam Barth
65eba90843 Rename package:sky to package:flutter 2015-10-09 20:44:52 -07:00
Adam Barth
5b37f8750d Rename dart:sky to dart:ui 2015-10-09 19:27:13 -07:00
Hixie
dfc7f00a88 Remove workarounds that avoided 'super' in mixins
Dart supports this properly now.
2015-10-09 11:24:50 -07:00
Hixie
37bda25196 Relative paths in internal flutter libraries
Now that you import a top-level file for each layer of the Flutter
framework, within the framework we can use relative paths without being
worried about the copy/pasta problem we used to have.
2015-10-09 09:56:40 -07:00
Hans Muller
09d26302cb IndexedStack
Added horizontal and vertical alignment properties to Stack so that the origin of non-positioned children can be specified. Currently all of the non-positioned children just end up with their top-left at 0,0. Now, for example, you can center the children by specifying verticalAlignment: 0.5, horizontalAlignment: 0.5.

Added IndexedStack which only paints the stack child specified by the index property. Since it's a Stack, it's as big as the biggest non-positioned child. This component will be essential for building mobile drop down menus.

Added a (likely temporary) example that demonstrates IndexedStack.
2015-10-08 10:21:24 -07:00
Chinmay Garde
73dce01e87 Allow updating the rasterizer tracing threshold from Dart 2015-10-07 11:22:51 -07:00
Chinmay Garde
850df83eeb Merge pull request #1462 from chinmaygarde/master
Allow displaying compositor statistics via a widget
2015-10-05 10:31:38 -07:00
Chinmay Garde
3e916982c4 Allow displaying compositor statistics via a widget
Example:
  import 'package:sky/widgets.dart';
  void main() => runApp(new Center(child:
      new StatisticsOverlay.allEnabled()));
2015-10-05 10:30:19 -07:00
Hans Muller
4de0a99b3f ShaderMask
The ShaderMask widget enables rendering its child with an alpha channel defined by a Shader. For example if the Shader was a linear gradient in alpha then the component behind the ShaderMask's child would appear wherever the gradient's alpha value was not fully opaque.

The card_collection.dart example demonstrates this. Select the "Let the sun shine" checkbox in the app's drawer.
2015-10-02 17:08:00 -07:00
Adam Barth
7662a30f85 Moves from vector_math to vector_math_64
* Moves from vector_math to vector_math_64
* Adds support for Float64List in Dart bindings
2015-10-01 14:46:13 -07:00
Adam Barth
a74d02dadf Rename Sky to Flutter in a few more places 2015-09-26 12:46:03 -07:00
Adam Barth
051354ae1d Remove EventDisposition
All the use cases for EventDisposition are now addressed by the gesture
detection system.
2015-09-21 16:45:09 -07:00
Hixie
01778c4895 Provide hooks for when exceptions are thrown.
This might be helpful for #1219.

Also, remove inDebugMode since it's redundant with just using asserts,
which compile entirely out in release mode.
2015-09-18 10:23:58 -07:00