300 Commits

Author SHA1 Message Date
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
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
8b37dd7526 Add equality to textStyle and co 2016-01-08 09:10:53 -08:00
Jason Simmons
e75a0cb4aa Merge pull request #2224 from jason-simmons/jni_binding
Initial work toward exposing the Java native interface APIs in Dart
2016-01-07 15:27:46 -08:00
Jason Simmons
a9c22e9d8c Initial work toward exposing the Java native interface APIs in Dart 2016-01-07 15:06:35 -08:00
Adam Barth
ebe379ebcd Merge pull request #2220 from abarth/add_canvas_transform
Introduce Canvas.transform
2016-01-07 11:17:49 -08:00
Adam Barth
83351fa445 Introduce Canvas.transform
Canvas.transform is the same as Canvas.concat, just with a better name.

Fixes #1080
2016-01-07 10:53:46 -08:00
Jason Simmons
d5992106dd Include the class name in the IMPLEMENT_WRAPPERTYPEINFO macro expansion
This allow multiple uses of IMPLEMENT_WRAPPERTYPEINFO within a source file
2016-01-07 10:49:09 -08:00
Jason Simmons
443ba0759e Add Tonic macros for dispatching to static methods
DartArgIterator was starting at argument index 1 because it assumed that the
arguments include a pointer to the "this" object for an instance method.
DART_REGISTER_NATIVE makes the same assumption in the argument count.

This change adds versions of the macros that are suitable for static methods
with no implicit arguments.
2016-01-06 15:07:50 -08:00
Adam Barth
72c87f2722 Add direct wrappers to tonic
Instead of using a C++ object as a peer to the Dart wrapper, these wrapper hold
arbitrary data in the internal field of the Dart wrapper.
2016-01-06 11:45:26 -08:00
Chinmay Garde
a59456d63c Initialize the global dart library natives separately and outside the isolate create callback 2016-01-04 16:53:19 -08:00