2104 Commits

Author SHA1 Message Date
Adam Barth
826956d14d Remove the ability to load ".sky" files
Please use ".dart" files instead.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1222483002.
2015-06-30 14:48:32 -07:00
Viktor Lidholt
7e38a80358 Updates sky_server has for Mac
BUG=
R=abarth@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1221893002.
2015-06-30 14:47:11 -07:00
Hixie
430e80e9ea Improve the padding and sizing of popup menus.
Note that this wildly breaks the vertical alignment of menu items, I'll fix that in a subsequent CL.
(It wasn't really working before either, but looked ok by pure luck.)

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1215613005.
2015-06-30 13:56:40 -07:00
Adam Barth
661906e733 Port remaining Sky tests to the new world
These tests now run in the DOM-less world.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1212163009.
2015-06-30 13:53:20 -07:00
Hans Muller
42490925a6 Fix tabs.dart test results
TBR=abarth

Review URL: https://codereview.chromium.org/1214413002.
2015-06-30 13:32:40 -07:00
Hans Muller
28c753500a Gratuitous tabs example enhancement
Demo all three varieties of TabLabels in 3 different
TabNavigators. Use another TabNavigator to select
among the three Card-encapsulated demos.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217243005.
2015-06-30 12:59:51 -07:00
Hixie
1351488a17 Remove Material's opinion about background colours, since in fact the background colour varies dramatically with the kind of material involved.
Also:
- give users of Material who previously relied on Material's defaults
  opinions about background colours
- reindent stock_row.dart
- import colors as colors in example/widgets/styled_text.dart, rather
  than in global scope, for consistency with other files
- import typography as typograpyh in example/widgets/tabs.dart, rather
  than in global scope, for consistency with other files
- make flat_button actually be transparent by not painting a
  background, rather than painting 0x00000000. This is the what I
  actually originally set out to do here.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217293003.
2015-06-30 12:48:04 -07:00
Adam Barth
560477f3ba Remove Sky tests that we don't intend to port to the new world
These tests are for aspects of the Sky engine we plan to remove along with
support for the old world.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1215063003.
2015-06-30 12:42:54 -07:00
Adam Barth
0080da1fe6 Fix import typo in network.sky test
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1218903004.
2015-06-30 12:27:34 -07:00
Hixie
998895d9b8 Random cleanup of various Dart things in our tree.
I ran this and fixed some of the warnings flagged:
cd ~/dev/mojo/src/sky && find engine/core/painting sdk/example sdk/lib -type f -name '*.dart' | perl -nE 'chomp; local $/ = undef; open(FILE, $_); my $file = <FILE>; print $file; next if $file =~ /^part of/om; say "import \"$_\";"' > all.dart && shelldb analyze all.dart 2>&1 | grep -v 'sky/all.dart'

Then I loaded the affected examples and fixed any bugs I found from running them.

Major change to SDK:

- Fix RenderPadding to get a valid size when it has no child (it was
  previously sizing itself too small by the padding amount).

Minor changes, mostly to examples:

- Fix the 'part of' lines in sky_shell_dart_controller_service_isolate
  to match the library name given in main.dart.

- Remove unused imports in various places.

- Fix example/game/lib/texture.dart to use the new Rect creation APIs.

- Remove unused code in example/mine_digger/lib/main.dart.

- Fix example/raw/hello_world.dart to use the new Size.center API.

- Fix example/rendering/baseline.dart and
  example/rendering/justify_content.dart to have readable text.

- Fix compile error in example/rendering/transform.dart.

- Extend the debugDoesMeetConstraints() method to print useful
  information when it will be used to fire an assert.

- Remove a warning about abstract methods on RenderView that would for
  some reason only sometimes get flagged by the analyzer.

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

Review URL: https://codereview.chromium.org/1215163003.
2015-06-30 12:03:50 -07:00
Adam Barth
ecc5134416 Remove package:sky/framework
Please use package:sky/widgets instead.

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

Review URL: https://codereview.chromium.org/1221883002.
2015-06-30 12:01:54 -07:00
Adam Barth
654bac0d61 Stop building stocks.skyx
One of the build bots is missing the yaml package. Reverting until we sort out
how to fix that bot.

TBR=jackson@google.com

Review URL: https://codereview.chromium.org/1217863003.
2015-06-30 11:51:53 -07:00
Hixie
80d6a881ca Fix all the components to pick the right colours from the theme.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1217573003.
2015-06-30 11:50:14 -07:00
Adam Barth
2f4e404f7f Build stocks.skyx
This CL teaches the build system how to create the stocks.skyx application
bundle. This bundle contains the stocks snapshot as well as the material design
assets needed by the stocks app to run offline.

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

Review URL: https://codereview.chromium.org/1216273002.
2015-06-30 11:16:35 -07:00
Adam Barth
7d7cde505f Download material design icons using DEPS
We need the material design icons at build time in order to build Sky
application bundles that include the icons. Therefore, we need can't wait until
runtime to download the icons.

Also, rather than copying all the icons into each out directory, we just
symlink to the copy in the source tree.

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

Review URL: https://codereview.chromium.org/1217283002.
2015-06-30 10:32:09 -07:00
Adam Barth
205ab9f778 Add a script for packaging Sky bundles
This script consumes a sky.yaml file and produces a bundle that contains the
listed material design assets as well as the snapshot binary. This script isn't
wired into the build system yet because we don't yet download the material
design icons using DEPS.

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

Review URL: https://codereview.chromium.org/1220893002.
2015-06-30 10:22:02 -07:00
Viktor Lidholt
652625a9fb Adds particle systems to sprites
Adds color sequence class
Refactors drawing of textures

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1216573009.
2015-06-29 18:08:28 -07:00
Collin Jackson
abb5961f5a Fix padding on Sky home screen scrollable list
R=chinmaygarde@google.com, abarth

Review URL: https://codereview.chromium.org/1209413006.
2015-06-29 18:02:40 -07:00
Ian Fischer
8dd65afbdf Add APIs for dynamic display lists, using SkDrawable and SkPictureRecorder::endRecordingAsDrawable.
R=abarth@chromium.org, abarth@google.com, ianh@google.com

Review URL: https://codereview.chromium.org/1221583003.
2015-06-29 17:23:51 -07:00
Hans Muller
783630b6ba Theme Input, style EditableText, restore text input cursor
The Input component conforms a little more closely
to the Material spec:
http://www.google.com/design/spec/components/text-fields.html#text-fields-single-line-text-field

Added a TextStyle attribute to EditableText and "themed" the text style for Input.

Restored the blinking EditableText input cursor.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1216133002.
2015-06-29 17:00:27 -07:00
Hixie
3ab1bb13a9 Add a new item to the settings page to show off the switch widget.
R=abarth@chromium.org, jackson@google.com

Review URL: https://codereview.chromium.org/1214113006.
2015-06-29 16:57:57 -07:00
Hixie
1a7b2966bc Remove all the caching of Theme data, since perf data suggests it wasn't helping.
R=abarth@chromium.org, jackson@google.com

Review URL: https://codereview.chromium.org/1217473007.
2015-06-29 16:56:54 -07:00
Adam Barth
b38ae4abe8 Fix corrupted rendering of images
When navigating from one app to another, we create a new Android window and
destroy the old one. Previously, when we destroyed the old window after
creating the new window, we would destroy the Ganesh context after making the
GL context for the new window current, causing us to corrupt the GL state in
the new window. After this CL, we call MakeCurrent before destroying the Ganesh
context so that it interacts with the proper GL context.

R=jackson@google.com

Review URL: https://codereview.chromium.org/1214263002.
2015-06-29 16:40:09 -07:00
Collin Jackson
ef6ebb7e76 Support for background images on cards, style demo home
R=ianh@google.com, abarth, hixie

Review URL: https://codereview.chromium.org/1217623002.
2015-06-29 16:22:22 -07:00
Hixie
05aafdbdfd Very minor clean-up of stocks app main.dart.
TBR=abarth

Review URL: https://codereview.chromium.org/1217113002.
2015-06-29 15:58:17 -07:00
Hixie
8bb10e6c96 Turn off the code that is forcing stocksapp to build 50 times a second, and change the code that tracks frame times to be a bit cleverer.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1216973005.
2015-06-29 15:42:16 -07:00
Ian Fischer
1dd9c9a5f8 Fix tests broken by default text color change.
R=abarth@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1215023003.
2015-06-29 14:57:58 -07:00
Ian Fischer
c4db2df60f Rename RenderCanvas to PaintingCanvas to avoid confusion with other classes that inherit from RenderObject.
R=ianh@google.com, abarth@google.com

Review URL: https://codereview.chromium.org/1217933002.
2015-06-29 14:19:30 -07:00
Adam Barth
8633179599 Don't crash when decoding an invalid handle
We shouldn't try to drain a data pipe when we have an invalid handle. Instead,
we should just call the callback with |null|, like we do for decoding failures.

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

Review URL: https://codereview.chromium.org/1213313002.
2015-06-29 14:07:06 -07:00
Hixie
6818693903 Fix tests which broke in https://codereview.chromium.org/1216013003.
Actually the tests broke in 136e0d4da5
...but I had reset the results because I had changed all the coordinates, and didn't realise some of the changes were bad.

TBR=abarth

Review URL: https://codereview.chromium.org/1212803003.
2015-06-29 14:04:58 -07:00
Hixie
1d78945cf4 Fix theme changing: turns out we were not reparenting stateful surviving nodes when their parents changed identity
This also makes the optimistic/pessimistic mode switch change the active theme, because why not.

While I was at it I also provided a debug boolean argument to runApp() to make it possible to profile more easily.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1215023002.
2015-06-29 13:56:18 -07:00
Ian Fischer
de574c7442 Set the default text color to white
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1215893002.
2015-06-29 13:33:43 -07:00
Hixie
4919c94b4e Fix the floating action button.
Turns out I had misimplemented Rect.center.

While I was here, I also implemented Rect.width and Rect.height (to
help avoid making that mistake again), and copied shortestSide from
Side to Rect so that we can avoid having to allocate a Size to get the
shortest side from a Rect.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1216013003.
2015-06-29 13:07:10 -07:00
Adam Barth
9062c56136 Make it possible to run a test in sky_shell
This CL makes it possible to run sky/tests/raw/bogus_import.dart in sky_shell
on Linux. We'd eventually like to scale this up to running all the tests.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1218633003.
2015-06-29 10:39:44 -07:00
Eric Seidel
3dd4fc9bb9 Roll Version in preparation for publishing
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1219683005.
2015-06-29 10:32:12 -07:00
Adam Barth
fd9f6f13bf Make rebuilding faster
By profiling mine_digger in a continuous rebuild loop, we observe
Widget#syncChild as being very hot. This CL optimizes this function by making
sure to read each input value exactly once.

Also, the hash operations for _mountedChanged were showing up on the profile,
so this CL makes _mountedChanged into a List, which should work fine.

Together, these changes reduce the amount of time we spend in Navtive code
inside the VM from 29% to 20%.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1217473004.
2015-06-29 10:20:54 -07:00
Hans Muller
ad3fae3931 Add TabNavigator
A simple container for a TabBar. It is defined by a list of
TabNavigatorViews, each of which is just a TabLabel and
the tab's content.

The content of each tab is represented by a function
that produces a Widget called "content". I couldn't
bring myself to call it buildTabContentCallback or something
else more specific.

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

Review URL: https://codereview.chromium.org/1212993003.
2015-06-29 10:03:28 -07:00
Hixie
6ed5b43877 Instead of applying a transform for every RenderObject, pass down an Offset for where to paint.
This should be a perf win, but I haven't tested it.

Also adds an operator overloading such that Offset + Size -> Rect.
Also adds Rect.fromLTWH().

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1209413004.
2015-06-29 09:07:13 -07:00
Adam Barth
330f002b9e Update Stocks.apk build tech
Instead of having a one-off //sky/apk/stocks, we now use the |sky_app| GN
template to create Stocks.apk directly from //sky/sdk/example/stocks.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1211883004.
2015-06-27 00:41:27 -07:00
Adam Barth
ce5baf1e9d Move //sky/compositor to //sky/viewer/compositor
This library is logically part of //sky/viewer and shouldn't clutter up the
top-level //sky directory.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1213683004.
2015-06-27 00:26:52 -07:00
Adam Barth
567c659122 Remove sky/benchmarks
These benchmarks are very out-dated. In fact, they're still written in
JavaScript and mostly test the performance of the DOM.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1216823002.
2015-06-27 00:02:10 -07:00
Adam Barth
46363355ba Cleanup sky/sdk/examples
* Remove all the DOM-based examples except for the old stocks app
* Rename stocks2 to stocks
* Promote hello_widgets.dart to a top-level hello_world example

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1219493003.
2015-06-27 00:00:18 -07:00
Adam Barth
0bc960761a Add MineDigger.apk that works offline
This CL builds an APK for MineDigger that works offline. We use |sky_packager|
to snapshot the Dart code, which we then extract from the APK during startup.
If we succeed in extracting a snapshot, we load it by default.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1211253004.
2015-06-26 23:18:13 -07:00
Adam Barth
06adbc9aa6 Move examples to //sky/sdk/example
We're trying to follow the pattern described in https://www.dartlang.org/tools/pub/package-layout.html

TBR=iansf@google.com

Review URL: https://codereview.chromium.org/1210173004.
2015-06-26 22:52:40 -07:00
Hans Muller
dcabb54ad9 Make TabBar conform to the Material spec for icon/text tabs
When both icons and text are specified, the icon goes on top,
10 pixels of margin goes in between, and the TabBar's height
grows to 72.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1213043002.
2015-06-26 16:16:00 -07:00
Hixie
fa70eb0982 Split Size into Size and Offset.
Added a OffsetBase class that Size now inherits from, and added a new
Offset class that also inherits from OffsetBase.

Offset has:
 - dx and dy members
 - zero and infinite static constants
 - a method that returns a new Offset that's the existing one scaled
   by a scalar
 - a unary minus operator
 - operators overloads such that subtracting or adding two Offsets
   gives another Offset
 - a toPoint() method

Added Offset and Size to the dart bindings, so they can be used from C++.

Changed the Canvas API to use Point, Size, and Offset where appropriate:
 - drawLine uses Points now
 - drawCircle uses a Point now
 - drawImage uses a Paint now
 - the constructor uses a Size

Changed Point as follows:
 - added a unary minus
 - Point difference now gives an Offset rather than a Size
 - You can add an Offset to a Point to get a new Point
 - toSize() has been replaced by toOffset()

Changed Rect as follows:
 - renamed upperLeft and lowerRight to topLeft and bottomRight for
   consistency with our other APIs
 - added bottomLeft and topRight for completeness

Changed Size as follows:
 - now inherits from OffsetBase
 - added *, /, ~/, and % operators for scaling sizes
 - subtracting a Size from a Size gives an Offset
 - subtracting an Offset from a Size gives a Size
 - changed the + operator to take an Offset instead of a Size
 - added topLeft, bottomLeft, topRight, bottomRight to match Rect
 - added center for the same reason
 - added shortestSide getter since that was a common pattern
 - removed toPoint()

Changed DrawLooperLayerInfo as follows:
 - setOffset member takes an Offset instead of a Point

Changed BoxConstraints as follows:
 - added biggest getter since it was a common pattern
 - added smallest getter for symmetry

Changed BoxShadow as follows:
 - offset member is an Offset rather than a Size

Changed ViewConstraints as follows:
 - replaced height and width members by a single size member

I did some minor code cleanup in nearby files while I was there,
including sorting sky/engine/core/core.gni alphabetically, and fixing
some warnings in the examples.

BUG=
R=abarth@chromium.org, chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1214833004.
2015-06-26 15:21:29 -07:00
Ian Fischer
6ae1de6c46 Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1218593002.
2015-06-26 15:06:40 -07:00
Hans Muller
df8f39f2aa Corrected a childCount assert
It's a typo I introduced in https://codereview.chromium.org/1217533002

TBR=ianh

Review URL: https://codereview.chromium.org/1221473002.
2015-06-26 12:57:07 -07:00
Hans Muller
06af2f7d15 Add RenderObject.childCount
R=ianh@google.com

Review URL: https://codereview.chromium.org/1217533002.
2015-06-26 11:17:31 -07:00
Hans Muller
ce7e8260c3 Use Theme to define the colors and TextStyles for Tab, TabBar
Also added a smoke test for examples/widgets/tabs.dart.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1213873002.
2015-06-26 09:30:53 -07:00