1822 Commits

Author SHA1 Message Date
Adam Barth
c17d58ab28 Fix shutdown crash in Sky
Previously, we would try to close some Dart persistent handles after destroying
the isolate. Now we revoke the weak pointers these handles are using to refer
to the isolate before trying to tear them down.

Fixes https://github.com/domokit/mojo/issues/233

R=chinmaygarde@google.com, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1175053002.
2015-06-10 12:59:07 -07:00
Collin Jackson
56d1aa0b94 Fix cross size of flex items in stocks app (more tests incoming)
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1176053002
2015-06-10 12:54:26 -07:00
Hixie
7fce9b4bdb Mention typedefs in the sky dart style guide.
TBR=jackson

Review URL: https://codereview.chromium.org/1178523005
2015-06-10 12:45:55 -07:00
Adam Barth
4806a4cc04 Remove _emptyList from fn2.dart
We can use const [] instead and we'll be sure we don't mutate this constant.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1178623002.
2015-06-10 12:42:41 -07:00
Hixie
633ba8c811 Sky Style Guide.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1176763006
2015-06-10 12:37:21 -07:00
Eric Seidel
58068b9e41 Add TODOs about components needing to adjust to screen size changes.
Our current static view_configuration design cannot work.

https://github.com/domokit/mojo/issues/231

R=ianh@google.com

Review URL: https://codereview.chromium.org/1169813009.
2015-06-10 11:28:00 -07:00
Eric Seidel
c87b98b687 Enable antialiasing on Paint by default.
The app looks so much better with this on.

R=jackson@google.com, abarth@chromium.org

Review URL: https://codereview.chromium.org/1172413002.
2015-06-10 11:11:03 -07:00
Hans Muller
c572af7f6e Right-size the toolbar
Tweaked the layout in Scaffold a little: the Scaffold
accounts for the (Android) notification bar's height,
instead of the ToolBar. I think it would be best if
moving the app below the notification area were handled
at a lower level. Doing it in Scaffold seemed OK for the
moment, since one could put a ToolBar component anywhere
in an app.

Closes #208

R=ianh@google.com

Review URL: https://codereview.chromium.org/1171173003.
2015-06-10 11:06:50 -07:00
Hixie
003083a12d Remove one more use of mirrors: Components now have to explicitly sync their fields.
This also removes one bit of magic to make it more obvious what on is
going on during a sync, which should hopefully help.

Components have to decide if they support being stateful or not. If
they do, then they must implement syncFields() and have mutable
fields; if they don't, then they must have final fields. This isn't
particularly enforced, though.

This also renames _willSync() to _retainStatefulNodeIfPossible(), for
clarity, and fixes some minor style issues and one typo that was
breaking the drawer.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1174023003
2015-06-10 10:33:04 -07:00
skyostil
d174ed2ae8 Remove use of MessageLoopProxy
Remove the usage of base::MessageLoopProxy since it has been deprecated.

BUG=465354
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1174063002.

Patch from skyostil <skyostil@chromium.org>.
2015-06-10 10:24:06 -07:00
Collin Jackson
950b3d40c5 Extend Sky's RenderFlex with intrinsic sizes and compute cross-size height
Renders interactive_flex and stocks demos fine. Could use more testing,
so I'm going to work on that after I land this.

R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1173493003
2015-06-10 10:11:58 -07:00
Matt Perry
42892c733b Add LinearBoxGradient and RadialBoxGradient decorations for RenderDecoratedBox.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1175763002.
2015-06-10 12:23:57 -04:00
Adam Barth
38e39c0ec5 Make ink splashes work in MenuItem
Previously, the ink splashes would disappear immediately because the button
highlight would change the structure of the component hierarchy and we weren't
smart enough to retain the underlying RenderInkSplash. This CL is a point fix
for that issue by avoiding changing the structure of the component hierarchy. A
more complete fix would be to make Container smarter about how it syncs its
subcomponents.

R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1168323003.
2015-06-10 09:23:24 -07:00
Viktor Lidholt
09172e8831 Adds support for zOrder and references to parent nodes in sprites, also start of new test app.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1177563004.
2015-06-10 09:21:01 -07:00
Adam Barth
57df667f8f Add a basic InkWell implementation
This CL replaces the (non-working) components2 InkWell with some code based on
the ink_well example. There are at least two issues with the implementation:

1) The ink splash always starts at the center of the well because we don't have
   a facility for converting from global to local coordinates, which means we
   can't tell where the tap occurred in the local coordinates we need to use
   for painting.

2) When used inside a MenuItem, the in splash disappears shortly after
   starting, presumably because the button starts highlighting, which causes a
   component rebuild and somehow we lose the RenderInkWell instance.

