Commit Graph

126 Commits

Author SHA1 Message Date
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
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
Adam Barth
17040ff355 Plumb display metrics into SkyView
This CL teaches SkyView the width, height, and device pixel ratio of the
display. In the future, we'll want some sort of notification system for when
these values change.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1139823010
2015-05-19 14:54:08 -07:00
Adam Barth
0b18d56d5a Teach SkyView path to draw a circle
This CL adds a global view object that can receive a Picture and be signaled to
draw. When using SkyView, this Picture shows up on screen.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1134913003
2015-05-19 14:20:04 -07:00
John McCutchan
5fd9d77387 Fix domokit.github.io site deployment script
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1145843002
2015-05-19 14:03:13 -07:00
Adam Barth
a21939bdaf Teach SkyView code path to print hello, world
This CL makes the SkyView codepath smart enough to print "hello, world" to the
console. The code path is off by default but can be enabled by changing one
line of code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1131673011
2015-05-19 13:51:12 -07:00
Matt Perry
9dfbc4eea4 Sky: Add a CustomDart attribute to the IDL compiler, and use that with Canvas
to provide a better Dart API.

When the attribute is present on an IDL interface, the generate Dart code will be a private interface that can extended by custom dart code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1135283005
2015-05-19 13:59:05 -04:00
Eric Seidel
293563078d Add Canvas.drawPicture
I wrote another copy of paint_element_into_displaylist
using this new technology.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1129353010
2015-05-18 15:13:15 -07:00
Eric Seidel
20459183e4 Make it possible to Paint elements into a display list.
Currently said elements need to be in the DOM and have
already been laid out for this to work, but follow-up patches
will remove these restrictions.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1144673002
2015-05-18 14:49:59 -07:00
Matt Perry
769cef59ba Flesh out the Painting API a bit.
This exposes most methods from Skia's C canvas API to Dart. For now, SkRect and
SkMatrix are represented simply as an array of floats, which requires a
conversion at the bindings layer. More complex types like SkPath are still TODO.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1144483002
2015-05-13 17:17:26 -04:00
Eric Seidel
a0609d1f4e Make it possible to custom-paint without an Element.
This adds a new abstract 'Canvas' which is similar to SkCanvas.
PaintContext implements Canvas while still having its
own commit() method to cause the paint actions to apply to
the Element for the next frame.
This adds a new PictureRecorder which also implements Canvas
and has an endRecording() method which returns a Picture
(another new interface) which can be held from Dart.

There is also now a rootPicture setter on Document which takes
a Picture and will then make the Document draw that Picture
until changed.

This piggybacks on the existing custom painting system
which adds the painting at background-and-borders paint
time so technically if you both set rootPicture as well as
construct a DOM you will draw the DOM on top of your picture. :)

R=mpcomplete@chromium.org

Review URL: https://codereview.chromium.org/1122423009
2015-05-13 13:16:47 -07:00
Eric Seidel
d12f84c818 Add pubspec.yaml files for each of the examples/ directories
so that pub get will create a packages/ directory for each
and users of packages/sky/sky_tool can run these examples
from sky_sdk as the instructions say to.

TBR=ianh@google.com
https://github.com/domokit/mojo/issues/128

Review URL: https://codereview.chromium.org/1110283002
2015-04-28 16:26:38 -07:00
Eric Seidel
72902ef85b Teach window.location.href setter to handle relative urls.
Also fixed display of text in touch-demo.sky

R=ianh@google.com

Review URL: https://codereview.chromium.org/1059743004
2015-04-14 12:16:51 -07:00
Adam Barth
854f083f1b Clean up examples directory
1) Merge input example into widgets example
2) Move single-file, non-fn examples into a "raw" directory
3) Rename stocks-fn and widgets-fn to stocks and widgets

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1005393006
2015-03-26 14:32:40 -07:00