Commit Graph

286 Commits

Author SHA1 Message Date
Adam Barth
6543b55cb6 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
Eric Seidel
c47a82d5ca 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
Viktor Lidholt
3118a6fba1 Initial version of working game with Box2D, images, nodes and sprites.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1161023006
2015-06-02 15:09:01 -07:00
Adam Barth
81cc63edfe 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
Matt Perry
0f8ae9f16c 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
Hixie
b53644f660 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
11d50579a1 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
e0fc6df9a3 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
Matt Perry
9618a82750 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
e28c832a79 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
dc9635dd33 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
2fe4b05e6d 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
4eb2ac712e 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
e22b790e0c 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
205bd1449a 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
Adam Barth
04169c4ce3 Add a simple inksplash example
We'll eventually turn this into a full fn2 component, but for now it's just an
example.

To make this work, I created a schedule.dart as a start to implementing
scheduler.md. For now, I've kept the API similar to the web platform so that
the old world can continue use it backed by sky.window.requestAnimationFrame.

R=eseidel@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1145973009
2015-05-29 13:55:12 -07:00
Adam Barth
dbbe62ea8f 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
46e47cf011 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
3f22019e66 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
b0e39b7d99 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
Matt Perry
96b04e34b1 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
Eric Seidel
db50ce1659 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
10901fabad 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
647232b8a5 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
Eric Seidel
081a440e6c Move RenderParagraph into layout2.dart
TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1155103003
2015-05-28 12:26:09 -07:00
Eric Seidel
54eb9b146e Add a very simple RenderParagraph example using LayoutRoot.
I'm sure we'll want something more sophisticated in the near future.

Next step is to actually animate this updating layout.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1150183005
2015-05-28 12:18:56 -07:00
Hixie
ec29082f84 Refactor layout/relayout into a single method.
This dramatically simplifies the layout model.
I haven't gone through and simplified the existing functions, we should probably go through and figure out if they can be cleaned up a bit.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1161983004
2015-05-28 11:15:58 -07:00
Hixie
e45a3f7b32 Refactor padding out of RenderBlock.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1143153011
2015-05-27 17:11:45 -07:00
Hixie
ac0d5e31a6 [Effen] port fn and stock to RenderNode, part 1 of many
This gets things off the ground barely enough to show some pixels.
These are not pixels that are actually part of the stock app, but
it's a start.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1157033006
2015-05-27 13:36:01 -07:00
Matt Perry
15687c8831 Sky: Add a DrawLooper interface to the painting API to be used for shadows.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1144193006
2015-05-27 16:22:01 -04:00
Hixie
270e386351 Fix compilation errors in render-sector.dart
TBR=abarth

Review URL: https://codereview.chromium.org/1153273002
2015-05-27 12:03:15 -07:00
Matt Perry
36baaf53a5 Sky: Add a Point class.
Also, fix the style in Rect.cpp/.h.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1158843002
2015-05-27 14:40:02 -04:00
Eric Seidel
b1b94b4770 Make it possible to draw Text in the new window/document-less world
I had to add back document.createText() since new Text()
does not work in the new world yet.

LayoutRoot is a new Dart-exposed class which holds the Frame and
all associated machinery, sufficient to trigger a restyle
and layout of the subtree.

This is all kinda hacky and I'm sure likely to cause many
crashes if folks call random methods on these disconnected
trees.

But this makes it at least possible to paint text for now
and we can improve this in the coming days.

This really should have Adam's review.  It's hugely hacky
but I'd like to negotiate out with him the timeline on
which we should fix some of these hacks.

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

Review URL: https://codereview.chromium.org/1148253003
2015-05-27 11:05:42 -07:00
Hixie
d88b117bcf [Effen] Point the stocks2 and components2 files at the forked libraries. (part II)
This was supposed to be in https://codereview.chromium.org/1153223003

TBR=abarth

Review URL: https://codereview.chromium.org/1160763003
2015-05-27 09:39:15 -07:00
Hixie
6ffea218fe Replace setBoxDecoration() with a decoration property. (part II)
This was supposed to be in https://codereview.chromium.org/1153893006/

