1140 Commits

Author SHA1 Message Date
Adam Barth
8a3285b6c5 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
01b88ccc55 Merge pull request #710 from abarth/const_key
Key should be const
2015-08-20 09:55:59 -07:00
Adam Barth
eb1b0333e9 Key should be const
For great constness.

Fixes #693
2015-08-20 09:50:51 -07:00
Adam Barth
a2e75eaed0 Rename vestiges of root
We now use the term `renderObject`.

Fixes #708
2015-08-20 09:24:17 -07:00
Hixie
654fc7346e 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
d662f7e6d2 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
72807ef8ec 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
Hixie
87adaf3fe9 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
Hixie
2c44ed0f01 Implement 'stretch' for flexible items. 2015-08-19 13:28:28 -07:00
Adam Barth
3784201b9f Rev pub package 2015-08-19 13:09:20 -07:00
Hans Muller
9de941db18 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
967b7a744f Merge pull request #694 from abarth/default_scroll_direction
Give default scroll directions
2015-08-19 12:23:56 -07:00
Hixie
a9643aea3c The ScrollDirection argument needs a default all the way through.
Fixes the Stocks crash on startup.
2015-08-19 12:20:18 -07:00
Collin Jackson
09216794e7 Add support for saving settings in fitness app 2015-08-19 12:12:33 -07:00
Adam Barth
bc7256da78 Give default scroll directions
Fixes tests.
2015-08-19 11:00:24 -07:00
Adam Barth
7f4aa210c0 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
2e3cb06fdd 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
cf164071c7 Dismissable: correct handling of a drag that ends with a fling 2015-08-19 10:48:26 -07:00
Adam Barth
7d7ee705d7 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
7782a11534 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
8f0efd54ff 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
7786211cac Merge pull request #686 from domokit/Theme-Brightness
Pick a default theme brightness
2015-08-19 09:21:51 -07:00
Adam Barth
194c616b2a 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
6b355f4f07 Update README.md 2015-08-18 22:16:27 -07:00
Ian Hickson
3f95d2dd97 Update README.md 2015-08-18 22:12:59 -07:00
Ian Hickson
37cf87f009 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
8f4db36652 Update README.md 2015-08-18 22:09:28 -07:00
Adam Barth
de5cb2579f 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
dea3a0922c 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
ce8f75dac8 Merge pull request #684 from abarth/explode_box
Split box.dart into many files
2015-08-18 21:04:58 -07:00
Adam Barth
50bfdedbf4 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
1418d271ed Update README.md 2015-08-18 20:53:16 -07:00
Ian Hickson
e4f6a417df Update README.md 2015-08-18 20:51:48 -07:00
Adam Barth
5b40e03129 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
Adam Barth
6cc103cf07 Borders on Containers shouldn't overlap the content
This CL inflates the padding of Container to account for the borders so that
the borders are allocated space in the layout and don't draw behind the
Container's child.
2015-08-18 16:10:40 -07:00
Collin Jackson
a16ee23f0e Merge pull request #678 from collinjackson/gridlines
Request gridlines for fitness chart
2015-08-18 15:46:26 -07:00
Adam Barth
b7421fcbf1 Improve RenderImage constraint solving
We now fold the width and height properties into the constraints and try to
find a size for the image that perserves the image's intrinsict aspect ratio
while fitting within the given constraints.
2015-08-18 15:23:04 -07:00
Collin Jackson
429c39455d Request gridlines for fitness chart 2015-08-18 15:15:49 -07:00
Adam Barth
39ca4fa1ce Merge pull request #672 from abarth/render_image_fit
Apply ImageFit and ImageRepeat to RenderImage
2015-08-18 11:12:00 -07:00
Adam Barth
0ad2c11cc6 Apply ImageFit and ImageRepeat to RenderImage
These properties should apply to foreground images as well as background
images. Also, rename these types from BackgroundFit and BackgroundRepeat
because they apply to things other than backgrounds.
2015-08-18 11:11:31 -07:00
Viktor Lidholt
d9c743e1c5 Fixes loading of assets in demo game 2015-08-18 10:33:34 -07:00
Adam Barth
66c2cc2ae1 Merge pull request #670 from abarth/expand_dimension
Container should expand in dimensions without constraints
2015-08-18 10:07:23 -07:00
Adam Barth
516616aaf6 Container should expand in dimensions without constraints
... as long as it doesn't have a child. If it has a child, it should size
according to that child. Essentially, if Container doesn't have a child, it
pretends like it has a child that expands to fill its constraints.
2015-08-18 10:06:49 -07:00
Viktor Lidholt
882f32bb95 Merge pull request #666 from vlidholt/master
Adds bounce and elastic easing to animation curves
2015-08-18 09:37:02 -07:00
Viktor Lidholt
b9629155c4 Minor fixes to new animation curves 2015-08-18 09:34:07 -07:00
Hixie
e4ac518908 Port clipping to the new layer world.
- Add Canvas.getSaveCount()
- Make RenderClipRect call context.paintChildWithClip instead of doing the clipping itself
- Make ClipLayer take a Rect instead of a Size
- Make PaintingContext.canvas read-only
- Add PaintingContext.paintChildWithClip()
- Minor rearrangings of code and style tweaks
2015-08-18 08:34:42 -07:00
Eric Seidel
db3d632a5a Add release notes for SkyDemo.apk 0.0.23 2015-08-17 18:00:10 -07:00
Eric Seidel
f714ec6bca Add release notes for Fitness 0.0.3
@collinjackson
2015-08-17 17:51:50 -07:00
Eric Seidel
b3947162ff Make Asteroids.apk use background music from its bundle
This was the last instance of loading assets off of Github.

@abarth
2015-08-17 17:10:38 -07:00
Viktor Lidholt
9cb2cdacba Updates demo game to use curves from the animation package 2015-08-17 17:07:55 -07:00