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
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
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
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
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
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
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
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
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
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
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
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
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
Matt Perry
3aa1e23d7d
Sky: Convert TransferMode to an enum.
...
It looked and smelled like an enum, so lets just make it one. This also gives us a nice toString() method.
R=abarth@chromium.org , eseidel@chromium.org , ianh@google.com
Review URL: https://codereview.chromium.org/1144233004
2015-06-03 16:19:14 -04:00
Matt Perry
72ca1d9f32
Simplify TransferMode and Color types.
...
They are no longer wrappers in C++, but are converted directly to their Skia types.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1162393002
2015-06-03 13:33:33 -04:00
Eric Seidel
d9ed864cc9
Give the Stocks2 App a new improved toolbar.
...
Looks horrible. But it's a start.
R=abarth@chromium.org , ianh@google.com
BUG=
Review URL: https://codereview.chromium.org/1146913005
2015-06-02 16:13:31 -07:00
Matt Perry
485523560f
Add a MaskFilter interface to dart:sky to handle blur.
...
For this, I added back my previous CustomDart attribute for customizing the
generated Dart code of an interface.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1162843003
2015-06-02 17:26:32 -04:00
Matt Perry
e68fe5d33e
Add TransferMode to dart:sky, and use it instead of passing ints around.
...
Also use Point in place of passing 2 ints to the DrawLooper API.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1158883004
2015-06-02 15:03:44 -04:00
Matt Perry
4f2d78a5bb
Re-land "Add a Color class to dart:sky."
...
The previous patch broke the sky tests. I have updated the framework to use the new Color class.
R=jackson@google.com
Review URL: https://codereview.chromium.org/1159663003
2015-06-02 14:09:42 -04:00
Collin Jackson
f396442e0a
Implement a simple image cache for Sky in Dart. This doesn't yet do any eviction from the cache.
...
R=abarth@chromium.org , abarth
Review URL: https://codereview.chromium.org/1165753004
2015-06-02 10:44:48 -07:00
Collin Jackson
2ff84ffe5f
Refactor image handling in Sky to expose the loader and image as separate classes to Dart code. This makes it possible to avoid unnecessary paints, by only painting once when the image has loaded. Now that we've separated the loader and image classes, we can implement an image cache in Dart.
...
R=abarth@chromium.org , abarth
Review URL: https://codereview.chromium.org/1156003007
2015-06-01 16:21:21 -07:00
Matt Perry
ffed692545
Revert "Add a Color class to dart:sky."
...
This reverts commit a413c8319fe9a46dc131f6efe275d014c9cb7eb9.
Reason: seems to have broken Sky tests:
Regressions: Unexpected crashes (2)
raw/render_box.dart [ Crash ]
raw/render_flex.dart [ Crash ]
TBR=jackson@google.com
Review URL: https://codereview.chromium.org/1143133007
2015-06-01 18:13:35 -04:00
Matt Perry
326e2324c9
Add a Color class to dart:sky.
...
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1161273004
2015-06-01 16:48:48 -04:00
Collin Jackson
5afac54a8b
Add Sky framework support for drawing images
...
R=abarth@chromium.org , abarth
Review URL: https://codereview.chromium.org/1151753009
2015-05-29 16:45:43 -07:00
Matt Perry
fb8596730c
Add an API to set the ColorFilter on a Paint object.
...
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1158693005
2015-05-28 17:17:11 -04:00