Commit Graph

23 Commits

Author SHA1 Message Date
Jason Simmons
5b72a2fdaf Fix warnings seen when running skyanalyzer in strong mode 2015-10-15 10:56:03 -07:00
Hixie
1cf1cf9c64 Port first sector demo to fn3
Also, fix warnings in rendering/sector_layout.dart
Also, fix hit testing in rendering/sector_layout.dart
Also, add WidgetToRenderBoxAdapter
Also, make the rendering library debugging tools more resilient to
dumping stuff before layout is complete.
2015-10-13 14:21:52 -07:00
Adam Barth
ecce1eb389 Import dart:ui as ui (instead of as sky) 2015-10-09 20:55:54 -07:00
Adam Barth
65eba90843 Rename package:sky to package:flutter 2015-10-09 20:44:52 -07:00
Adam Barth
5b37f8750d Rename dart:sky to dart:ui 2015-10-09 19:27:13 -07:00
Adam Barth
a74d02dadf Rename Sky to Flutter in a few more places 2015-09-26 12:46:03 -07:00
Adam Barth
051354ae1d Remove EventDisposition
All the use cases for EventDisposition are now addressed by the gesture
detection system.
2015-09-21 16:45:09 -07:00
Adam Barth
95277953aa Document and bring sanity to BoxConstraints
Turns out many of the functions on BoxConstraints weren't used or had callers
that could easily be updated to other functions. I've added dartdoc to all the
public functions as well as renamed some functions that had similar names but
did different things.
2015-09-05 11:33:02 -07:00
Adam Barth
2e2fa94e1b Sector demo is broken because of compositor changes
We need to implement visitChildren for the RenderObjects in the sector demo.
Also, add a test.

Fixes #790
2015-08-26 10:58:30 -07:00
Adam Barth
dea3a0922c Add package:sky/rendering.dart
Similar to widgets.dart, rendering.dart exports the entire rendering layer.
Also, update the examples to use rendering.dart and widgets.dart. Also clean up
some exports so that the examples have more sensible imports.
2015-08-18 21:39:51 -07:00
Adam Barth
50bfdedbf4 Split box.dart into many files
Sadly, box.dart has grown much longer than 1000 lines. This patch splits it up
into several files based on the class hierarchy. Fortunately, many of these
classes are loosely coupled to each other.
2015-08-18 20:55:32 -07:00
Adam Barth
c80603cf0e Add PaintingContext which has-a sky.Canvas instead of is-a sky.Canvas
We'll need this for compositing because we need to switch out the sky.Canvas
when we switch compositing layers.
2015-08-13 10:18:33 -07:00
Ian Fischer
d44ed7dfc3 Move example out of sky/packages to //examples 2015-08-07 17:04:50 -07:00
Ian Fischer
82404e030a Move sky/examples to sky/sdk/lib/example, and code changes to support that change. Fixes T277.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1218593002.
2015-06-26 15:06:40 -07:00
Hixie
d532b3fa7c Rename setParentData to setupParentData since it's not a setter per se.
TBR=abarth

Review URL: https://codereview.chromium.org/1208293002.
2015-06-25 17:28:34 -07:00
Hixie
aef18a90ab Add asserts to catch potential misuses of the rendering framework.
New asserts:
- verify that after layout, the size fits the constraints
- verify that after layout, the size isn't infinite
- verify that you don't set the size in performLayout() if you have
  sizedByParent set
- verify that nobody reads your size during layout except you, or your
  parent if they said parentUsesSize:true

Fixes some bugs found by those asserts:
- RenderBlock, RenderStack, and RenderScaffold were not always setting
  parentUsesSize correctly
- RenderScaffold was setting its slot entries to null rather than
  removing them when the slot went away, which led to null derefs in
  certain circumstances

Also, rename a local variable in RenderStack.performLayout() because
it was shadowing a variable on the object itself, which was really
confusing when I first tried to debug this function...

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1213473003.
2015-06-25 17:08:06 -07:00
Ian Fischer
82d1eb2fdb 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
Hixie
e352ec9fc4 Short-circuit the relayoutSubtreeRoot when the child couldn't change dimensions anyway because the parent constrained it.
The relayout subtree root concept is intended to handle the case where
a node, when it lays itself out for a second time, changes its opinion
about what dimensions it should be. In such a situation, the parent,
if it based its own opinion about what size _it_ should be on the
child's dimensions, would also need to lay itself out again. Thus,
when this scenario is possible, the child remembers the parent, and
when it would be told to relayout, we actually start the layout with
the parent.

In practice, this chains, and we end up with nodes that point to
ancestors ten or more steps up the tree such that when the inner most
child re-lays-out, the whole app ends up relaying out.

This patch tries to short-circuit this for the case where the
constraints being applied to the child are such that actually, the
child has no choice about its dimensions. In that case, the parent
can't change dimensions when the child re-lays-out.

This makes a huge difference on the stocks demo app. Without this, on
the third rendered frame, there are 72 relayoutSubtreeRoot links, the
deepest chain is 8 deep, and 9 of the chains are only 1 level deep.
With it, there are 63 relayoutSubtreeRoot links, the deepest chain is
only 4 deep, and 38 of the chains are only 1 level deep.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1196553004.
2015-06-22 16:51:25 -07:00
Hixie
5136d5209b Rename AppView to SkyBinding.
Move app/view.dart to rendering/sky_binding.dart since it's part of the RenderObject API, really (it knows about RenderView intimately).
The tests pass. I didn't check every last example.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1183913006.
2015-06-17 17:07:31 -07:00
Hixie
249dc8aff5 Create an example app that demonstrates interactive coordination of an fn tree and a raw RenderObject tree.
Sector changes:
- implement the intrinsic sizing box API on RenderBoxToRenderSectorAdapter
- remove some debug print statements
- fix getIntrinsicDimensions() on RenderSolidColor to return true values
- factor out the default demo

RenderObject changes:
- BoxConstraints.isInfinite() now returns true only if both dimensions are infinite

fn changes:
- implement UINodeToRenderBoxAdapter
- rename RenderObjectToUINodeAdapter to RenderBoxToUINodeAdapter

Tests:
- add a test for sector layout
- make TestRenderView support being run without the unit test framework

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1175423007.
2015-06-16 09:28:59 -07:00
Adam Barth
17d3b4957a Rename all the things
This CL moves the bulk of the SkyView code out of the |framework| directory
because the |framework| directory was redundant in Dart package import
declarations.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1177383006.
2015-06-13 09:46:52 -07:00
Adam Barth
c5def50b9c Port sky_home to the new SkyView world
R=ianh@google.com, eseidel@chromium.org

Review URL: https://codereview.chromium.org/1178293004.
2015-06-12 16:53:29 -07:00
Hixie
6a8dd7d284 Separate out the raw (directly manipulating sky.view) examples from the rendering (using RenderObject et al) examples.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1173233002
2015-06-10 16:23:43 -07:00