37534 Commits

Author SHA1 Message Date
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
Adam Barth
193b416232 SkyShell should implement the rest of dart:sky.internals
R=ianh@google.com

Review URL: https://codereview.chromium.org/1199243003.
2015-06-23 09:49:03 -07:00
Adam Barth
d86ee245ef Silence some analyzer warnings
These warnings were added in the previous CL because we started added a URL
mapping for dart:mojo.internal.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1207453003.
2015-06-23 08:19:54 -07:00
Adam Barth
1b162a56dc Move internals.dart out of Sky SDK
This file doesn't belong in the SDK because it is an implementation detail of
the Sky engine. Instead, this CL moves the code for dart:sky.internals into the
snapshot. This CL is a step towards merging dart:sky.internals with dart:sky,
which also resides in the snapshot.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1200953007.
2015-06-23 07:44:28 -07:00
Adam Barth
be5a54bc4f Make sky/tools/packager build on Mac
This CL removes all C++11 library features from sky/tools/packager because we
can't use C++11 library features on Mac.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1198313004.
2015-06-23 07:41:52 -07:00
Adam Barth
9c97ffd89c Expose the asset_bundle service in SkyShell
The plan is to use this service for game assets and offline assets.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1193763004.
2015-06-22 21:32:48 -07:00
Collin Jackson
900cb7feeb Add Material light and dark themes to Sky widgets
R=ianh@google.com, hixie

Review URL: https://codereview.chromium.org/1204523002.
2015-06-22 17:14:27 -07:00
Eric Seidel
6e87bac4c5 Make the buttons on home.dart fill the screen width again
R=ianh@google.com

Review URL: https://codereview.chromium.org/1197203004.
2015-06-22 17:13:47 -07:00
Eric Seidel
45c57ada22 Replace Sector Layout demo with widgets/sector.dart
The widgets flavor is slightly fancier.

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

Review URL: https://codereview.chromium.org/1196353002.
2015-06-22 15:56:41 -07:00
Hixie
8e82f76119 Add more details to how to debug with gdb.
TBR=eseidel

Review URL: https://codereview.chromium.org/1196223004.
2015-06-22 15:01:13 -07:00
Hixie
4c23f55bc4 Fix mojodb to use the new sky_server API also.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1199063002.
2015-06-22 14:28:41 -07:00
Hixie
a760718570 Update README.md and HACKING.md and resulting yak shave.
Update sky_server:
 - update its help string to admit that it wants the package path as well.
 - be quiet by default, since it makes the build chatty.
 - have a -v for verbose mode, for people who like it chatty.
 - have a default port of 8000, since that's what everyone used.
 - have a -p option to set the port, for people who don't use the default.
 - remove its mapping for gen/, since a TODO told me to.
 - remove the dependency on the build configuration, since it's no longer used.
 - teach it about .dart files.
 - rename sky_server/README to README.md, for consistency with other READMEs.
Update shelldb to speak the new sky_server protocol.
Update tests/services/iframe-embed-vmc.sky since the sky_server change broke the hack it was using.
Update skyserver.py to speak the new sky_server protocol.
Make webkitpy use SkyServer instead of spawning sky_server itself, since a TODO told me to.
Teach webkitpy about dart files.
Teach test_perf about dart files. (untested)
Teach sky_tool about main.dart, main.sky is deprecated. (untested)

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1200993002.
2015-06-22 13:39:16 -07:00
Eric Seidel
6e9c30bfd8 Remove home.sky, update home.dart
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1204483002.
2015-06-22 13:13:27 -07:00
Hixie
e7696e23a3 Factor out the analyzer part of shelldb so we can reuse it in tests.
This also introduces a new set_build_dir command to shelldb so you can
set the build directory without starting sky.

R=abarth@chromium.org, abarth, eseidel

Review URL: https://codereview.chromium.org/1193733004.
2015-06-18 16:54:52 -07:00
Hans Muller
a38f8b65ac StyledText is just a convenient way to specify a
tree of InlineStyle and InlineText elements.
StyledText builds an Inline that renders the tree.

For example this StyledText object:

  new StyledText(["FOO", [boldLargerStyle, [greenStyle "BAR"], "BAZ"] BORF]);

Renders the same way the following HTML would,
assuming that TextStyles boldLargerStyle and
greenStyle were defined.

<style>
div {
  display: inline;
}
</style>
<p>
  <div>
    FOO
    <div style="font-weight:bold; font-size:larger">
      <div style="color:green">
        BAR
      </div>
      BAZ
    </div>
    BORF
  </div>
</p>

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1194693002.
2015-06-18 14:35:11 -07:00