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
Some host objects hold on to a lot of state and take time to tear down. This
patch adds the ability to dispose them eagerly to release resources faster.
Paint is an argument on most methods of Canvas, and in many uses the Paint
contains only a color. In this case, return the Paint's value to native code
as an int instead of constructing a list of attributes.
This improved run time on a drawRect benchmark by 35%.
We should probably expose this dial to clients eventually, but this patch just
makes our default match Skia's default of not anti-aliasing RRect and Path
clips.
CanvasImageDecoder is instantiated with a callback into a Dart closure.
That closure was holding references to the ImageDecoder and the returned
Image. The circular reference between the ImageDecoder and the callback
prevented the objects from being GCed, resulting in leakage of the image
buffer.
CanvasImageDecoder will now destroy the callback after it is invoked,
thus releasing its handle to the Dart closure.
This patch changes how we lookup native functions from Dart to be more
extensible. This patch paves the way for removing the dart:ui_internals
library.
I left this code along in my uber patch to remove the DOM and CSS, but it's
just as dead. Also, move lone files out of dead directories into more sensible
places.
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.
Instead, we can just concatenate the records together, which means you can view
the generated trace file without post-processing. Also, I've made the trace
file world-readable, so that you can trace a device without needing root
access.