37998 Commits

Author SHA1 Message Date
Chinmay Garde
121bcb827f Make sure skyanalyzer uses absolute paths to construct url-mappings for
dartanalyzer

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1215883006.
2015-06-30 15:29:18 -07:00
Adam Barth
c5deb6f41a 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
5e5b3100a0 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
Adam Barth
280945c6b9 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
fbef1235e0 Fix tabs.dart test results
TBR=abarth

Review URL: https://codereview.chromium.org/1214413002.
2015-06-30 13:32:40 -07:00
Hans Muller
06fb2e9879 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
b6e2a66696 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
983aadfd85 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
aa193c4d27 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
Adam Barth
5c7639c2f5 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
Hixie
52ec1336d6 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
41ffb31681 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
7be6bf978d 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
Raph Levien
1b3bfb2624 Allow clusters to start with zero-width characters
The logic in getRunAdvance() assumed that any zero-width character was
part of the preceding cluster, which is valid most of the time. However,
characters such as ZWNBSP (U+FEFF) renders as a zero width glyph
and is also a grapheme cluster boundary. This patch adds a clause to
handle that case.

Bug: 22121742
Change-Id: Iad79a7d988bded1ef05f0fd7905d20669ea22051
2015-06-30 10:15:43 -07:00
Adam Barth
240f909f91 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
Ian Fischer
5b8c62476d 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
Raph Levien
8726aff8cf Fix logspam and incorrect cluster offset
An incorrect cluster offset calculation was causing a lot of log
messages to appear. Separately, a confusion between #if and #ifdef was
causing unintended logging of line breaks. This patch fixes both.

Bug: 22178333
Change-Id: I2b3673ed66c784f5082fd127a8dc10bd3df6ed79
2015-06-29 14:21:10 -07:00
Ian Fischer
2894f9e7e9 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
Hixie
928fc6cf69 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
Adam Barth
f442a035b8 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
Hans Muller
53e64fc92f 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
9d03a49200 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
1f8c99e1a2 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
a74a7c554e 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
df81cae4c2 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
96a269b4d2 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
ec4b59ff27 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
c2fc0a2c93 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
06cc009b34 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
952dbc73e4 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
9adb7943f3 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
Raph Levien
5704594913 Disable letterspacing for connected scripts
The appearance of letterspacing with scripts with cursive connections
is poor, so we simply disable letterspacing for those scripts. There
may be some cases where some form of letterspacing is desirable, but
this gives the highest likelihood that the final result will be good
without requiring additional work from clients.

Bug: 21935803
Change-Id: Ie25266249ac3a2605aa89ef5132e8edbe3a06d35
2015-06-26 11:15:17 -07:00
Hans Muller
2283541a6b 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
Hixie
0e3f0b30da Let's hide double.INFINITY a bit more, by providing cleaner APIs for the cases where we're currently trying to use it.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1209233002.
2015-06-25 17:27:43 -07:00
Adam Barth
136ae18aa3 Support snapshots in sky_shell (again)
Unbreak support for snapshots now that we have our offline Dart loader. Also,
wire up support for snapshots in sky_shell on Linux.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1212623002.
2015-06-25 17:10:35 -07:00
Adam Barth
21c9976f78 Make it possible to run Sky apps offline
This CL makes it possible to run Sky apps offline by introducing new
DartLibraryProvider subclasses, specifically one that can load directly from
the file system. A future CL will expand this functionality to work with asset
bundles as well.

Currently, the only platform that uses this functionality is Linux, which can
now load a simple Sky app without even loading a network stack. Making this
work on other platforms is work for future CLs.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1203143004.
2015-06-25 13:59:22 -07:00
Carlos Pizano
4dbf8152e7 fix minedigger win bug
Win was not being detected.

BUG=none
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1209823002.
2015-06-24 18:14:51 -07:00
Viet-Trung Luu
5c8b028bd3 Don't use base::WorkerPool in the asset_bundle app.
WorkerPools can't be shut down, which means that the app's .so can't be
unloaded (which is bad for single process mode, and which is probably
why the asset bundle tests are flakily crashing on the try bots).

So use a SequencedWorkerPool instead (even though we don't care about
sequencing).

R=eseidel@chromium.org, kulakowski@chromium.org, abarth@chromium.org
BUG=Fixes #268

Review URL: https://codereview.chromium.org/1206673006.
2015-06-24 15:24:01 -07:00
Raph Levien
e5cb2f787c Separate additional penalty for last line with hyphen
A recent change added a penalty for a hyphen at the last line break,
which is visually undesirable. However, the penalty was assessed to
"widthScore", which broke the assumption (used for another
optimization) that widthScore increases monotonically. This patch
separates the penalty into a different parameter, restoring the
validity of the monotonicity assumption.

Bug: 22066119
Change-Id: I6a47a350ef3ceee2f00ee430d6954d0c307227f0
2015-06-24 14:08:45 -07:00
Carlos Pizano
693b09745f sky home update
-replace UINode for Widget
-add the minedigger demo
-fix spelling of astroids

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

Review URL: https://codereview.chromium.org/1203923006.
2015-06-24 13:43:59 -07:00
Hixie
3e35fb4548 Add support for line-height in TextStyle.
Also, some minor cleanup in TextStyle to make it more readable.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1203253002.
2015-06-24 13:25:17 -07:00
Ian Fischer
cdca813cc1 Updating with a link to the iOS build instructions 2015-06-24 10:58:41 -07:00
Ian Fischer
faa080b738 Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia counterparts.
Also changes the framework dart code to use the
refactored APIs and fixes the various examples and
tests.

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

Review URL: https://codereview.chromium.org/1190123003.
2015-06-24 10:21:45 -07:00
Adam Barth
02b8f70b92 Really remove config.h
This CL generated by |sed -i '/sky\/engine\/config.h/d'| and a manual sweep to
catch some oddballs.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1206763002.
2015-06-23 23:15:28 -07:00
Adam Barth
69e7997ae9 Add support for snapshot loading to Sky
This CL adds the ability to load Dart snapshot files created by sky_packager in
Sky. Using a snapshot lets us transmit all the code for an app in a single blob
and should improve startup time. Later CLs will make this codepath easier to
use and evaluate performance.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1197133004.
2015-06-23 18:40:01 -07:00
Eric Seidel
2c58c80af2 Use new Widgets in mine_digger.
I'm not sure I made it look better.  But it uses Widgets
instead of rolling its own Flex, etc.

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

Review URL: https://codereview.chromium.org/1201293003.
2015-06-23 15:20:44 -07:00
Collin Jackson
2856617d4c Add a confirmation dialog to stock app Settings page and style it by default
R=ianh@google.com, abarth, hixie

Review URL: https://codereview.chromium.org/1201273002.
2015-06-23 14:19:00 -07:00
Adam Barth
c444157614 Port sky_shell to Linux for testing
This CL makes it possible to build sky_shell on Linux. It doesn't do much, but
it doesn't crash on startup. The goal is to evetually be able to test sky_shell
on the bots and to be able to run the test_sky on Mac.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1202323002.
2015-06-23 14:17:02 -07:00
Carlos Pizano
4d6115bed3 Add minedigger example
A very basic minesweeper clone. Currently only tested in linux.

BUG=none
R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1196213012.
2015-06-23 11:19:35 -07:00
Collin Jackson
2a7c9e081c Teach Sky buttons and dialogs how to use the new Theme system
R=eseidel@chromium.org, eseidel

Review URL: https://codereview.chromium.org/1192773004.
2015-06-23 10:12:58 -07:00