3473 Commits

Author SHA1 Message Date
Adam Barth
bbdff819f1 Remove RenderView.paintFrame
We now use the repaint system to do all the painting. During initialization, we
set up a root layer that applies the device pixel ratio.

Fixes #706
2015-08-20 11:24:33 -07:00
Adam Barth
26203b69f5 Merge pull request #711 from abarth/rm_paint_layer
Split up paintChildWithPaint into paintChildWithOpacity and paintChildWithColorFilter
2015-08-20 10:49:22 -07:00
Adam Barth
c89d7516b8 Split up paintChildWithPaint into paintChildWithOpacity and paintChildWithColorFilter
The compositor backends we're planning to use can't handle a general-purpose
paint layer and instead need lower-level operations.

Fixes #707
2015-08-20 10:28:23 -07:00
Adam Barth
5e6d425f3e Merge pull request #710 from abarth/const_key
Key should be const
2015-08-20 09:55:59 -07:00
Adam Barth
c16e03429c Key should be const
For great constness.

Fixes #693
2015-08-20 09:50:51 -07:00
Adam Barth
4a3894ed24 Merge pull request #709 from abarth/rename_root
Rename vestiges of `root`
2015-08-20 09:30:59 -07:00
Adam Barth
139c69dcbb Rename vestiges of root
We now use the term `renderObject`.

Fixes #708
2015-08-20 09:24:17 -07:00
Ian Hickson
4ffb56577a Merge pull request #688 from Hixie/layers
Improvements for Layers logic
2015-08-20 09:07:50 -07:00
Hixie
7d9f52479e Improvements for Layers logic
- Introduce some new Layer classes.
- Introduce paintChildWith* methods.
- Convert paint() methods to use paintChildWith* where appropriate.
- Fix paintBounds logic in Layer world.
- Introduce Layer.replaceWith(), so that it's clearer what's going on.
- Make RenderObjects have a ContainerLayer, not a PictureLayer.
- Introduce a PaintingContext.replacingLayer() constructor to highlight
  where we are creating a layer just to replace an older one.
- Rename some layer-related methods and fields for clarity:
   requiresCompositing -> hasLayer
   hasCompositedDescendant -> needsCompositing
   updateCompositing -> updateCompositingBits
   _needsCompositingUpdate -> _needsCompositingBitsUpdate
   markNeedsCompositingUpdate -> markNeedsCompositingBitsUpdate
- After updating compositing bits, if we find that the bit changed, we
  now call markNeedsPaint().
- Reorder markNeedsPaint() logic for clarity.
- Make flushPaint() start at the deepest node.
- Make _compositeChild() avoid repainting children with hasLayer that
  aren't dirty, instead it just reuses their existing layer.
- Made RenderView reuse the RenderObject layer instead of having its own.
- Made RenderView have hasLayer set to true.
- Add various asserts and comments.
2015-08-20 08:57:22 -07:00
Hans Muller
968ad3f4cc Merge pull request #700 from HansMuller/vertical-pageable-list
Handle changes to scrollDirection in ScrollableList et al

Changed the pageable_list.dart example: tapping on the toolbar changes
the scroll direction. This exposed some problems:

- Scrollable.syncFields() didn't update scrollDirection
- Viewport updated its RenderObject fields in the wrong order
- FixedHeightScrollable scrollDirection changes didn't update the scrollBehavior.

There may be similar problems with VariableHeightList and ScrollableViewport.
I will fix those in a separate CL.
2015-08-20 08:28:13 -07:00
Hans Muller
2e112e4317 Handle changes to scrollDirection in ScrollableList et al
Changed the pageable_list.dart example: tapping on the toolbar changes
the scroll direction. This exposed some problems:

- Scrollable.syncFields() didn't update scrollDirection
- Viewport updated its RenderObject fields in the wrong order
- FixedHeightScrollable scrollDirection changes didn't update the scrollBehavior

There may be similar problems with VariableHeightList and ScrollableViewport.
I will fix those in a separate CL.
2015-08-20 08:24:16 -07:00
Adam Barth
1f21e94837 Merge pull request #705 from abarth/support_file_urls
Teach the DartLibraryProviderFiles about file URLs
2015-08-19 23:57:18 -07:00
Adam Barth
6b2a1ee6b0 Teach the DartLibraryProviderFiles about file URLs
We don't want to support file URLs in general, but having them in the "files"
version of the library provider makes it easier to integrate with package:test.
2015-08-19 23:46:36 -07:00
Adam Barth
5dee1c7a80 Merge pull request #704 from abarth/scrollable_padding
Fix padding on infinite scrolling list
2015-08-19 19:09:14 -07:00
Adam Barth
20d37cb262 Fix padding on infinite scrolling list
Rather than using a Padding widget to provide padding along the scrolling axis,
we now just figure the padding into where we draw the items. This patch fixes
an issue where we would remove the first topmost item in a scrollable list too
early because we thought it was already off screen.

