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.
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.
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.
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.
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.
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
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.
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.
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.
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.