28 Commits

Author SHA1 Message Date
Adam Barth
9c09565712 Update paths to account for buildroot 2016-08-09 13:52:15 -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
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
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
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
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
2838055627 Remove Paragraph#paint
We now use Canvas#drawParagraph.
2016-03-17 17:20:26 -07: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
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
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
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
1a5465c570 Delete OldTextPainter
Also, delete all references to DOM APIs.
2015-10-23 12:07:55 -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
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