36 Commits

Author SHA1 Message Date
Ian Hickson
9ff2e978cd Sliver Padding (#7628) 2017-01-25 15:00:57 -08:00
Ian Hickson
58348612a3 Factor out debugPaintPadding and test it (#7598)
I plan to use this to implement similar logic in SliverPadding.

To make this easier to test I extended the paints matcher to accept a
function that takes a canvas. While I was at it I also made it accept
a Finder, it'll go and find the render object for you.

Also added support for paints..path and fixed some grammar in the
error messages.

Also improved the docs for debugPaint*.
2017-01-24 16:08:27 -08:00
Hans Muller
440ddef69e Regression tests should verify that debug are not set (#7090) 2016-11-29 15:17:51 -08:00
Andrew Wilson
01ca34cd0c Add profiling for building and painting. (#6652) 2016-11-07 13:46:42 -08:00
Ian Hickson
998273a3bc Turn off debugPaintPointersEnabled (#5441)
I accidentally checked in this as true in my patch improving this feature.
2016-08-16 14:59:02 -07:00
Ian Hickson
3c51648fa6 Improve the debugPaintPointersEnabled feature. (#5435)
We have so many render objects going on these days that showing every
box that gets an event just makes the screen blue. This limits it down
to only the ones that are actually doing something with the events.
2016-08-16 14:52:07 -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
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
Devon Carew
c9010c91f6 fix analysis errors (#3677)
* fix analysis errors

* review comments; fix test

* re-add an export for debugPrint
2016-05-03 09:09:00 -07:00
Ian Hickson
261923e5c6 Refactor service extensions (#3397)
Bindings now have a debugRegisterServiceExtensions() method that is
invoked in debug mode (only). (Once we have a profile mode, there'll be
a registerProfileServiceExtensions() method that gets called in that
mode only to register extensions that apply then.)

The BindingBase class provides convenience methods for registering
service extensions that do the equivalent of:

```dart
void extension() { ... }
bool extension([bool enabled]) { ... }
double extension([double extension])  { ... }
Map<String, String> extension([Map<String, String> parameters]) { ... }
```

The BindingBase class also itself registers ext.flutter.reassemble,
which it has call a function on the binding called
reassembleApplication().

The Scheduler binding now exposes the preexisting
ext.flutter.timeDilation.

The Renderer binding now exposes the preexisting ext.flutter.debugPaint.

The Renderer binding hooks reassembleApplication to trigger the
rendering tree to be reprocessed (in particular, to fix up the
optimisation closures).

All the logic from rendering/debug.dart about service extensions is
replaced by the above.

I moved basic_types to foundation.

The FlutterWidgets binding hooks reassembleApplication to trigger the
widget tree to be entirely rebuilt.

Flutter Driver now uses ext.flutter.driver instead of
ext.flutter_driver, and is hooked using the same binding mechanism.
Eventually we'll probably move the logic into the Flutter library so
that you just get it without having to invoke a special method first.
2016-04-19 10:53:58 -07:00
Adam Barth
9157c16421 The intrinsic size checks were very slow
Now we run them once per render object.

Fixes #2487
2016-03-29 16:35:33 -07:00
Ian Hickson
826b13bde3 Include more details in the Red Box of Doom 2016-03-06 23:00:03 -08:00
Ian Hickson
047276a666 Random fixes to dartdocs, http lib, analyzer
This is a variety of trivial fixes that I collected while going through the dartdocs.
This does contain some non-comment changes.
2016-03-03 23:56:40 -08:00
Hixie
a95c866bf3 Expose more debugging tools in Stocks 2016-02-12 11:41:17 -08:00
Ian Hickson
a94999ba50 Clean up imports and exports.
Each layer is supposed to reexport the parts of the previous layer
that are part of its API.

- In painting.dart, export from dart:ui all the Canvas-related APIs
  that make sense to be used at higher levels, e.g. PaintingStyle.

- Delete painting/shadows.dart. It was dead code.

- In rendering/object.dart, export all of painting.dart.

- In widgets/basic.dart, export all of painting.dart and
  animation.dart. Some classes in animation/ are renamed to make this
  less disruptive and confusing to the namespace.

- Split out Stocks back into an import model rather than a part model,
  so that it's easier to manage its dependencies on a per-file basis.

- Move Ticker to scheduler library.

- Remove as many redundant imports as possible now.

- Some minor nit picking cleanup in various files.
2016-02-11 00:06:23 -08:00
Devon Carew
284db8cc76 rename the service protocol extensions 2016-02-09 11:53:52 -08:00
Devon Carew
68fa1a636d remove no longer needed code from the service protocol extensions 2016-02-04 14:56:49 -08:00
Hixie
28a1788371 Semantics 2016-01-27 10:04:49 -08:00
Ian Hickson
20a01b425e Add more debugPaintSizeEnabled construction lines.
- padding is shown in blue with a darker blue around the child
- spacing (empty size boxes or padding) is shown in gray
- alignment from a RenderPositionedBox is shown with yellow arrows
2016-01-08 23:13:20 -08:00
Adam Barth
ee88a685f8 Optimize repainting in Scaffold
Previously, we triggered a layout (and hence a repaint) when sliding the
draw because we gave the draw loose constraints. The drawer uses an
Align to move itself to the proper side of the screen, so it can have
tight constraints, which makes it a layout boundary.

Also, don't trigger a layout just because the Scaffold rebuilds. There
isn't any state in the scaffold custom layout, so it doesn't need to
repaint just because we created a new instance of the delegate.

Finally, add the debugging infrastructure I used to find these issues.
2016-01-08 01:57:30 -08:00
Hixie
4e23ecd668 Catch exceptions in pointer handling
If we don't catch these exceptions, we get confused about what's going
on with the pointers, and the app basically stops working.
2015-12-15 15:24:56 -08:00
Devon Carew
4226b6008e remove todos for service extension params 2015-12-15 11:08:42 -08:00
Devon Carew
cde14ab649 more checked mode guards; more types; fewer todos 2015-12-14 19:04:34 -08:00
Devon Carew
211aeabb87 review comments 2015-12-14 12:51:39 -08:00
Devon Carew
ce6b330a80 expose flutter debug functionality using VM service extensions 2015-12-14 10:22:20 -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
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
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
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
aed45ba92b Reduce latency of low-volume debugPrint output
If we haven't printed anything for a second, then reset the count of how
much we've printed.

I also reduced the amount of data to ~16kb until we pause because I saw
some corruption even pausing 1 second every ~32kb. (Numbers are
approximate because we're counting UTF-16 characters and some of the
characters in the output are multiple bytes in UTF-8.)
2015-10-17 16:43:22 -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
ecce1eb389 Import dart:ui as ui (instead of as sky) 2015-10-09 20:55:54 -07:00
Adam Barth
5b37f8750d Rename dart:sky to dart:ui 2015-10-09 19:27:13 -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
Hixie
2e0d5f9292 Improve the debugging information for Widget
If the build stack got long before, it would get cropped.
2015-09-11 13:25:17 -07:00
Adam Barth
6fc343a097 Remove package:sky/base
These files really belong on other libraries.
2015-09-08 10:59:07 -07:00