2040 Commits

Author SHA1 Message Date
Hixie
41c3e58e27 Use the baseline information exposed by C++ to pipe baseline data through RenderBox.
This also fixes the C++ side to give the right baseline information.
Previously it was giving the baseline distance for the font, but not
for the actual laid-out text.

I considered also providing a "defaultBaseline" accessor that returns
the distance for the actual dominant baseline, but it turns out right
now we never decide the baseline is ideographic. We always use the
alphabetic baseline. We should probably fix that...

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1200233002.
2015-06-24 17:01:14 -07:00
Viet-Trung Luu
29ae65d27f 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
Carlos Pizano
27936d2543 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
a2ba25d0ba 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
Hixie
66fd8e7343 Minor optimisations and cleanup to the text rendering stuff.
R=eseidel@chromium.org, eseidel

Review URL: https://codereview.chromium.org/1210653002.
2015-06-24 12:37:07 -07:00
Hixie
1263707b19 Fix baseline example (missed merge with Ian's new graphics APIs).
TBR=iansf

Review URL: https://codereview.chromium.org/1201383005.
2015-06-24 11:33:54 -07:00
Hixie
dca45e1890 Expose baseline information in the Sky API.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1208483002.
2015-06-24 11:24:45 -07:00
Ian Fischer
e716cc358c Updating with a link to the iOS build instructions 2015-06-24 10:58:41 -07:00
Ian Fischer
1799eacef5 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
fa627b4b0e Factor DartLibraryProvider out of DartLoader
This CL factors the network interactions out of DartLoader into a
DartLibraryProvider interface, paving the way for other library providers
(e.g., offline).

As part of this CL, I've renamed DartLoader to DartLibraryLoader and moved the
class into tonic, where it can't have any direct network dependencies.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1202283004.
2015-06-24 09:32:22 -07:00
Adam Barth
d8d7db82a0 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
3843749afc Remove config.h
This CL removes all the content from config.h. It doesn't actually delete the
file. I'll make that change in a separate CL.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1205793002.
2015-06-23 22:53:38 -07:00
Adam Barth
1f258f383e 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
Viktor Lidholt
c89c751937 Adds basic sprite sheet support to sprites
Adds drawImageRect to Canvas bindings

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1204783003.
2015-06-23 16:38:28 -07:00
Eric Seidel
afdf0b678d 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
ad4757b747 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
31cf589ba7 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
Eric Seidel
2f7934a79f Roll versions in preparation for publishing
Publishing sky to fix sky_tool.

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

TBR=johnmaccutchan@google.com

Review URL: https://codereview.chromium.org/1205653002.
2015-06-23 12:19:09 -07:00
Eric Seidel
085d0f626d Make sky_tool work again after mojom package
We now have to run mojom/lib/generate.dart before we
can launch a sky app. :(

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

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1205623002.
2015-06-23 11:31:45 -07:00
Carlos Pizano
8be204875c 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
Hixie
4064d0c5e7 More stubs in rendering/README.md.
TBR=abarth

Review URL: https://codereview.chromium.org/1198293005.
2015-06-23 10:20:56 -07:00
Collin Jackson
2b73e7288b 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
Hixie
f59f4f2dde Fix the indenting of the toString() output of the RenderTree, which was broken around RenderParagraph.
TBR=eseidel

Review URL: https://codereview.chromium.org/1199913009.
2015-06-23 10:08:13 -07:00
Eric Seidel
e18b005ce7 Fix game to depend on Sky
Also updated the version range on stocks2.

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

R=ianh@google.com

Review URL: https://codereview.chromium.org/1195933004.
2015-06-23 09:55:45 -07:00
Hixie
ae40f8f305 Make the checkbox in settings control the radio buttons in the drawer, to demonstrate how to link state in different places in an app.
R=jackson@google.com

Review URL: https://codereview.chromium.org/1197333002.
2015-06-23 09:54:19 -07:00
Adam Barth
5d2da22836 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
a7b4b3f24a 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
d0f60bc3f5 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
50a92ad78a Remove support for "mojo:" libraries
We ended up using "dart:" instead. This change shouldn't have any observable
effects.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1192743011.
2015-06-23 07:42:28 -07:00
Adam Barth
2bdbd664cf 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
1a5da3ebe5 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
Hixie
2f46329ff3 Prettier arrows in the stock app.
This returns us to a more stocks1-like arrow style.
Also it uses math rather than transforms to rotate the arrow, since transforms are expensive.
It also removes the save/restore calls, which are _really_ expensive.

Also some minor style fixes.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1203443007.
2015-06-22 17:32:25 -07:00
Collin Jackson
5ab01574f4 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
6c2845e9b7 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
Hixie
547e003af7 Short-circuit the relayoutSubtreeRoot when the child couldn't change dimensions anyway because the parent constrained it.
The relayout subtree root concept is intended to handle the case where
a node, when it lays itself out for a second time, changes its opinion
about what dimensions it should be. In such a situation, the parent,
if it based its own opinion about what size _it_ should be on the
child's dimensions, would also need to lay itself out again. Thus,
when this scenario is possible, the child remembers the parent, and
when it would be told to relayout, we actually start the layout with
the parent.

In practice, this chains, and we end up with nodes that point to
ancestors ten or more steps up the tree such that when the inner most
child re-lays-out, the whole app ends up relaying out.

This patch tries to short-circuit this for the case where the
constraints being applied to the child are such that actually, the
child has no choice about its dimensions. In that case, the parent
can't change dimensions when the child re-lays-out.

This makes a huge difference on the stocks demo app. Without this, on
the third rendered frame, there are 72 relayoutSubtreeRoot links, the
deepest chain is 8 deep, and 9 of the chains are only 1 level deep.
With it, there are 63 relayoutSubtreeRoot links, the deepest chain is
only 4 deep, and 38 of the chains are only 1 level deep.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1196553004.
2015-06-22 16:51:25 -07:00
Eric Seidel
65bb890d9d 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
203c588b5e Make wavy underlines go all the way to the end of the inline.
Previously, the wavy underline code only knew how to draw a complete
period.

This change adds the ability to draw a partial period of the wave.

Previously, the code tried, but failed, for reasons I cannot
determine, to fit the width of the inline by extending the period to
be an integral factor of the width.

This is bad because as you type text, the underline wave of earlier
characters would jiggle.

This fixes that by not changing the period of the wave when the length changes.

It's interesting to compare this to the previous code. Here's a test
that shows this in Safari/Chrome:

   http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=3543

Notice how as you type "i"s, the underline changes how far it extends
(obviously a bug) but also what the period of the wave is (which looks
especially ugly when typing).

Firefox, on the other hand, renders something that isn't actually a
wave; it's a saw-tooth pattern with straight lines between each
direction change. This works for small font sizes at low densities,
but is not great on modern screens.

This CL addresses this issue by computing the bezier curve control
points for the curve that consists of just the remaining fraction of
the period. To do this, however, it allocates an object and solves a
bezier for x (which includes a numerical integration), which is
certainly a performance concern. Apps that try to wavy-underline an
entire UI are going to maybe suffer. Since this is typically going to
be used for spelling checkers, it means people who spell better will
have better performance.

(I haven't tested this to see what the perf impact actually is. If
it's actually bad, we can probably cache the results of the
integration pretty trivially.)

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1189403005.
2015-06-22 15:43:06 -07:00
Hixie
e2454a87fc 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
6183bdf2b2 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
3ed42112b0 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
Hixie
d91c808341 Placeholder for sky/engine/README.md.
TBR=eseidel

Review URL: https://codereview.chromium.org/1198323003.
2015-06-22 13:36:43 -07:00
John McCutchan
e855c0e1bc Add Observatory mojo_shell hearbeat test
Fix HTTP requests

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1191253005.
2015-06-22 13:27:35 -07:00
Eric Seidel
c714cf636a 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
Collin Jackson
884b4e36dc Add a new Theme widget to control color and text color of apps
R=abarth@chromium.org, abarth, hixie

Review URL: https://codereview.chromium.org/1194743003.
2015-06-22 12:10:30 -07:00
Eric Seidel
8a5bd9b676 Roll versions in preparation for deploying a new SkyDemo.apk
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/1197113003.
2015-06-22 11:36:42 -07:00
Viktor Lidholt
e90de2b652 Adds API documentation, improves the API names, and cleans up code.
R=ianh@google.com

Review URL: https://codereview.chromium.org/1201983004.
2015-06-22 10:13:23 -07:00
Adam Barth
0aca63c7d6 Update sky/README.md to refer to Sky Widgets
Previously this README discussed fn.dart.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1199753002.
2015-06-21 12:22:49 -07:00
Adam Barth
4365f77f90 Add black and white constants to theme's colors.
They're in the Material design color palette. This also adds a file-level
dart doc comment.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1190413003.
2015-06-19 22:13:01 -07:00
Hans Muller
8903653453 EditableText underlines the word being edited
Also restored the blue line that appears below
focused Input text.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1194113002.
2015-06-19 16:50:03 -07:00
Hixie
a12d43dc58 Turn on wavy underlines. The waves aren't very pretty yet (they are too short somehow), I'll fix that in a subsequent CL.
I abstracted out the wavy underline code so that it doesn't duplicate the code for horizontal and vertical lines.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1201503003.
2015-06-19 16:11:18 -07:00