I plan to address these issues in subsequent CLs.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1172033003.
2015-06-10 09:04:15 -07:00
Eric Seidel
52fd41bc88 Make Sky not crash when an image 404s.
I also fixed image_cache to not even bother
to call ImageDecoder in the 404 case, but I also
fixed CanvasImageDecoder not to blow up if the
buffer is empty and its not able to allocate
an ImageDecoder.

Closes https://github.com/domokit/mojo/issues/229

R=abarth@chromium.org, jackson@google.com

Review URL: https://codereview.chromium.org/1170413002.
2015-06-09 17:29:00 -07:00
Ian Fischer
4b8590c14a Update the native_viewport interface to allow specification of the surface configuration, currently only needed for and used by EGL on Android.
This also fixes an issue where eglChooseConfig was
only being called in InitializeOneOff, which is
only called once per process.  This CL makes
choosing the config happen once per GLSurface
instead, which will ultimately permit apps to
create multiple native_viewports with different
surface configurations on the same display.  The
eglDisplay object is still a global, though.

R=abarth@chromium.org, viettrungluu@chromium.org, jamesr@chromium.org

Review URL: https://codereview.chromium.org/1168993002.
2015-06-09 16:50:28 -07:00
Hans Muller
3b53de73f0 Vertically center stock demo row contents, better up/down arrows
StockRows are now a relatively simple application of flex layout.

The up/down arrows are now rendered within a circle, like
the original version. The arrows are a little bigger,
because.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1165223005.
2015-06-09 15:59:18 -07:00
Hixie
d9de344d6c I accidentally removed two lines of code in https://codereview.chromium.org/1172173002 when merging upsteam before landing.
TBR=abarth

