90 Commits

Author SHA1 Message Date
Kris Giesing
4664966094 Fix Rect intersection; add test 2015-09-18 15:22:59 -07:00
Adam Barth
dcaef43b97 Fix text rendering
Now that RenderView doesn't look at FrameView for its size, we need to set the
size on the RenderView directly.
2015-09-17 11:28:43 -07:00
Adam Barth
77264d3e94 Teach sky.Paragraph how to actually compute layout
Previously layout was exiting early because the frame view
was null. Now we actually compute some layout and paint the
text. This patch makes paragraph_builder_test pass.
2015-09-17 09:37:30 -07:00
Adam Barth
9a2411eeac Crash when we can't run main()
Also, in testing, crash when we can't load a library off disk.
2015-09-16 16:42:37 -07:00
Adam Barth
d5b2969546 Simplify TestRunner now that we don't have test_sky 2015-09-16 11:00:33 -07:00
Adam Barth
437cedf45e Disentangle FontSize from Settings
Instead, just store the default font sizes in statics. These statics are
constants for now, but we'll probably make them configurable at some point.
2015-09-11 12:51:27 -07:00
Adam Barth
cafcbbae1e Merge pull request #1133 from abarth/paragraph_builder
ParagraphBuilder should be able to build a paragraph
2015-09-11 10:59:02 -07:00
Adam Barth
29ab28d922 ParagraphBuilder should be able to build a paragraph
This patch start down the road of implementing text layout and painting without
the DOM. We can construct a basic paragraph consisting of a single run of text
and we can get through layout without crashing.
2015-09-11 10:23:15 -07:00
Hans Muller
1ed23ea92f Finish converting Dismissable from Listener to GestureDetector
Dismissable now only depends on GestureDetector.

Added a unit test that verifies that issue #1068 has been fixed. It's commented out for now.

Cleaned up VelocityTracker.cc et al a little.
2015-09-11 09:37:55 -07:00
Hans Muller
d18c0f7758 Initial support for the fling gesture detector
Added FlingGestureRecognizer and exposed it in the GestureDetector class. FlingGestureRecognizer is based on the Android/Chromium VelocityTracker class which computes a velocity vector for for a list of X,Y,Time tuples.

The Scrollable classes now use the FlingGestureRecognizer. Dismissable and Drawer still need to be updated
2015-09-09 16:49:31 -07:00
Chinmay Garde
b44a86c08a PictureLayers cache the contents of their pictures if the pictures
dont mutate from frame to frame
2015-09-09 09:54:30 -07:00
Viktor Lidholt
dc1b773ed1 Cleans up naming and adds documentation to drawVertices bindings 2015-09-08 12:04:03 -07:00
Viktor Lidholt
1d6cd4bc01 Adds bindings to Skia for VertexMode and drawVertices 2015-09-08 11:09:45 -07:00
Viktor Lidholt
baabf090f0 Adds bindings for ImageShader to SkShader::CreateBitmapShader 2015-09-04 16:03:14 -07:00
Chinmay Garde
2c180b3b8b Merge pull request #1049 from abarth/layer_tree_to_gpu
Pass the sky::LayerTree to the GPU thread for drawing
2015-09-04 12:55:20 -07:00
Adam Barth
58d67facd8 Merge pull request #1011 from abarth/paragraph_builder
Sketch a DOM-free API for laying out and painting text
2015-09-03 20:29:15 -07:00
Adam Barth
e5d7e69346 Pass the sky::LayerTree to the GPU thread for drawing
Instead of squashing the layers down into a single SkPicture, we now pass the
tree to the GPU thread, which draws everything separately.
2015-09-03 19:20:32 -07:00
Hans Muller
06b420433f Fix minor problems in _ScrollGestureRecognizer, Dismissable
Alternating scroll gestures would sometimes be ignored because _ScrollGestureRecognizer didn't always reset its _state when the pointer[s] went up.

A Dismissable dismiss triggered by a drag and then a fling could cause the next attempt to drag-dimiss to fail.

Fixed the definition of lerpColor().
2015-09-03 13:40:35 -07:00
Adam Barth
bc8f7a096e SceneBuilder should build a tree of layers
We now build a layer tree before squashing the draw command down to an
SkPicture.
2015-09-02 18:23:01 -07:00
Adam Barth
a17c01874d Remove dead code
These files were breaking clean builds.
2015-09-02 12:32:57 -07:00
Adam Barth
5551c6ee35 Merge pull request #1010 from abarth/clean_idls
Remove some unused dart:sky IDLs
2015-09-02 10:54:50 -07:00
Adam Barth
ed655b8973 Merge pull request #1009 from abarth/improve_paint
Improve the Paint API in dart:sky
2015-09-02 10:54:41 -07:00
Adam Barth
68b06c8736 Sketch a DOM-free API for laying out and painting text
Rather than using the DOM to upload text and styling information into the
engine, this patch begins sketching a more direct API that bypasses the DOM and
CSS. Currently, this API doesn't do anything, but it's a first step.

The approach is to have a ParagraphBuilder object that can record a tree of
style interior nodes and text leaves. The build() function then applies
container-level styling information (such as TextAlign) and returns a Paragraph
object that can undergo layout and paint.