Fixes #697
2015-08-19 18:05:02 -07:00
Adam Barth
821410b123 Merge pull request #703 from Hixie/widgets
RenderObjectWrapper cleanup and new asserts.
2015-08-19 17:02:04 -07:00
Hixie
f35f1f7cc2 RenderObjectWrapper cleanup and new asserts.
- Clarify comment about RenderObjectWrapper.
- Assert that we never sync a RenderObjectWrapper with an instance of a different type.
- Assert that MultiChildRenderObjectWrapper subclasses always have multi-child RenderObjects.
- Assert that renderObject doesn't change identity when syncing.
- Make searchForOldNode() return void since the return value is ignored.
- Remove code that handled renderObject changing during sync.
2015-08-19 16:26:23 -07:00
Eric Seidel
667cfe5348 Merge pull request #698 from Hixie/flex
Implement 'stretch' for flexible items.
2015-08-19 13:29:33 -07:00
Hixie
f499cf5f43 Implement 'stretch' for flexible items. 2015-08-19 13:28:28 -07:00
Adam Barth
e92e62224c Rev pub package 2015-08-19 13:09:20 -07:00
Adam Barth
6850744169 Rev pub packages 2015-08-19 12:56:27 -07:00
Hans Muller
5b30e5d626 Merge pull request #695 from HansMuller/dismissable-drag-fling
Dismissable: correct handling of a drag that ends with a fling
2015-08-19 12:29:24 -07:00
Ian Hickson
2bb7fd4295 Merge pull request #694 from abarth/default_scroll_direction
Give default scroll directions
2015-08-19 12:23:56 -07:00
Ian Hickson
1f1c1af723 Merge pull request #696 from Hixie/scroll-fix
The ScrollDirection argument needs a default all the way through.
2015-08-19 12:23:22 -07:00
Hixie
f1754d987d The ScrollDirection argument needs a default all the way through.
Fixes the Stocks crash on startup.
2015-08-19 12:20:18 -07:00
Adam Barth
1cd547886b Give default scroll directions
Fixes tests.
2015-08-19 11:00:24 -07:00
Adam Barth
01209fec6e Merge pull request #692 from abarth/position_image
Center images in their bounds when painting
2015-08-19 10:57:02 -07:00
Adam Barth
d55c8be91a Center images in their bounds when painting
Eventually we'll plumb positionX and positionY out so that developers can
control them.
2015-08-19 10:56:34 -07:00
Adam Barth
1a933a7825 Add a default BoxDecorationPosition
Fixes the tests because previously we wouldn't draw any box decorations.
2015-08-19 10:50:41 -07:00
Hans Muller
43c9017882 Dismissable: correct handling of a drag that ends with a fling 2015-08-19 10:48:26 -07:00
Adam Barth
232d718d8e Merge pull request #690 from abarth/foreground_decoration
Add the ability to draw a foreground box decoration
2015-08-19 10:37:02 -07:00
Hans Muller
d2f7685826 Merge pull request #682 from HansMuller/dismissable-bug
Adds PageableList, other scrolling related changes and fixes

Adds PageableList, other scrolling related changes and fixes

- PageableList extends ScrollableList
One fixed width or height item is visible and centered at a
time. Fling and drag gestures scroll to the next/previous item.

- Scrollable.scrollTo(), Scrollable.scrollBy(), ensureWidgetIsVisible() API changed
The named animation parameter for these methods was replaced by
duration and curve. All of the methods now return a Future. The Future
completes when the scroll does.

