37534 Commits

Author SHA1 Message Date
Keisuke Kuroyanagi
8081d06133 Fix: getOffsetForAdvance can return worng offset.
searchStart was passed to getRunAdvance, but it can be
different from the start that has been used to initialize
Layout object. As a result, wrong index could be used in
getRunAdvance.

Bug: 21744454
Change-Id: Ibe83cc50ed6f0da2a1532318bc224502be350699
2015-06-10 17:45:46 +09:00
Ian Fischer
08bd78a9eb Update the native_viewport interface to allow specification of the surface configuration, currently only needed for and used by EGL on Android.
This also fixes an issue where eglChooseConfig was
only being called in InitializeOneOff, which is
only called once per process.  This CL makes
choosing the config happen once per GLSurface
instead, which will ultimately permit apps to
create multiple native_viewports with different
surface configurations on the same display.  The
eglDisplay object is still a global, though.

R=abarth@chromium.org, viettrungluu@chromium.org, jamesr@chromium.org

Review URL: https://codereview.chromium.org/1168993002.
2015-06-09 16:50:28 -07:00
Eric Seidel
413080ef6a Make it possible to navigate from a SkyView to a WebView.
This would occur when bringing SkyDemo to the front after
having viewed a SkyView based demo and then paused
the SkyActivity (by going to the Android Launcher, etc.)

I also fixed deploy_domokit_site.py to ignore .gitignore files
found in packages.  We should actually probably ignore these
when creating the packages in the first place, but
this check seems valid regardless.  The .gitignore for
sky/lib/assets was causing the assets not to get pushed
to the demo site.

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

Review URL: https://codereview.chromium.org/1163323007.
2015-06-09 15:10:14 -07:00
Adam Barth
f5d736743c Fix the Sky tests
Instead of triggering layout synchronously during AppView construction, we now
schedule the initial layout using a magic bootstrapping function.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1172123003.
2015-06-09 14:07:17 -07:00
Eric Seidel
783ef15a58 Resurrect deploy_sdk and make it use prepare_pub_packages.py
Works like a charm, and is now much simpler thanks to John's work.

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

Review URL: https://codereview.chromium.org/1174683003.
2015-06-09 13:18:59 -07:00
Adam Barth
d62660ebd8 Update HACKING.md 2015-06-09 11:27:52 -07:00
Benjamin Lerman
ffac6b901d Sky: Use the authenticated network service.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1146813013
2015-06-09 09:46:18 +02:00
Raph Levien
19c69aef98 Increase hyphenation penalty for short last line
Tuning for hyphenation parameters. We discourage hyphenation on the
last line, but offset this penalty by also applying a penalty for
each line, which optimizes for minimizing the number of lines. Thus,
when hyphenation can reduce the number of lines, it increases the
chance they're used.

There's probably more tuning and refinement that can be done, but
testing suggests that the tunable parameters are appropriate.

Bug: 20883322

Change-Id: Ida7eaf8aced109e426694f5a386924a842d29c4b
2015-06-08 15:23:20 -07:00
Adam Barth
fc9e878b19 Split getIntrinsicDimensions into four pieces
This CL splits getIntrinsicDimensions into getMinIntrinsicWidth,
getMaxIntrinsicWidth, getMinIntrinsicHeight, and getMaxIntrinsicHeight so that
we can properly shrink-wrap the stocks app menu. This CL just contains the
refactoring. The use in stocks app will come in a later CL.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1167293003
2015-06-08 14:40:34 -07:00
Hixie
5c0fd999ae Convert everything in the Sky API from degrees to radians.
Radians are the one true angle unit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1164393002
2015-06-08 14:38:06 -07:00
Hixie
086c921ccd Rename Container's desiredSize argument to width and height arguments.
Also change SizedBox.

This makes the code that uses Container() and SizedBox() much more readable.

The underlying RenderSizedBox is not affected by this change.

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

Review URL: https://codereview.chromium.org/1166203002
2015-06-08 14:36:19 -07:00
Collin Jackson
e9d5b13415 Sky support for flexbox justify content
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1164363002
2015-06-08 14:14:02 -07:00
Eric Seidel
c71032ce2e Stop leaking the TracingController's BroadcastReciever
https://github.com/domokit/sky_sdk/issues/23

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1150263003
2015-06-05 14:09:30 -07:00
Eric Seidel
bd7c9160e6 Various fixes in preparation for deploying
Fixed the mojo deploy script to no longer deploy mojo.
mojo now uses a more sophisticated CDN, etc.