The inputs to the builder process are immutable style objects constructed from
primitive values. These primitives are currently carbon-copies of the primitive
we use in the framework today. After this patch lands, I'll convert the frame
to re-expose these values instead of re-defining them.
2015-09-02 01:28:54 -07:00
Adam Barth
b379439e37 Remove some unused dart:sky IDLs
This CL deletes a bunch of unused IDL files and removes some dead code in the
engine.
2015-09-02 00:09:43 -07:00
Adam Barth
f9201ea9a6 Improve the Paint API in dart:sky
Now that we've hoisted Paint into the VM, we can expose these values as normal
properties. After we've updated all the callers, I'll remove the old setters.
2015-09-01 23:28:12 -07:00
Adam Barth
73d29cfd36 Fix typos in dart:sky
We renamed lerpNum to lerpDouble and forgot to update these callers.
2015-09-01 23:21:35 -07:00
Adam Barth
96e203329c Move lerp for the engine types into dart:sky
This patch just adds them to dart:sky. A future patch will actually use them in
the framework once we've published an updated sky_engine package. Also, add
dartdoc to the classes touched in this patch.
2015-08-31 09:25:22 -07:00
Alhaad Gokhale
e2b4149320 Go back to master. 2015-08-27 18:16:45 -07:00
James Robinson
8b4bdd242d Use C bindings to Mojo GL entry points exclusively 2015-08-27 15:58:24 -07:00
Chinmay Garde
31f7fa8ddd Update skia to latest revision 2015-08-26 15:28:05 -07:00
James Robinson
c8eff5e44f Update to mojo d259eb58aa59e14a13d5e0dc3984b855b475ba09
This updates to mojo commit d259eb58aa59 and limits the roll script to
only pull in the parts of //mojo that are currently being used. More
stuff will be dropped in the future.
2015-08-25 14:56:25 -07:00
Adam Barth
96df6c373c Use sky.SceneBuilder to upload Layer tree to C++
We still use SkPicture as our rasterization backend, but now we're uploading
our layer tree to C++. A future patch will push the layer tree deeper into the
system and we'll eventually switch backends.
2015-08-25 13:41:37 -07:00
Adam Barth
aaacd90b8e Switch to the other stack trace printer 2015-08-21 14:55:46 -07:00
Adam Barth
f2faa74f98 Update TransferMode.dart 2015-08-20 14:13:53 -07:00
Adam Barth
7f0a28952a Uncaught exceptions get two stack traces
Now we print Dart_GetError only when we don't have a stack trace. Also, improve
the usability of the sky_shell command line tool by defaulting to "packages"
for the package-root and not crashing when we don't have a package-root until
we actually try to load a package. Finally, remove console spam when we fail to
bind the observatory port.

Fixes #689
2015-08-20 12:09:53 -07:00
Chinmay Garde
f19767de8d Fix crashes on iOS due to EXC_ARM_DA_ALIGN 2015-08-18 14:34:51 -07:00
Hixie
5ceb52a0e1 Port clipping to the new layer world.
- Add Canvas.getSaveCount()
- Make RenderClipRect call context.paintChildWithClip instead of doing the clipping itself
- Make ClipLayer take a Rect instead of a Size
- Make PaintingContext.canvas read-only
- Add PaintingContext.paintChildWithClip()
- Minor rearrangings of code and style tweaks
2015-08-18 08:34:42 -07:00
Chinmay Garde
c6d67998cc Revert "Temporarily roll back dart dependency to work around build errors"
This reverts commit 2042a0f0adbde9a16ccd9ff9a414e70bc7871386.
2015-08-17 17:01:27 -07:00
Chinmay Garde
f19071f5f9 Fix armv7 build errors in sky/engine 2015-08-17 14:12:41 -07:00
Chinmay Garde
2042a0f0ad Temporarily roll back dart dependency to work around build errors
Tracking issue https://github.com/domokit/sky_engine/issues/654
2015-08-17 13:51:13 -07:00
Adam Barth
94088d8626 Remove stray reference to Typeface 2015-08-14 08:58:10 -07:00
Collin Jackson
28813a9b7d Merge pull request #590 from collinjackson/rollback
Roll back drawText Canvas support; we are instead going to refactor RenderParagraph into ParagraphPainter
2015-08-13 17:05:55 -07:00
Adam Barth
1a062aab4e Add a compositing step to the lifecycle
Now we have the ability to draw multiple PictureLayers. We still squash all the
pictures together into a single SkPicture for simplicity. In the future, we'll
submit them to C++ separately and composite them on the GPU thread.
2015-08-13 16:31:45 -07:00
Chinmay Garde
281dc80f17 Merge pull request #578 from chinmaygarde/master
Make |TracingController| platform agnostic and enable collecting traces from base and the shell view dart isolate simultaneously
2015-08-13 12:58:54 -07:00
Chinmay Garde
cfec10d80d Make |TracingController| platform agnostic and enable collecting
traces from base and the shell view dart isolate simultaneously.
Trace files contain samples from multiple sources and must be merged
separately
2015-08-13 12:51:24 -07:00
Collin Jackson
f705b3c5ae Roll back typeface changes (we’re going a different direction) 2015-08-13 10:08:47 -07:00
Collin Jackson
d4e68ab589 Add weight chart to fitness app 2015-08-12 14:50:50 -07:00
Adam Barth
a1807a1b17 Remove weak handle from sky.Paint
This patch converts sky.Paint to be a pure Dart object, which means we don't
need to open a weak handle to sky.Paint. Avoiding the weak handle reduces the
amount of weak handle callbacks we need to process at the end of GC and
therefore reduces jank.
2015-08-11 09:37:20 -07:00
Adam Barth
69c435eacc Simplify SkPicture
This patch simplifies the SkPicture we generate for Skia. Instead of drawing
everything into a nested SkPicture, we now draw everything into the top-level
picture, which requires us to apply the device scale factor in Dart.
2015-08-10 15:12:13 -07:00
Adam Barth
5f62ffe1f4 Swith from skia::RefPtr to RefPtr
Now that we can use WTF everywhere, we don't need to use skia::RefPtr.
2015-08-10 14:18:38 -07:00