1373 Commits

Author SHA1 Message Date
Adam Barth
cc12331d63 Update references to Mojo core and bindings
Build fix after recent Dart bindings refactoring.  Now that these libraries are
not included in the snapshot, we need to load them from the mojo package.

R=zra@google.com
TBR=zra@chromium.org

Review URL: https://codereview.chromium.org/1029683002
2015-03-23 13:22:38 -07:00
Adam Barth
27359c558f Add tracing to oknet
R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1018393006
2015-03-23 13:22:13 -07:00
Adam Barth
1021146178 Make it possible to construct a Stock directly
We were missing the ability to initialize one of the fields.

TBR=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1027293003
2015-03-23 11:23:48 -07:00
Zachary Anderson
d83427c165 Dart: Removes all but native calls and the handle watcher from the snapshot.
The bindings, core, and application libraries are now referred to as, e.g.:

package:mojo/public/dart/core.dart

Since the handle watcher remains in the snapshot, it no
longer refers to types defined in core.dart. References to types defined
in core.dart are also removed from mojo_natives.cc.

In Dart packaged apps, the SDK is zipped up under mojo/public/dart.

For embedder tests, the SDK is copied into the generated source output directory.

A base_dir parameter is added to the 'dart_package' and 'mojom' GN macros so that
consumers of the Mojo SDK can all import using the same URIs regardless of where
the SDK lives in their source trees.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/1027603002
2015-03-23 11:04:03 -07:00
Adam Barth
9703e7f46f Load stocks data off the network
Instead of hard-coding the stock data in the Dart file, this CL moves the data
to a JSON file and loads that file over the network. This change improves load
time for the Stocks app from 3 seconds to 2 seconds.

Also, this CL removes shake-to-reload from the Stocks app because that also
slows down load time (due to the two module systems fighting each other).

R=rafaelw@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/1021723005
2015-03-23 09:59:50 -07:00
Adam Barth
e26810b1de Add more tracing to Sky
This CL adds trace events:

1) Between requesting a frame and begin frame.
2) In the DartLoader see network latency.
3) While executing |main| and |_init|.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1025073003
2015-03-20 16:11:39 -07:00
Rafael Weinstein
3b42fcfddd Move dom-serializer.sky to dom_serializer.dart (and clean up some analyizer errors)
TBR=abarth

Review URL: https://codereview.chromium.org/1025013003
2015-03-20 15:42:35 -07:00
Eric Seidel
d83ebf6913 Unbreak the deploy_sdk for --dev-environment
sdk_additions was already created above and thus
can't be linked here, must be copied.

TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1026933002
2015-03-20 15:20:57 -07:00
Adam Barth
43ebba749b Add more trace events to Sky
These will help us better understand what's happening.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1027913002
2015-03-20 15:07:24 -07:00
Eric Seidel
ad94044ec8 Copy all of dart_sky.dart's supporting files into package:sky
Also bumped package:sky's version in prep for publishing.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1024243002
2015-03-20 14:46:58 -07:00
Eric Seidel
a92a67ae42 Make the Sky pub package include our APK and teach sky_tool to install it
I'm not sure this is the final long-term solution, but works for now.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022193002
2015-03-20 14:35:14 -07:00
Adam Barth
6d1228a2f3 Enable tracing in SkyShell
This CL teaches shelldb how to trace SkyShell.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1027903002
2015-03-20 14:16:43 -07:00
Rafael Weinstein
3c70e47312 Removing Sky JS Framework tests
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1023213003
2015-03-20 14:04:34 -07:00
Eric Seidel
d06671f0ce Unbreak the build by adding the sky tool
TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1021933004
2015-03-20 13:59:15 -07:00
Rafael Weinstein
8eaeed7ba0 [Effen] Update README.md 2015-03-20 13:45:04 -07:00
Rafael Weinstein
5b9632b9d4 Update Effen README.md 2015-03-20 13:43:55 -07:00
Rafael Weinstein
ad8f8a6ea5 [Effen] Move README.md to correct directory
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/1024183002
2015-03-20 13:24:10 -07:00
Eric Seidel
65f13ec5e7 Attempt to make us not crash on KitKat.
https://github.com/domokit/mojo/issues/68

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1026873002
2015-03-20 12:45:25 -07:00
Eric Seidel
88587e3f32 Bump SkyDemo.apk version
Sending out a new version to fix the hittesting bug.

TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1025653005
2015-03-20 12:15:35 -07:00
Eric Seidel
fe416b295a Fix deploy_sdk.py to error out if files are missing
I also now deploy sky/bin/sky as sky/lib/sky_tool since
pub run doesn't really work very well yet.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1026863002
2015-03-20 11:21:47 -07:00
Rafael Weinstein
d702c848e4 [Effen] minor cleanup
This patch adds an assert that the mount/unmount queues are not subject to concurrent modification and refactors the sync-tracing to avoid the cost of string interpolation if tracing is disabled.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1020103004
2015-03-20 10:20:05 -07:00
Adam Barth
f8b3596df6 Use StyleNode in StockMenu
StockMenu was creating a container for the sole purpose of applying style to
PopupMenu. Now we just use a StyleNode.

