874 Commits

Author SHA1 Message Date
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
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
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
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
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
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
John McCutchan
0043e2abf8 Roll dart forward
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1199483004.
2015-06-19 13:23:29 -07:00
Adam Barth
fd4527dd4a Don't crash if you call document.createText(null)
Fixes #165.

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

Review URL: https://codereview.chromium.org/1196463002.
2015-06-18 12:17:05 -07:00
Matt Perry
edff56d399 Add a Paint::toString() method to describe our Paint objects.
Add a test for RenderDecoratedBox sets up the Paint object correctly.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1185423003.
2015-06-18 13:47:28 -04:00
Adam Barth
381c19e075 If Color constructor is passed a value > 0xFFFFFFFF, Sky crashes
We now ensure the color is <= 0xFFFFFFFF.

Fixes #245

R=ianh@google.com

Review URL: https://codereview.chromium.org/1179413008.
2015-06-18 10:32:26 -07:00
Adam Barth
0e493b017f Implement ColorFilter in widgets/basic.dart
Also, trim the redundant |Mode| suffix from the TransferMode names.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1188003006.
2015-06-17 17:06:27 -07:00
Ryan Macnak
9cdd8bb8c7 Track changes to standalone vmservice in mojo and sky embedders.
Standalone changes were in https://codereview.chromium.org/1166433008/

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1183453004.
2015-06-16 16:58:48 -07:00
Adam Barth
883f673a6b Update Dart dependency and patch dart_controller to account for non-backwards compatible API update
Patch originally by chinmaygarde.

R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1185233002.
2015-06-15 18:34:27 -07:00
Chinmay Garde
9bf2fe7f3a Revert "Update Dart dependency and patch dart_controller to account for"
This reverts commit 42bb335967d4d9cbeb1a745111dd0fff985465f2.
2015-06-15 15:32:28 -07:00
Chinmay Garde
e027c6b874 Update Dart dependency and patch dart_controller to account for
non-backwards compatible API update

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1183253002.
2015-06-15 15:11:31 -07:00
Adam Barth
4fb2c9ffb0 Add missing dependency to the build
We've had a number of reports of a missing dependency in the build. I managed
to reproduce the issue locally today and this patch fixed the issue I was
seeing. Hopefully it fixes the issues other folks were seeing too.

The problem was that the C++ code we generate from IDL files depended on
various event classes in core, which in turn depended on the generated event
names files. This CL ensures that the event names files are created before we
try to build the C++ code generated from the IDL files.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1178173004.
2015-06-13 09:47:36 -07:00
Hixie
9fc0a3f2ae Verify that callers correctly set parentUsesSize if they use the child's size (and fix a few cases that didn't).
This introduces a bunch of code that should only run in debug builds, but we don't have #ifdefs yet.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182933003.
2015-06-12 17:09:57 -07:00
Eric Seidel
518ecd24e5 Add support for text styles.
This is a completion of Hans's WIP patch:
https://codereview.chromium.org/1176133002/

Makes it possible for us to style text in fn2 apps.

The title style in the toolbar doesn't look quite right
but as far as I can tell its the same color as the
old typography code produced.  Will need further investigation.

Fixes #213

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

Review URL: https://codereview.chromium.org/1178913003.
2015-06-12 12:28:52 -07:00
Adam Barth
2795216f6a Wire up Android back button in SkyShell
The back button now triggers an event of type |back|.

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

Review URL: https://codereview.chromium.org/1176373004.
2015-06-11 14:33:01 -07:00
Eric Seidel
c1cad6ccda Don't crash when main.dart is a 404.
Ideally we would show a failwhale or some such, but
I don't know how we would bundle that file with our
APK yet.

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

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182633002.
2015-06-11 14:07:49 -07:00
Matt Perry
583b126b57 Remove redundant Paint.setARGB in favor of assigning to Paint.color.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182563002.
2015-06-11 15:43:53 -04:00
Matt Perry
85670ba03d Expose and use constants for DrawLooperLayerInfo.setPaintBits to dart.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1175403002.
2015-06-11 15:41:12 -04:00
Eric Seidel
4ee96b73d9 Remove bogus CHECK in set_isolate.
This was added in 22da76be1ee64120f69ed35d6f21c85c31df08b6
but breaks all navigation (which is sadly only tested by our
demo site).

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182543002.
2015-06-11 11:05:36 -07:00
Matt Perry
c9dd71253c Fix up constructor naming style for MaskFilter and ColorFilter.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1179913002.
2015-06-11 13:15:20 -04:00
Matt Perry
b973810865 Sky: Small fixes to Gradient interface. Added comments and renamed constructors.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1180873003.
2015-06-11 13:14:51 -04:00
Adam Barth
d0c30be6ca Make the stocks popup menu fade in
The final animation is more involved, but this CL starts implementing the menu
animation by making it fade in.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1174253003.
2015-06-10 17:28:43 -07:00
Chinmay Garde
ac4f0bebc5 sky/engine updates for iOS targets
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1163323003.
2015-06-10 16:17:56 -07:00
Collin Jackson
86b2b3ed28 Clip inkwell splash around the floating action button
R=abarth@chromium.org, ianh@google.com, abarth