TBR=abarth

Review URL: https://codereview.chromium.org/1151383003
2015-05-27 09:35:15 -07:00
Hixie
2415a118f6 Replace setBoxDecoration() with a decoration property.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1153893006
2015-05-27 09:30:25 -07:00
Hixie
f706d82828 [Effen] Point the stocks2 and components2 files at the forked libraries.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1153223003
2015-05-27 09:13:37 -07:00
Hixie
24e81ea037 [Effen] Fork stocks and fn.dart so we have something to work on during the porting process
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1156543004
2015-05-26 12:53:08 -07:00
Hixie
c09aac3f3f Rationalise hit testing in the new RenderNode world
- makes the event logic not involve a boolean return value (since we ignored it anyway)
- splits the event handling logic into two steps, hit testing and event dispatch
- introduces an App class on the Dart side to factor out the interaction with the C++ side
- ports sector-layout and simple_render_tree to the new App infrastructure
- port simple_render_tree to the new event handling logic
- implement hit testing for the sector-layout demo

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1143343004
2015-05-26 12:44:35 -07:00
Collin Jackson
3976cd7b28 Clean up syntax as suggested by sethladd
R=sethladd@google.com, sethladd

Review URL: https://codereview.chromium.org/1159763003
2015-05-26 10:20:37 -07:00
Hixie
2470cdcafa RenderSector example: add a class to stack in the other direction, and fix various bugs.
- the circle now fills the screen
- you can set dimensions on the solid color node
- debugging printfs and rects are gone
- the protocol is changed so that for sectors, you position before you size (since your size and your childrens' positions all depend on your own position)

TBR=abarth

Review URL: https://codereview.chromium.org/1154213003
2015-05-26 09:53:21 -07:00
Hixie
54403a610b A proof of concept for annular sector layout.
Could be useful for watch faces. :-)
Includes some minor fixes to layout2.dart.
Includes adding a very basic path API.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1152383002
2015-05-26 08:33:13 -07:00
Collin Jackson
87e8b162c7 WIP Flexbox Layout Manager for Sky framework.
This only handles really basic cases and doesn't understand
justification, wrapping, and so on. Submitting for code
review so I can get some early feedback before I invest
more time into making it correct.

R=ianh@google.com, abarth

Review URL: https://codereview.chromium.org/1151293002
2015-05-22 18:47:29 -07:00
Adam Barth
51c670e62b Address Ian's comments on layout2.dart
R=ianh@google.com

Review URL: https://codereview.chromium.org/1152603002
2015-05-21 13:32:21 -07:00
Adam Barth
af9a06c023 Port touch-demo.sky to SkyView universe
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1151613005
2015-05-21 12:34:38 -07:00
Adam Barth
ed38815dbd Port spinning_square to SkyView universe
This demo shows how to create a spinning square using the lowest-level APIs. We
should probably create more spinning square demos at the other layers of the
system.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1147393002
2015-05-21 12:14:10 -07:00
Adam Barth
c63c396da8 Make hit testing work in layout2.dart
This CL makes simple_render_tree.dart interactive by making the hit testing
system work. I've also added a mechanism for requesting an animation frame.

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

Review URL: https://codereview.chromium.org/1153543002
2015-05-21 11:22:17 -07:00
Adam Barth
400d6df700 Actually perform a block layout
This CL teaches simple_render_tree how to do a block layout using layout2.dart.

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

Review URL: https://codereview.chromium.org/1144423002
2015-05-21 11:15:50 -07:00
Adam Barth
3a6cab2c40 Add a simple_render_tree example
This example shows how to draw a circle using subclasses of RenderNode.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1144193004
2015-05-20 13:49:29 -07:00
Adam Barth
83805e2a9e Plumb input events into SkyView
Clients can now register a callback that gets called whenever we have an event
for the view. We'll need to update the Event class at some point, but this is a
start.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1129333005
2015-05-19 16:50:28 -07:00