858 Commits

Author SHA1 Message Date
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
Eric Seidel
0e738ab6aa Make SkyShell stop crashing on scroll in Stocks2.
This is just another hack on top of the hack that is LayoutRoot.

We will want to untangle Document ownership further as we
iterate on LayoutRoot.  For now LayoutRoot is both very
inefficient (allocates a new Frame for each one!) as well
as crashy like this (by not actually owning the document
but rather grabbing it off the "rootElement" assigned to it).

This at least fixes this common crasher for now.
https://github.com/domokit/mojo/issues/206

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1171643002
2015-06-08 12:41:31 -07:00
Matt Perry
edd0d6e16a Add support for linear gradients, implemented as skia shaders.
I had to complicate the IDL bindings generation to allow passing an array of
colors. Without these changes, we'd try to convert the dart object to
Vector<SkColor>, which C++ thinks is Vector<unsigned>, and we'd use the wrong
converter. So I added some template grease to force it to use a
Vector<CanvasColor> converter.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1152963009
2015-06-08 13:49:10 -04:00
Adam Barth
2384779263 Introduce sky.Sky.zero
And deploy it in a few places.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1164303002
2015-06-08 10:09:03 -07:00
Collin Jackson
668e1e37ab Implement a simple checkbox in Sky’s fn2 components library
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1161813005
2015-06-05 14:51:37 -07:00
Collin Jackson
18ab61e1ee Use an enum for Dart bindings for Skia Paint style
R=abarth@chromium.org, abarth

Review URL: https://codereview.chromium.org/1171543002
2015-06-05 10:12:45 -07:00
Adam Barth
247344193d Add the floating action button to stocks2
The + isn't quite centered properly, but the button is a circle in the right
place.

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

Review URL: https://codereview.chromium.org/1156383004
2015-06-05 10:07:51 -07:00
Collin Jackson
45cbbc0fae Implement radio button for Sky’s fn2
R=abarth@chromium.org, eseidel@chromium.org, abarth

Review URL: https://codereview.chromium.org/1157573012
2015-06-04 17:24:38 -07:00
Hixie
96aadc99b4 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
Eric Seidel
54d01bc005 Attempt to write a RenderShadowedBox
The goal of this is to have a Renderer-layer abstraction
around the Sky Engine c++ apis for drawing a shadow.

R=mpcomplete@chromium.org

Review URL: https://codereview.chromium.org/1146893004
2015-06-04 14:49:24 -07:00
Viktor Lidholt
2d8240aa75 Adds support for transfer mode in Paint and SpriteNode classes. Adds support for opacity in sprites, and modifies example game.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1164633004
2015-06-04 11:14:07 -07:00
Matt Perry
8afcb0fe2d Canvas.concat takes a 16-element Float32List instead of an array.
The array should be in column-major format, in the format used by vector_math.dart.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1155193004
2015-06-04 13:51:44 -04:00
Eric Seidel
8d52fb51dc Make Icon work using space-aged base-url technology.
I also moved Icon back to using int, since double doesn't
actually make sense for an icon pixel size.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1164023005
2015-06-03 17:16:12 -07:00
Adam Barth
1e9184d282 Make Uri.base work in SkyView
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1153673005
2015-06-03 17:00:44 -07:00
Adam Barth
6d5227ea0c Make Drawer in components2 work
This CL introduces RenderStack and fixes a number of bugs to make the Drawer in
components2 work.

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

Review URL: https://codereview.chromium.org/1147143005
2015-06-03 14:52:13 -07:00
Hixie
57fef366d1 Provide Point+Size, Point-Point, Point.toSize(), and Rect.toPoint().
Also some minor code cleanup in affected files and nearby files.

R=mpcomplete@chromium.org

Review URL: https://codereview.chromium.org/1160453006
2015-06-03 14:21:46 -07:00
Matt Perry
8c097b0892 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