310 Commits

Author SHA1 Message Date
Adam Barth
aec7d422e7 Pass the Mozart ViewHost into Dart
Dart needs access to the ViewHost in order to create child views.
2016-02-03 14:39:45 -08:00
Devon Carew
3c83f895ed some work towards a --start-paused flag 2016-02-02 11:44:01 -08:00
Adam Barth
c3c5af1fbe Move Flow layers to //flow/layers 2016-01-30 23:35: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
4fe584c757 Revert "Update the DartVM"
This reverts commit 3e7cf0b74e5b49ac7a92fa34e4c4117ea871b3da.
2016-01-29 13:38:32 -08:00
Adam Barth
3e7cf0b74e Update the DartVM 2016-01-29 12:39:29 -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
215b19e3fc Add the ability to create child scenes
This patch contains Dart bindings for adding a child scene when running in
Mozart. The child scene is currently ignored, but a later patch will actually
incoporate it into the tree.
2016-01-28 16:08:42 -08:00
Adam Barth
9ee9721b1b Revert "Update DartVM"
This reverts commit ca0342acd20bf2beeeb02bf147fe0071ce5ada65.
2016-01-28 11:19:32 -08:00
Adam Barth
ca0342acd2 Update DartVM 2016-01-27 12:34:17 -08:00
Adam Barth
5908970756 Update Skia version 2016-01-27 12:21:26 -08:00
Adam Barth
c3a78a1796 Remove dependencies on ui/gfx/geometry
We have enough geometry classes kicking around. We don't need the
ui/gfx/geometry types too.
2016-01-26 23:57:20 -08:00
Jason Simmons
50bdfd2f86 Dart/JNI: improve Java method lookup
Add more rules to determine which overloaded Java method should be invoked
for a given Dart call.  In particular, check whether the class of a
Dart-wrapped Java object matches the type declared for the corresponding
argument in the Java method.
2016-01-25 16:51:09 -08:00
Jason Simmons
57ec43971e Merge pull request #2283 from jason-simmons/jni_reflection_wrapper
Dart/JNI: reflection-based wrapper for the raw JNI API
2016-01-25 10:41:37 -08:00
Adam Barth
f7731bbdd2 Switch whitespace mode back to pre-wrap
When we removed position: sticky, we introduced a subtle line breaking
bug to pre-wrap that would cause whitespace to accumulate at the
beginning of lines that follow unclean breaks. This patch adds back the
deleted code (cleansed of the position sticky bits).
2016-01-25 00:03:08 -08:00
Jason Simmons
80547a2d2a Dart/JNI: reflection-based wrapper for the raw JNI API
Example:
  JavaClass dateFormatClass = Java.getClass('java.text.SimpleDateFormat');
  JavaObject format = dateFormatClass.newInstance('yyyy.MM.dd');
  print(format.parse('2016.01.01').getYear());
2016-01-22 16:27:36 -08:00
Adam Barth
8b4d246edf Merge pull request #2280 from abarth/window_insets
Improve handling of window insets on Android
2016-01-21 11:34:50 -08:00
Adam Barth
33d7553e39 Improve handling of window insets on Android
Now that we understand window insets, we don't need to hard-code the size of
the status bar. Also, convert the viewport metrics to be consistently in
physical pixels.
2016-01-21 11:24:17 -08:00
Jason Simmons
2ea1692e7d Dart/JNI: support all field and array data types 2016-01-20 10:41:37 -08:00
Jason Simmons
80f7338602 Fix Dart/JNI string conversion to treat the data as UTF-16 2016-01-19 12:26:01 -08:00
Adam Barth
4888996b1b Clean up DartInvoke
Remove the non-initializer version of DartInvokeAppClosure and rename
the function to the simpler DartInvoke. Also, add a special case for
DartInvokeVoid to make the callers prettier.
2016-01-18 20:47:47 -08:00
Adam Barth
c04b57b27a Remove FromArgumentsWithNullCheck
We use FromArguments everywhere now.
2016-01-18 20:47:47 -08:00
Adam Barth
c9cf1f3b95 Remove integration between tonic and WTF::Vector
There's no reason to use WTF::Vector here over std::vector.
2016-01-18 20:47: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
Adam Barth
1f4416f87b Move microtask queue into tonic
Moving the microtask queue into tonic solves three problems:

