241 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Chinmay Garde
a59456d63c Initialize the global dart library natives separately and outside the isolate create callback 2016-01-04 16:53:19 -08:00
Ian Hickson
81f56588dc Implement wordSpacing and per-inline lineHeight.
Change line-height to use percentages rather than pixels.
2015-12-30 12:00:33 -08:00
Adam Barth
b4377c93dd Remove RuntimeEnabledFeatures
This complex machinery made sense for Blink, which has hundreds of
developers. In our case, we're just moving around two bools. We can do
that in a much simpler way.
2015-12-29 22:27:18 -08:00
Adam Barth
96e66145e9 Merge pull request #2206 from abarth/rm_dead_platform_code
Remove dead code from engine/platform
2015-12-29 22:01:19 -08:00
Adam Barth
c2a5c65572 Remove dead code from engine/platform
Highlights include:
 - A Base64 encoder/decoder
 - A JSON encoder/decoder
 - A JPEG and a PNG encoder
2015-12-29 21:39:16 -08:00
Adam Barth
0633830c55 Remove the last remnants of CSS
This patch also lets us remove FontFamilyNames, which is one of two
remaining clients of jinja2.
2015-12-29 21:20:10 -08:00
Adam Barth
c5fee9d9b8 Remove unused C++ code
This code was referenced by the IDL compiler, which we no longer use.
2015-12-29 11:02:36 -08:00
Adam Barth
03e3948828 Remove Path.idl
This patch removes the last IDL file from the build and unhooks the bulk
of the IDL compiler from the build system. A later patch will actually
delete the IDL compiler.
2015-12-29 00:41:30 -08:00
Adam Barth
b714feca62 Remove IDL from Canvas and related interfaces
After this patch, Path is the only interface using IDL.
2015-12-29 00:21:14 -08:00