Fixed old fn.dart to work again. :)  Looks like it was
victim of a mass rename.

Fixed engine.cc to be able to handle navigating from
WebView content to SkyView content.  We can't handle
the other direction yet, but we don't need to.
/sky_home is written in the .sky system but all of our
new examples are .dart (and thus SkyView).

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1165003006
2015-06-04 16:48:09 -07:00
Hixie
daae863aab Rename "BorderSide.None" to "BorderSide.none", since it's a constant, and change the sky.Size.infinite() constructor to a constant.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1158263005
2015-06-04 16:17:20 -07:00
Hixie
0f1df21be9 Style guide says enum values should be lowerCamelCase.
https://www.dartlang.org/articles/style-guide/#names

R=jackson@google.com

Review URL: https://codereview.chromium.org/1158813004
2015-06-04 12:24:10 -07:00
Hixie
94c76c9914 Enable RenderDecoratedBox to draw borders.
Currently supports only solid borders, but of any colour and size, independently controlling each side.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1154903006
2015-06-04 10:50:59 -07:00
Adam Barth
548c01e233 Fix build after hixie's rename
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1164073002
2015-06-04 10:49:05 -07:00
Hixie
fe468da15d Rename RenderNode to RenderObject.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1165013003
2015-06-04 10:45:21 -07:00
Adam Barth
edffa0b19d Remove outdated copy of download_material_design_icons
The current copy is in //sky/sdk/lib.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1160393003
2015-06-04 08:43:00 -07:00
Adam Barth
183b03d9de Rename skydb to mojodb
The skydb tool is actually used to run many mojo apps that aren't related to
Sky.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1164023004
2015-06-03 17:03:42 -07:00
Adam Barth
0ee0a0c53b Fix gesture events in fn2
This CL makes gesture events work again in fn2.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1146923005
2015-06-03 16:06:15 -07:00
Collin Jackson
da5e6c9a97 Implement RenderImage and Image for Sky
This also fixes a bug that was preventing markNeedsLayout from working

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

Review URL: https://codereview.chromium.org/1160013004
2015-06-03 15:17:12 -07:00
Matt Perry
6213436a7d Update BoxDecoration and RenderParagraph to use sky.Color instead of int.
Also add operator==, hashCode, toString, and some basic Color constants to
Color.

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

Review URL: https://codereview.chromium.org/1162023004
2015-06-03 16:57:04 -04:00
Eric Seidel
54e652d365 Don't run adb as part of shelldb boot
This defers running adb until we actually need the device-id
which makes shelldb not crash when adb isn't avaiable.

I also fixed to use ADB_PATH.

Chinmay ran into this when trying shelldb on Mac.

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

Review URL: https://codereview.chromium.org/1161843007
2015-06-03 11:20:33 -07:00
Eric Seidel
8d6e3bef6e Fix min/max typo in BoxConstraints.deflate
R=ianh@google.com