Also, I've reverted the change to make box-sizing default to border-box. It
turns out that CL wasn't effective because we didn't use the initialBoxSizing
function to initialize box sizing. I've made us use initialBoxSizing but switch
the default back to content-box because actually using border-box breaks a
bunch of stuff.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1024083003
2015-03-20 10:16:24 -07:00
Adam Barth
9a5aea3737 Introduce Scaffold to Sky framework
This CL extracts a Scaffold component from StockApp. The Scaffold component
lets you create an "app-like" layout with an action bar, a drawer, etc.

R=ojan@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1027813002
2015-03-20 09:34:06 -07:00
Rafael Weinstein
082ca7c2c0 [Effen] add StyleNode
This patch adds a new (non-Render) StyleNode which takes two arguments: A (content) node, which it wraps and a Style object.

This allows for styles to be applied to Nodes which are constructed elsewhere (e.g. passed in as arguments).

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1027653002
2015-03-16 12:27:25 -07:00
Benjamin Lerman
f64fc80e81 Fix races when the same bits are downloaded from 2 URLs.
Until now, we were saving downloaded file to the temporary directory
with a name being the hash of the file content. It means there is a race
when the same content is downloaded from 2 different URLs.

To fix this, we now create an intermediary directory that is the hash of
the URL.

Also, because this is only needed for debugging with gdb, and this is
inefficient in term of both CPU and storage (we do not know when to
delete the temporary directory), we control this with a command line
flag.

R=ncbray@chromium.org, eseidel@chromium.org
BUG=https://github.com/domokit/mojo/issues/61

Review URL: https://codereview.chromium.org/1011333003
2015-03-20 12:51:00 +01:00
Rafael Weinstein
86dc24f938 [Effen] Add AnimatedComponent base class
This patch adds a base AnimatedComponent from which most components that animated should derive. It takes care of listening & unlistening from the animations during did(Un)mount as well as binding the animated value to a private field and scheduling the component for build.

Note that this patch removes the did(Un)mount overridable methods from Component and replaces them with a callback mechanism which is less brittle.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1027633003
2015-03-16 03:18:17 -07:00
Adam Barth
510cddef63 Integrate custom paint with the DocumentLifecycle
Instead of running paint requests during microtasks, we run them after updating
layout for the current frame. After draining all the paint requests, we then
drain whatever commits are available.

It's still possible that requestPaint callbacks can dirty style and layout
information, so we need to clean that information after servicing the requests.
Ideally we'd block these callbacks from dirtying style or layout information.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1027563002
2015-03-19 21:58:14 -07:00
Rafael Weinstein
f7a1477d26 [Effen] Add _syncChild assert and cleanup trace output
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/1021113002
2015-03-16 01:19:26 -07:00
Rafael Weinstein
486d0c1ce9 Added render tracing to Effen
TBR=abarth

Review URL: https://codereview.chromium.org/1023063003
2015-03-16 00:49:09 -07:00
Adam Barth
6a794823bc Remove pauseAnimationsForTesting
This code is unused and it hooks into the DocumentLifecycle in sketchy ways.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1020053002
2015-03-19 19:32:03 -07:00
Rafael Weinstein
216f9b143c [Effen] Slightly cleaner enforcement of App lifetime signals
TBR=hansmuller

Review URL: https://codereview.chromium.org/1028473003
2015-03-15 23:26:41 -07:00
Adam Barth
81233b6df9 Add a basic custom painting facility to Sky
This CL adds just enough custom painting to Sky to make
sky/examples/painting/circle.sky draw a circle. Over time, we should be able to
elaborate this system into something interesting and to make it actually work
in a reasonable way.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1017593005
2015-03-19 16:00:21 -07:00
Hans Muller
2239d67032 Call _notifyMountStatusChanged() on App startup
A recent change caused my scrolling app to fail because
didMount() was no longer called on my Scrollable subclass
at startup time.

I haven't been able to sort out how this used to work.
This CL is a hack to make it work again.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1019973003
2015-03-19 14:05:44 -07:00
Adam Barth
97abc0dadd Improve Material ink effects
1) Factors InkWell out of Material so that components can use an ink well
   without needing the shadow/level machinery.

2) Makes the ink effect move at a different velocity once the tap has actually
   occurred, converging with the spec. We don't have the right speeds yet, but
   at least we're approaching the right shape.

3) To support (2), added a primaryPointer attribute to GestureEvents to let
   authors coorelate gesturetapdown events with later gesturetap events.

4) To support (2), modernized SplashAnimation to used AnimatedValue and friends.