1) Removes three levels of indirection when invoking microtask
callbacks.
2) Removes the sky/engine/dom directory entirely.
3) Removes the last client of the (inefficient) DartValue class.
2016-01-18 16:59:52 -08:00
Ian Hickson
6fb5ebe38a Merge pull request #2270 from Hixie/fontWeight
FontWeight.lerp
2016-01-17 22:29:24 -08:00
Ian Hickson
e423d48ebf Color.opacity
Sometimes you want the alpha channel as a double rather than an int.
For convenience, provide an accessor on Color that returns this.
2016-01-15 23:28:13 -08:00
Ian Hickson
2ea197b9a7 FontWeight.lerp
Also, fix FontWeight.toString and add some type annotations on the constants.
2016-01-15 21:18:59 -08:00
Jason Simmons
fd672e4196 JNI/Dart: support for more data types
* Conversion of all primitive types, wrapped Java objects, and nulls between Dart and Java
* A way to distinguish float arguments from doubles when calling Java methods
* Construction of a Dart JniClass from a Java class object
2016-01-14 13:32:07 -08:00
Adam Barth
0b629d419f Move //sky/compositor to //flow
Now that the compositor doesn't have any tricky deps, we can make it a
top-level project, which saves a bunch of typing.
2016-01-12 22:39:51 -08:00
Adam Barth
8d00bc118c Fix build with -Werror=return-type
We need to return a value from these functions to make clang happy.
2016-01-12 20:00:46 -08:00
Jason Simmons
acfbced1dc JNI bridge support for constructors, arrays, and strings 2016-01-12 15:58:33 -08:00
Jason Simmons
35863afd4d Merge pull request #2246 from jason-simmons/jni_method_call
Implement simple method calls in the Dart/JNI bridge
2016-01-12 14:49:27 -08:00
Adam Barth
bec6ad5d3f Merge pull request #2178 from floitschG/handleRealTime
Add 'HandleRealTimeEvents' to window.
2016-01-12 12:25:13 -08:00
Adam Barth
d4506ee6a4 Remove deprecated Dart methods
All the clients have migrated to the new methods.

Fixes https://github.com/flutter/flutter/issues/1080
2016-01-12 10:32:13 -08:00
Jason Simmons
a5104c4a61 Implement simple method calls in the Dart/JNI bridge
Also adopt a standard pattern for handling exceptions in JNI APIs
2016-01-12 10:02:32 -08:00
Adam Barth
d4a7fa8802 Merge pull request #2243 from abarth/faster_draw_image
Use a slightly faster path for drawImage
2016-01-11 19:49:25 -08:00
Adam Barth
b63aac40f1 ShaderLayer should actually be ShaderMaskLayer
The shader is supposed to be drawn on top of the children as a mask. The
previous drawing code was incorrect.
2016-01-11 16:45:35 -08:00
Adam Barth
9949c8aaf6 Add ShaderLayer to Flutter compositor
We need this to implement RenderShaderMask properly. See #1155.
2016-01-11 15:03:25 -08:00
Adam Barth
1cb2e9a21a Merge pull request #2244 from abarth/fix_draw_atlas
Fix bindings for drawAtlas
2016-01-11 11:18:05 -08:00
Adam Barth
47040aafbb Fix bindings for drawAtlas
In changing the binding systems, I broke the colors parameter to drawAtlas. It
was looking for an array of ints rather than an array of Colors. Now we use
CanvasImage, which has the proper converter.

Fixes #1137
2016-01-11 11:17:34 -08:00
Adam Barth
ca629db532 Use a slightly faster path for drawImage
We don't need the strict mode for legacy compatibility because we don't have
any legacy yet. At some point, we might want to expose the strict mode for
people who want to pack their sprite sheets very tightly, but the sprites
library uses drawAtlas instead already.
2016-01-11 11:11:38 -08:00
Ian Hickson
f77acf0e80 Rename StatisticsOverlay to PerformanceOverlay.
Also, remove compositor_options in favour of four int constants, four
bitwise ands, and a few zero-equality comparisons, since it doesn't
seem we'll need this to scale much after all.
2016-01-10 23:39:13 -08:00
Adam Barth
3cce3f0d7e Add some more trace events to the compositor 2016-01-09 00:48:42 -08:00
Adam Barth
1486d205f8 Merge pull request #2235 from abarth/compute_paint_bounds
Compute paint bounds from cull rects
2016-01-08 19:02:38 -08:00
Hixie
720bda36e8 Better Rect.intersect documentation. 2016-01-08 16:50:57 -08:00
Adam Barth
f7d1856bd0 Compute paint bounds from cull rects
Rather than relying upon the rects passed in from Dart, the compositor
should compute the paint bounds of layers from the cull rects of the
underlying SkPictures. This approach is better because it will handle
effects like shadows that paint outside the incorrect paint bounds we
use today (as well as shrinking around empty space).
2016-01-08 16:05:34 -08:00
Jason Simmons
087da3237a Merge pull request #2227 from jason-simmons/jni_bind_library
Move the JNI bridge out of dart:ui and into a separate dart:jni library
2016-01-08 14:01:23 -08:00