46 Commits

Author SHA1 Message Date
Adam Barth
9c09565712 Update paths to account for buildroot 2016-08-09 13:52:15 -07:00
Adam Barth
d5232635f9 Remove //base from //flutter/tonic 2016-08-07 12:35:25 -07:00
Adam Barth
1c9c7aa826 Switch to using //lib/tonic's DartWrappable (#2878)
This removes most (all?) of our dependency on base::RefCountedThreadSafe.
2016-08-05 16:43:35 -07:00
Adam Barth
f0967c24e5 Remove more //base dependencies (#2870)
WTF is now //base clean.
2016-08-05 00:00:24 -07:00
Adam Barth
5feb8266f8 Switch //sky/engine to ftl::TaskRunner (#2866)
The ftl::TaskRunner is still based on a base::MessageLoop, but this patch paves
the way to replace the message loop on Fuchsia.
2016-08-04 19:25:04 -07:00
Adam Barth
1e250cfc5f Migrate more code to //lib/tonic (#2860)
* Adopt //lib/tonic/logging

* Adopt //lib/tonic/scopes

* Adopt //lib/tonic/parsers
2016-08-03 14:43:24 -07:00
Adam Barth
bc19388819 Switch to //lib/tonic's DartConverter (#2858)
Also, switch over to //lib/tonic's typed data classes.
2016-08-03 14:09:07 -07:00
Adam Barth
1c68b123c6 Reland "Remove more //base dependencies" (#2857)"
Hopefully this will build this time.
2016-08-03 12:58:35 -07:00
Ian Hickson
abb9c78d57 Revert "Remove more //base dependencies" (#2857) 2016-08-03 11:29:20 -07:00
Adam Barth
bce0d690a4 Remove more //base dependencies (#2856) 2016-08-03 10:35:14 -07:00
Adam Barth
f13875ca92 Move Canvas into //flutter/lib/ui (#2754)
This patch moves the remainder of painting and compositing into their
new home (and updates their style to match Google C++ Style).
2016-06-14 23:14:14 -07:00
Adam Barth
fabd183e6f Remove more calls to Dart_GetField (#2745)
This patch removes a number of the classes that were generating
Dart_GetField calls, particularly related to drawAtlas and drawVertices.
The functions that used these classes now use primatives instead, which
is more efficient.
2016-06-11 09:15:26 -07:00
Adam Barth
633d674c48 Move tonic to //flutter/tonic (#2742)
Now that tonic doesn't depend on anything in //sky/engine anymore, we
can move the code to a location where its dependencies are clearer.
2016-06-10 22:36:38 -07:00
Adam Barth
584d3928ce Remove dependency from tonic to wtf (#2740)
This patch paves the way to untangling a large amount of code from the engine.
2016-06-10 16:32:53 -07:00
Matt Perry
ce4bb9e16d Fix potential NULL dereference in Paragraph.getWordBoundary. (#2679)
Can happen when calling getWordBoundary on an empty Paragraph.
2016-05-12 15:30:29 -04:00
Matt Perry
befe39324e Expose a Paragraph.getWordBoundary method to dart. (#2675)
* Expose a Paragraph.getWordBoundary method to dart.

Used by text selection to select a word.
2016-05-11 14:53:51 -04:00
Adam Barth
c081845efc Remove Dart_GetField from Canvas interface (#2653)
These Dart_GetField calls show up on traces. This patch removes almost all of
them from the Canvas interface. We still have a few in drawAltas and
drawVertices, which will be removed in a later patch.
2016-05-05 19:56:41 -07:00
Adam Barth
a25959370a Remove the old Paragraph API (#2633)
All the clients of migrated to the new ParagraphConstraints API.
2016-04-29 09:49:34 -07:00
Adam Barth
28fbcc3a38 Use LayoutUnit to normalize infinity properly (#2632)
In the new ParagraphConstraints code path, we weren't converting through
LayoutUnit, so we weren't getting the right overflow behavior for extremely
large double values. This resulted in test/rendering/block_test.dart failing.
2016-04-28 16:11:16 -07:00
Adam Barth
7a186960d7 Add ParagraphConstraints (#2622)
This patch begins to update the Paragraph interface to something sensible. It
introduces a ParagraphConstraints object that is passed to layout() to control
the layout of the paragraph. Once clients are migrated over, the argument will
become required.
2016-04-28 09:38:08 -07:00
Adam Barth
516c096d98 Fix encoded paragraph size 2016-03-30 09:38:39 -07:00
Adam Barth
5124a68e8e Merge pull request #2563 from abarth/paragraph_font
Add font styles to ParagraphStyle
2016-03-30 09:21:56 -07:00
Chinmay Garde
3a5dd866b2 Add static assert to check that all Dart wrappable instances are thread-safe reference-countable. 2016-03-29 16:30:26 -07:00
Adam Barth
d3d3e47b0a Add font styles to ParagraphStyle
Also, rename TextStyle#lineHeight to height.
2016-03-29 15:28:28 -07:00
Adam Barth
2838055627 Remove Paragraph#paint
We now use Canvas#drawParagraph.
2016-03-17 17:20:26 -07:00
Jason Simmons
41f93f4099 Rename DOMDartState to UIDartState 2016-03-02 10:47:30 -08:00
Jason Simmons
0b8038fa1e Support loading of custom fonts
The FLX will contain a font manifest JSON file that maps font family names
to custom font assets.  Flutter will provide a FontSelector that loads
fonts on demand and caches typeface and style data.
2016-02-17 12:07:22 -08:00
Adam Barth
21d7575716 Add Paragraph#getPositionForOffset
We'll use this function to position the caret when the user taps a text
input control.

Very little of the code in this patch is actually new. Most of it is
restoring code that we previously removed from the engine. I've made
some small changes to the restored code to handle the lack of a DOM. The
only major change is to RenderObject::createPositionWithAffinity, which
now just returns the values it captures instead of trying to compute a
DOM position.

TextAffinity and TextPosition are lifted from package:flutter. Once this
patch rolls into package:flutter, I'll remove the declarations there.
2016-01-29 23:07:51 -08:00
Adam Barth
88add25212 Add the TextDirection to getRectsForRange
We need this in order to draw the cursor correctly.

Fixes #1491
2016-01-29 21:12:45 -08:00
Adam Barth
153c93e8db Introduce TextBox
TextBox is a rect that understands TextDirection.
2016-01-29 12:05:16 -08:00
Adam Barth
9b6698f162 Add getRectsForRange to Paragraph
We can use getRectsForRange to implement selection painting in the
framework.
2016-01-29 01:39:47 -08:00
Adam Barth
0140555b54 Remove integration between tonic and WTFString
We used to share memory between Dart strings and WTF::String objects by
way of the Dart externalized strings. That used to be important when the
DOM shared many strings between C++ and Dart. However, now that we don't
retain strings in C++ much anymore, we don't need this complexity.

This patch removes DartStringCache and the integration. It also unwinds
several cases where we were converting back and forth between
WTF::String and std::string for no reason. Now we use std::string more
consistently.

For the case of ParagraphBuilder::addText, we now take a raw const
char*, which more closely matches the API the DartVM exposes. That means
we do a single copy out of the VM and into the render tree at that
point.
2016-01-18 20:47:46 -08:00
Jason Simmons
10ce8a1928 Move the JNI bridge out of dart:ui and into a separate dart:jni library
This also extends DartClassLibrary to support multiple DartClassProviders
for different libraries
2016-01-08 11:04:22 -08:00
Ian Hickson
81f56588dc Implement wordSpacing and per-inline lineHeight.
Change line-height to use percentages rather than pixels.
2015-12-30 12:00:33 -08:00
Adam Barth
0633830c55 Remove the last remnants of CSS
This patch also lets us remove FontFamilyNames, which is one of two
remaining clients of jinja2.
2015-12-29 21:20:10 -08:00
Adam Barth
bd3a181dac Remove IDL from engine/core/text
Instead, use our new template magic.
2015-12-25 20:31:51 -08:00
Adam Barth
e5a42b6bb8 Add support for letterSpacing 2015-12-03 14:56:20 -08:00
Adam Barth
15a638332c Text snaps to pixel grid, images don't
Previously, we tried to use the render tree's paint offset to move the text to
the proper position, but that appears to snap to integer logical pixels,
introducing jitter. Now we use the SkCanvas's matrix to position the text,
removing the jitter.

Fixes https://github.com/flutter/flutter/issues/234
2015-11-20 12:49:01 -08:00
Adam Barth
a5768f2718 Remove the DOM and CSS
We don't use the DOM or CSS anymore. Instead, we work directly with the render
tree.
2015-10-24 00:26:24 -07:00
Adam Barth
1a5465c570 Delete OldTextPainter
Also, delete all references to DOM APIs.
2015-10-23 12:07:55 -07:00
Adam Barth
08729e37d2 Fix some fiddly bits in ParagraphBuilder 2015-10-23 09:47:02 -07:00
Adam Barth
eb594bffdc Make NewTextPainter actually work
The NewTextPainter is still disabled by default. A future patch will flip the
flag to enable it.

This patch uses a new approach to writing bindings by encoding data into array
buffers. This approach is more efficient than the existing IDL based approach.
If this works out well, we should convert our other performance-sensitive
interfaces to this approach in future patches.
2015-10-23 08:41:23 -07:00
Adam Barth
8d20440658 Start sketching out new dart:ui API
This patch starts down the process of cleaning up the dart:ui API. In this
approach, we use Dart code to specify the interface instead of IDL. The code in
this patch is far from complete. It's just a sketch to see how this sort of
approach might work.
2015-10-12 11:12:05 -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
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
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