Review URL: https://codereview.chromium.org/1171163005
2015-06-09 15:30:38 -07:00
Hixie
d54c213b24 Clean up a bunch of our Dart code.
- constructors first
 - have either a blank line at the top and bottom of each class, or no blank line in either place (it's still inconsistent about which we should do)
 - hide clamp()

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1172173002
2015-06-09 15:27:58 -07:00
Hixie
5156f12b32 Move AnimatedComponent away from mirrors and towards a callback-based setter.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1171273002
2015-06-09 15:24:51 -07:00
Hixie
c3eccc8556 Remove Component.getRoot(), since we don't use it anymore.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1174683005
2015-06-09 15:24:07 -07:00
Eric Seidel
3a5fd0e53e Make it possible to navigate from a SkyView to a WebView.
This would occur when bringing SkyDemo to the front after
having viewed a SkyView based demo and then paused
the SkyActivity (by going to the Android Launcher, etc.)

I also fixed deploy_domokit_site.py to ignore .gitignore files
found in packages.  We should actually probably ignore these
when creating the packages in the first place, but
this check seems valid regardless.  The .gitignore for
sky/lib/assets was causing the assets not to get pushed
to the demo site.

R=abarth@chromium.org, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1163323007.
2015-06-09 15:10:14 -07:00
Hixie
8198a29b67 Remove a bogus .ceilToDouble() call.
TBR=abarth

Review URL: https://codereview.chromium.org/1173783002
2015-06-09 14:12:28 -07:00
Adam Barth
a68b53ae91 Fix the Sky tests
Instead of triggering layout synchronously during AppView construction, we now
schedule the initial layout using a magic bootstrapping function.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1172123003.
2015-06-09 14:07:17 -07:00
Adam Barth
4011ec97b8 SkyView should handle screen rotation
This CL implements a basic version of screen rotation where we just relayout at
the new size. In the future, we'll want a fancy version where we transition
between the two layouts.

R=ianh@google.com
BUG=

Review URL: https://codereview.chromium.org/1177563002.
2015-06-09 13:56:18 -07:00
Eric Seidel
9bef57480a Resurrect deploy_sdk and make it use prepare_pub_packages.py
Works like a charm, and is now much simpler thanks to John's work.

R=abarth@chromium.org, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1174683003.
2015-06-09 13:18:59 -07:00
Hixie
6495ef0710 Add asserts to prevent people from setting box.parentData.position or box.size except during layout.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1176623002
2015-06-09 13:11:11 -07:00
Matt Perry
d745bd3d47 Sky: Add a DartConverterEnum and use that for all our enum needs.
R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1170963003.
2015-06-09 15:58:54 -04:00
Matt Perry
7cbe385e8f Add a shadow to the FloatingActionButton.
Also added a helper class to Sky framework for building shadow DrawLoopers.

R=abarth@chromium.org, eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1175683002.
2015-06-09 15:51:04 -04:00
Hixie
4c86f98a1b Rename the confusingly named "ContentNode" class to "TagNode".
Also considered "AnnotationNode", "LabelNode", "BadgeNode", but "TagNode" seemed simplest.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1169853008
2015-06-09 12:44:38 -07:00
Adam Barth
3e5993eeee Give the popup menu a 2px border radius
This matches the material design spec.

R=ianh@google.com, jackson@chromium.org

Review URL: https://codereview.chromium.org/1169873003.
2015-06-09 12:43:27 -07:00
Hixie
2fa798966e OneChildRenderObjectWrapper and Scaffold were ignoring the return value of syncChild().
This would cause them to forget what the most recent child they'd been given was, with disastrous effects later.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1173683003
2015-06-09 12:23:17 -07:00
Matt Perry
9f64045470 Sky: Allow clients to specify tile mode for gradients (repeating or mirror).
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1166223004.
2015-06-09 15:21:46 -04:00
Eric Seidel
9f337a62e6 Fix typo in fetch.dart
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1169253002.
2015-06-09 12:17:50 -07:00
Eric Seidel
8f975399e1 Move image loading out of C++ into Dart
We already know how to talk to the network_service from Dart
via fetch.dart.  Might as well use that for Image loading
as well insetad of having ImageLoader do it.

As part of this I've renamed *ImageLoader to *ImageDecoder
and moved all the image loading logic into Dart.  This required
me to teach the idl system about mojo handles so that I could
pass the resulting MojoHandle from fetch.dart up through to
ImageDecoder.

R=abarth@chromium.org, jackson@google.com, hansmuller@google.com

Review URL: https://codereview.chromium.org/1173703002.
2015-06-09 12:14:13 -07:00
Adam Barth
ff13e9ae9e Add material shadows to toolbar and drawer
Also, I've fixed the mask color on the drawer.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1168203004.
2015-06-09 12:07:14 -07:00
Matt Perry
aa80a91279 Change the ColorFilter constructor to ColorFilter.Mode, in case we want to add
more ColorFilter types.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1163373007.
2015-06-09 14:55:52 -04:00
Adam Barth
576ede1684 Update HACKING.md 2015-06-09 11:27:52 -07:00
Hans Muller
65926f65fb Added a key: parameter to ParentDataNode, ContentDataNode
The FlexExpandingChild flex parameter is now a keyword as
well, which adds a small readability benefit.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1172503004.
2015-06-09 11:00:47 -07:00
Adam Barth
2368f9b985 Add boxShadow to BoxDecoration#toString
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1174623002.
2015-06-09 10:39:52 -07:00
Adam Barth
7a930b8352 Add a proper material shadow the popup menu
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1172723002.
2015-06-09 10:31:39 -07:00
Matt Perry
ecb61e1466 Sky: Added radial gradients.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1169863002.
2015-06-09 12:45:02 -04:00
Adam Barth
f183f6a173 Position the popup menu in stocks2 correctly
This CL pulled an implementation of position: absolute in RenderStackContainer.

R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1166363002.
2015-06-09 09:22:50 -07:00
Hans Muller
b84a54c8ad Restore stock_arrow element of the stocks2 demo
This version doesn't add any visual punch.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1172513002.
2015-06-09 09:05:25 -07:00
Benjamin Lerman
f054a99b83 Sky: Use the authenticated network service.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1146813013
2015-06-09 09:46:18 +02:00
Adam Barth
e50d0e622b ShrinkWrap the Stocks menu
The popup menu in the stocks app is supposed to size its width to the max
intrinsic width of the menu. This CL teaches it how to do that.

It's a shame that we need to ceilToDouble the output of RenderParagraph. If we
don't do that, we run into floating point layout trouble and the menu triggers
a line break. The correct fix is to do layout in fixed point.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1168113005
2015-06-08 16:20:11 -07:00
Eric Seidel
92fd88b73f Fix RenderParagraph to respect text color.
I don't think this is the final API we're going to use.

I suspect we'll add a TextStyle struct to hold
color and size, etc. which back-ends into CSS like
this does today.

Currently no one uses this color even though it exists.

This is one step towards fixing:
https://github.com/domokit/mojo/issues/213

R=ianh@google.com

Review URL: https://codereview.chromium.org/1162573007
2015-06-08 15:22:18 -07:00
Adam Barth
903ef07abb Split getIntrinsicDimensions into four pieces
This CL splits getIntrinsicDimensions into getMinIntrinsicWidth,
getMaxIntrinsicWidth, getMinIntrinsicHeight, and getMaxIntrinsicHeight so that
we can properly shrink-wrap the stocks app menu. This CL just contains the
refactoring. The use in stocks app will come in a later CL.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1167293003
2015-06-08 14:40:34 -07:00
Hixie
44ad012a65 Convert everything in the Sky API from degrees to radians.
Radians are the one true angle unit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1164393002
2015-06-08 14:38:06 -07:00