This change eliminates the need for Scrollable to temporarily take ownership
of a ValueAnimation object (see #645).

- Using Future.then() instead of an AnimationPerformance status listener
In ensure_visible.dart _handleTap() uses ensureWidgetIsVisible() to
center the card roughly as before and then. When the implicit scroll
animation is complete, it changes the centered card's label font. The
change is made when the Future returned by ensureWidgetIsVisible()
completes.

- FixedHeightScrollable's itemHeight parameter is now itemExtent
If scrollDirection is ScrollDirection.vertical (the default) then itemExtent should
be the height of each item; otherwise it should be the width of each item.

Replaced _velocityForFlingGesture() in scrollable.dart with Scrollable._eventVelocity()
The original version clamped pixels/ms against pixels/sec constants. The new version
also deals with scrollDirection.

Plumbed scrollDirection though FixedHeightScrollable and ScrollableList

Both classes should now support horizontal scrolling.
2015-08-19 10:18:41 -07:00
Hans Muller
8e465b4dce Adds PageableList, other scrolling related changes and fixes
- PageableList extends ScrollableList
One fixed width or height item is visible and centered at a
time. Fling and drag gestures scroll to the next/previous item.

- Scrollable.scrollTo(), Scrollable.scrollBy(), ensureWidgetIsVisible() API changed
The named animation parameter for these methods was replaced by
duration and curve. All of the methods now return a Future. The Future
completes when the scroll does.

This change eliminates the need for Scrollable to temporarily take ownership
of a ValueAnimation object (see #645).

- Using Future.then() instead of an AnimationPerformance status listener
In ensure_visible.dart _handleTap() uses ensureWidgetIsVisible() to
center the card roughly as before and then. When the implicit scroll
animation is complete, it changes the centered card's label font. The
change is made when the Future returned by ensureWidgetIsVisible()
completes.

- FixedHeightScrollable's itemHeight parameter is now itemExtent
If scrollDirection is ScrollDirection.vertical (the default) then itemExtent should
be the height of each item; otherwise it should be the width of each item.

Replaced _velocityForFlingGesture() in scrollable.dart with Scrollable._eventVelocity()
The original version clamped pixels/ms against pixels/sec constants. The new version
also deals with scrollDirection.

- Plumbed scrollDirection though FixedHeightScrollable and ScrollableList

Both classes should now support horizontal scrolling.
2015-08-19 10:14:21 -07:00
Adam Barth
4d72533b9f Add the ability to draw a foreground box decoration
This feature lets you create effects similar to the "outline" property in CSS.
2015-08-19 09:36:40 -07:00
Ian Hickson
663d56cd28 Merge pull request #686 from domokit/Theme-Brightness
Pick a default theme brightness
2015-08-19 09:21:51 -07:00
Adam Barth
cf8ddc61b9 Merge pull request #687 from abarth/rev_playfair
Update playfair revision
2015-08-19 09:06:39 -07:00
Adam Barth
7e5b6c96c7 Update playfair revision
... and reattach fitness to the build. We detached fitness from the build
because it was seeing an old version of playfair that didn't work with the most
recent version of the Sky package.
2015-08-19 09:05:30 -07:00
Ian Hickson
5a4a674d6e Update README.md 2015-08-18 22:16:27 -07:00
Ian Hickson
a29d6e602c Update README.md 2015-08-18 22:12:59 -07:00
Ian Hickson
ed3e129027 Pick a default theme brightness
There doesn't seem to be any particular reason for us to not default the brightness to _something_.
2015-08-18 22:10:45 -07:00
Ian Hickson
37fd29950c Update README.md 2015-08-18 22:09:28 -07:00
Adam Barth
f186981924 Temporary build fix
Unhook fitness from the build to work around build break in playfair. We
updated the Sky package in an incompatible way, which means we need to roll in
a new playfair package to build fitness.
2015-08-18 21:50:29 -07:00
Adam Barth
2a3e51d51f Merge pull request #685 from abarth/rendering_dart
Add package:sky/rendering.dart
2015-08-18 21:43:25 -07:00
Adam Barth
f9c683bceb Add package:sky/rendering.dart
Similar to widgets.dart, rendering.dart exports the entire rendering layer.
Also, update the examples to use rendering.dart and widgets.dart. Also clean up
some exports so that the examples have more sensible imports.
2015-08-18 21:39:51 -07:00
Adam Barth
741b28026a Merge pull request #684 from abarth/explode_box
Split box.dart into many files
2015-08-18 21:04:58 -07:00
Adam Barth
037e1c7155 Split box.dart into many files
Sadly, box.dart has grown much longer than 1000 lines. This patch splits it up
into several files based on the class hierarchy. Fortunately, many of these
classes are loosely coupled to each other.
2015-08-18 20:55:32 -07:00
Ian Hickson
87f78c3307 Update README.md 2015-08-18 20:53:16 -07:00
Ian Hickson
ef7d467b5e Update README.md 2015-08-18 20:51:48 -07:00
Adam Barth
645eff64ce Merge pull request #683 from abarth/null_image
RenderImage should handle the case of a null image
2015-08-18 20:29:31 -07:00
Adam Barth
760ac40c68 RenderImage should handle the case of a null image
When given a null image, RenderImage should be as small as possible (isntead of
being NaNxNaN).

Also, plumb ImageFit and ImageRepeat through the various image widgets.
2015-08-18 20:05:52 -07:00