5) Added more constants to view-configuration.dart that match Android.

I've also removed the cancelling of the ink effect on scroll. The proper way to
do that is to notice that someone in the event chain is listening for
scrollstart and delay the beginning of the ink effect for some period of time.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1019023003
2015-03-19 11:17:48 -07:00
Viet-Trung Luu
1391f06fb1 Make the terminal demo able (to try) to connect to anything.
(Using the query string from the URL.)

R=erg@chromium.org

Review URL: https://codereview.chromium.org/1019323002
2015-03-19 11:14:56 -07:00
Adam Barth
953145ba63 Default box-sizing to border-box
content-box is crazy banana-pants.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1015253002
2015-03-19 10:55:03 -07:00
Adam Barth
4d43305993 Introduce PaintingContext, which will be used for custom painting
This CL is a first step towards custom paint. It introduces a class that can
draw a circle into an SkPicture. Future CLs will wire the SkPicture into the
render tree and expose this object to script.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1017373003
2015-03-19 10:54:43 -07:00
Rafael Weinstein
7230f65ca9 Turn off Effen render times printing
TBR=abarth
BUG=

Review URL: https://codereview.chromium.org/1023673004
2015-03-15 13:08:26 -07:00
Hans Muller
cc4f7d0db0 Added a positional Component.fromArgs() constructor
To define a Component subclass with mixins, a constructor without optional parameters is needed.

Added Component.fromArgs() which just delegates to the main constructor.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1017353002
2015-03-19 08:06:23 -07:00
Rafael Weinstein
e8318f65a7 Change how events are handled in Effen
This patch removes the mutable API to event handling (Nodes no longer have a events object with which to add listeners).

Instead, a new (non-Render) Node is introduced: EventTarget. This node represents a location in the Effen tree which can handle events as they bubble.

Note that this also changes the implementation to use event delegation (one set of listeners at the sky.document level) rather than direct listeners on leaf nodes.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1019633004
2015-03-15 12:33:30 -07:00
Ojan Vafai
5968e0308a Fix hit-testing in the stocks apps when scrolled.
We were not passing the transformed HitTestLocation when we recursed
into child layers, which meant that we wouldn't take transforms
correctly into account when hit testing.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1019723002
2015-03-18 18:55:54 -07:00
Adam Barth
420098c97c Improve the openning animation for PopupMenu
We're now doing all of the elements of the popup menu entrance animation from
the material design spec, but our timing and curves might not be exactly right
yet. I haven't started on the exit animation.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1017193004
2015-03-18 15:21:48 -07:00
Eric Seidel
fb351b9ded Update SkyDemo.apk to versionCode=2 for publishing to play store.
This version updates the url it loads from /home to /sky_home
and also adds a bit of logging on 404s.

TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1015243002
2015-03-18 14:25:16 -07:00
Eric Seidel
03234dcfaf Log to android logger when loads fail in oknet.
This makes it much easier to debug (otherwise silent) 404s of images, etc.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1019103002
2015-03-18 14:15:09 -07:00
Eric Seidel
03407ba35e Remove custom elements examples, they are no longer maintained
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1022613002
2015-03-18 13:38:17 -07:00
Eric Seidel
d5c07f8564 Update deploy and deploy_sdk for the new package: world.
Before this change Sky would hit 404s when trying to
load examples from domokit.github.io.

I also added a separate sky_home and updated the default
url to point to sky_home instead of home.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1016143002
2015-03-18 13:00:46 -07:00
Rafael Weinstein
8879e082ef Refactor Effen to make explicit the distinction between render & non-render nodes.
All Effen which can directly create a sky.Node are now derived from RenderNode. In contrast, Component now derives from the (now) base Node class which simply represents a position in the Effen hierarchy.

A fair amount of clean-up & refactoring went into this change, simplifying & unifying the "sync" logic between Element & Component as well as making the Component.didMount/didUnmount signals async WRT component building.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1009543008
2015-03-14 17:27:27 -07:00
Adam Barth
10d63a0744 Begin work on the PopupMenu entrance animation
This CL also refactors how animations work, particularly for the Drawer. I've
renamed DrawerAnimation to DrawerController and switched it from being an
Animation to having an Animation. I've also renamed Animation to AnimatedValue
to capture the idea that the class actually presents the value being animated.
Finally, I've factored AnimatedValueListener out of Drawer so that it can be
used by PopupMenuItem as well.

Finally, I've added a scheduleBuild convienence function to Component instead
of having to call setState(() {}), which has come up a couple times.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1016093002
2015-03-18 11:31:07 -07:00
Benjamin Lerman
0723b5dbbd Add an icon for SkyDemo (required by the play store)
R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1018033002
2015-03-18 16:34:40 +01:00
Adam Barth
a8cb46d567 Attempt to fix Android build
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1010213004
2015-03-17 19:51:04 -07:00