Review URL: https://codereview.chromium.org/1174203002
2015-06-10 15:57:26 -07:00
Adam Barth
c17d58ab28 Fix shutdown crash in Sky
Previously, we would try to close some Dart persistent handles after destroying
the isolate. Now we revoke the weak pointers these handles are using to refer
to the isolate before trying to tear them down.

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

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

Review URL: https://codereview.chromium.org/1175053002.
2015-06-10 12:59:07 -07:00
Eric Seidel
c87b98b687 Enable antialiasing on Paint by default.
The app looks so much better with this on.

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

Review URL: https://codereview.chromium.org/1172413002.
2015-06-10 11:11:03 -07:00
Matt Perry
42892c733b Add LinearBoxGradient and RadialBoxGradient decorations for RenderDecoratedBox.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1175763002.
2015-06-10 12:23:57 -04:00
Eric Seidel
52fd41bc88 Make Sky not crash when an image 404s.
I also fixed image_cache to not even bother
to call ImageDecoder in the 404 case, but I also
fixed CanvasImageDecoder not to blow up if the
buffer is empty and its not able to allocate
an ImageDecoder.

Closes https://github.com/domokit/mojo/issues/229

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

Review URL: https://codereview.chromium.org/1170413002.
2015-06-09 17:29:00 -07:00
Hixie
d54c213b24 Clean up a bunch of our Dart code.
- constructors first
 - have either a blank line at the top and bottom of each class, or no blank line in either place (it's still inconsistent about which we should do)
 - hide clamp()

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1172173002
2015-06-09 15:27:58 -07:00
Adam Barth
4011ec97b8 SkyView should handle screen rotation
This CL implements a basic version of screen rotation where we just relayout at
the new size. In the future, we'll want a fancy version where we transition
between the two layouts.

R=ianh@google.com
BUG=

Review URL: https://codereview.chromium.org/1177563002.
2015-06-09 13:56:18 -07:00
Matt Perry
d745bd3d47 Sky: Add a DartConverterEnum and use that for all our enum needs.
R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1170963003.
2015-06-09 15:58:54 -04:00
Matt Perry
9f64045470 Sky: Allow clients to specify tile mode for gradients (repeating or mirror).
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1166223004.
2015-06-09 15:21:46 -04:00
Eric Seidel
8f975399e1 Move image loading out of C++ into Dart
We already know how to talk to the network_service from Dart
via fetch.dart.  Might as well use that for Image loading
as well insetad of having ImageLoader do it.

As part of this I've renamed *ImageLoader to *ImageDecoder
and moved all the image loading logic into Dart.  This required
me to teach the idl system about mojo handles so that I could
pass the resulting MojoHandle from fetch.dart up through to
ImageDecoder.

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

Review URL: https://codereview.chromium.org/1173703002.
2015-06-09 12:14:13 -07:00
Matt Perry
aa80a91279 Change the ColorFilter constructor to ColorFilter.Mode, in case we want to add
more ColorFilter types.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1163373007.
2015-06-09 14:55:52 -04:00
Matt Perry
ecb61e1466 Sky: Added radial gradients.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1169863002.
2015-06-09 12:45:02 -04:00
Eric Seidel
92fd88b73f Fix RenderParagraph to respect text color.
I don't think this is the final API we're going to use.

I suspect we'll add a TextStyle struct to hold
color and size, etc. which back-ends into CSS like
this does today.

Currently no one uses this color even though it exists.

This is one step towards fixing:
https://github.com/domokit/mojo/issues/213

R=ianh@google.com

Review URL: https://codereview.chromium.org/1162573007
2015-06-08 15:22:18 -07:00
Hixie
44ad012a65 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
Matt Perry
7382a261aa Change the way we provide custom dart code for IDL bindings.
Rather than appending the custom Foo.dart code to the end of the generated
interface, we now copy it to a CustomFoo.dart file in the output directory.
This allows us to declare it as a proper dependency.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1171743002
2015-06-08 17:26:51 -04:00
Adam Barth
5a14f03f7b Add Point.origin for new Point(0.0, 0.0)
R=eseidel@chromium.org, ianh@google.com

Review URL: https://codereview.chromium.org/1166183002
2015-06-08 13:36:52 -07:00