Review URL: https://codereview.chromium.org/1153413003
2015-06-03 11:12:17 -07:00
Hixie
d8c996994d Fix logic in RenderPadding.
Previously, we were not adjusting the minimum width, so we ended up
offsetting the child but not shrinking it, when the parent expected
the child to be exactly fit to its dimensions.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1155303005
2015-06-03 10:25:05 -07:00
Adam Barth
557b3e1ca4 Add support for transforms to container
These transforms are currently very basic but they seem to mostly work.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1152273004
2015-06-03 10:20:33 -07:00
Adam Barth
1777c1540d Implement Container in fn2
This CL is a first pass at implementing container in fn2. In this approach,
Container is a Component that builds a number of RenderNodeWrappers depending
on what is needed.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1158983005
2015-06-02 15:07:02 -07:00
Hixie
a065844c33 Rename rendering/render_*.dart to rendering/*.dart
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1166773003
2015-06-02 13:55:20 -07:00
Adam Barth
454087b0df Add BlockContainer to fn2
BlockContainer uses a RenderBlock to lay out its children.

R=eseidel@chromium.org, jackson@chromium.org

Review URL: https://codereview.chromium.org/1166473005
2015-06-02 12:19:25 -07:00
Adam Barth
a9d7d8f417 Mark fn2's EventListenerNode work for PointerEvent
Prevously we listened for events on the document and then walked up the
component hierarchy looking for EventListenerNodes. Now we do something similar
by hooking the event dispatching logic in the AppView.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1153343004
2015-06-02 12:18:13 -07:00
Przemyslaw Pietrzkiewicz
4f0c93659b Connect mojo:debugger to window_manager only when requested.
This patch makes mojo:debugger automatically connect to window_manager
only when run by skydb, so that running the debugger for tracing and
profiling doesn't bring the side-effect of spawning window_manager.

Note that we might in the future change this to make the connection to
window_manager lazy when load() or reload() is requested, but this would
require a more involved change to skydb. The way taken in this patch
doesn't change the skydb codepath while enabling usage of debugger for
interactive tracing / profiling.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1157253007
2015-06-02 17:40:05 +02:00
Raph Levien
414664f969 Merge "Use context start correctly in getRunAdvance" into mnc-dev 2015-06-01 21:33:48 +00:00
Raph Levien
b77d0bd01b Use context start correctly in getRunAdvance
We were not taking context start into account when deciding whether
to split a ligature, which was causing inconsistent behavior. This
patch consistently references the widths array relative to the start
of the context.

Bug: 21549197
Change-Id: I7c71e10c1af84354fefe782fc0b87120016e6555
2015-06-01 14:27:00 -07:00
Raph Levien
e6fff385b6 Disable hyphenation for unreasonably long words
Very long words cause O(n^2) behavior. These are unlikely to happen in
real text, but do happen with synthetic strings, so in those cases we
just disable hyphenation.

Bug: 20790394
Change-Id: Idf957dd40b24efe1476f619f17093a48b5bc56f7
2015-06-01 12:46:47 -07:00
Przemyslaw Pietrzkiewicz
071910999a Pull Sky debugger up to services/debugger.
Sky debugger is a native mojo app that puts up an http server and talks
to other mojo apps in response to http requests, allowing to
interactively start/stop tracing, profile, etc.

This is generally useful also when one does not run mojo_shell through
skydb, hence this patch pulls the debugger into services/debugger.

We can then add plumbing for running with the debugger in devtools.

Bug: domokit/devtools/#4.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1151573010
2015-06-01 19:05:15 +02:00
Eric Seidel
8dcd36b95b Fix skydb on linux when adb is not in path.
TBR=iansf@google.com

Review URL: https://codereview.chromium.org/1159193003
2015-05-29 15:38:59 -07:00
Eric Seidel
f4971649a5 Make --gdb and gdb_attach mostly work in shelldb
I'm not sure this is 100% working, but hopefully this
will help get jackson@ up and running with a shelldb
workflow.

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

Review URL: https://codereview.chromium.org/1167513003
2015-05-29 12:31:22 -07:00
Eric Seidel
78be882cb4 Fix sky_server.py on Mac and make sky_server executable if it's not already
R=eseidel@chromium.org, eseidel

Review URL: https://codereview.chromium.org/1161133002
2015-05-29 10:47:16 -07:00
Ian Fischer
a439f7504e Cache .so files for debugging per device and don't redownload .so's that are in your cache
BUG=
R=eseidel@chromium.org, eseidel

Review URL: https://codereview.chromium.org/1158493005
2015-05-28 17:41:49 -07:00
Hixie
30035f03b5 Make our raw/ tests actually check the paint output.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1153053012
2015-05-28 17:35:59 -07:00
Adam Barth
798729bcf4 Split layout2.dart into several files
Previously layout2.dart was a thousand lines long.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1161003002
2015-05-28 16:42:04 -07:00
Hixie
57d269086c Make RenderParagraph mutable, and make it fit the new RenderNode protocols
R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1165463002
2015-05-28 15:19:36 -07:00
Adam Barth
95333572dd Replace BoxDimensions with sky.Size
R=ianh@google.com

Review URL: https://codereview.chromium.org/1150253005
2015-05-28 14:29:29 -07:00
Adam Barth
6ddb6c5b09 Move simple_render_tree into tests as render_flex
R=ianh@google.com

Review URL: https://codereview.chromium.org/1146123003
2015-05-28 14:29:10 -07:00
Eric Seidel
46b12b313c Add hello_fn2.dart and make Text("Hello fn2") actually render something.
R=ianh@google.com

Review URL: https://codereview.chromium.org/1160843005
2015-05-28 13:56:36 -07:00
Adam Barth
2a27cc84ce Introduce RenderProxyBox and RenderSizedBox
Also makes Point, Size, and Rect immutable.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1162033002
2015-05-28 13:39:26 -07:00
Adam Barth
0a6723479e Use Point, Size, and Rect in layout2.dart
R=ianh@google.com

Review URL: https://codereview.chromium.org/1156303004
2015-05-28 12:42:54 -07:00
John McCutchan
ae8299a784 Roll Dart forward
BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1159443002
2015-05-28 07:45:06 -07:00