Previously, the trace coordinator would try to write a trace to the file
system, but it is awkward to write to the file system on Android. Instead, we
now stream the trace data to a data pipe. The Sky debugger consumes that data
pipe and sends it to the host via the command HTTP server.
R=eseidel@chromium.org, jamesr@chromium.org
Review URL: https://codereview.chromium.org/853943005
Previously, we were creating a new texture for every frame. Using tracing on a
Nexus 5, that appears to cost about 6ms per frame on the GPU thread. After this
CL, we keep a cache of recently used textures and only allocate a new one when
either (1) we don't have one free or (2) our size requirements have changed.
If our size requirements change, we dump the whole texture cache. In the
future, we'll probably need something fancier if we ever need more than one
size texture per frame.
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/845963006
In preperation for removing the Client annotation from ServiceProvider
this passes a second parameter of type ServiceProvider in the shell and
application Connect calls. In this patch the type signatures are updated
but the second parameter is basically unused. The intention is that the
first parameter |services| will be used for the connecting application to
request services from the connected application (as it does currently)
and the second parameter |exported_services| be used for the connecting
application to provide services to the connected application. We have
very few services exported in the second direction today - I'll update
them to use the second parameter in a follow-up patch.
R=darin@chromium.org
Review URL: https://codereview.chromium.org/845593003
Surfaces identifiers have a local and a namespace component. The
namespace is particular to a connection. The local component is up to
the endpoint of the connection to manage. In contexts where a surface
that may be from anywhere is referenced, a fully qualified ID with both
the local and namespace component is needed in order to be unambiguous.
In contexts that can only apply to local surfaces only the local id is
needed.
This updates the mojo.Surface APIs that can only refer to local IDs to
only take the local component. In particular creating, destroying, or
submitting a frame can only refer to surfaces created on that connection.
References to surfaces within a frame may refer to local or foreign
surfaces so they use fully qualified IDs.
This also skips the SurfacesService indirection since many applications
can perform useful operations on a mojo.Surface interface such as create
surfaces and submit frames without knowing their ID namespace. The
namespace component is needed only to pass fully qualified IDs to other
actors that may wish to reference the produced frame.
R=sky@chromium.org
Review URL: https://codereview.chromium.org/826423008
Specs: introduce layoutDescendants() to avoid work when a layout
manager is unaffected by its childrens' intrinsic dimensions
Examples: update for layoutDescendants() change
Specs: add "lifetime" to resolver settings so that a transition can
avoid having to dirty every consumer of the property every frame when
it only needs to update the objects that are changing that frame
Specs: expose the parents on AbstractStyleDeclarationList subclasses
Specs: fix documentation around autoreap
Specs: fix definition of setProperty()
Specs: clean up the dimension-related logic of layout managers
Review URL: https://codereview.chromium.org/850593003
I was going to remove all this anyway since we don't need it in sky, all sheets
are local and there's no concept of a pending sheet now.
I also removed the dirty bit I added to StyleSheetCollection. The bit
is not correct and is preventing us from correctly processing sheets and
invalidating style. I'll add it back later when I understand how to add
the dirty bit correctly.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/846183002
Add a simple example based on the window and view managers.
The skydb app can now handle apps that want to embed another view.
Corrected a problem in unique module name generation. An otherwise unique module name could be shadowed by a parameter name (service_provider in ViewManagerService Embed). Appended a "$" suffix to module names to avoid the collision.
BUG=
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/845103004
This fixes 3 little bugs in skydb:
1. Adds a logcat command to make it easy to see android logs
2. Fixes using relative build dirs in skydb start
3. Stops sending /quit to debugger.cc since mojo shutdown
doesn't actually work (crashes).
--gdb is still broken, but I'll fix that in a second change.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/852483002
I changed skydb start to take a build directory
and read the configuration out of gn args instead
of --release, --debug, etc. This should be more
flexable and handle all the crazy asan cases
mopy/config.py tries to. Once we merge sky/tools
into mojo/tools we should make mopy/config use this
method too.
This follows similar patterns to what
mojo/tools/android_mojo_shell.py does, but doesn't
use as much of the (old) android_commands and forwarder
logic. We could even remove all of that
build/android/pylib code by calling the (new)
adb reverse instead of using Forwarder (in a later patch).
This still only supports a single skydb running
at once, but it should be trivial to move the
skydb.pids file into the build directory or to have
it support more than one instance. The big question
there is what the command-line usage should look like
when supporting more than one running instance. See
the mojo-dev thread on the subject.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/816693006
Style sharing didn't play nicely with elements getting
their display adjusted based off the parent's display.
We style share without doing adjusting, so we need to
avoid style sharing if adjusting would result in
a different style. Particularly, we need to make sure
that the display coercion would happen in the same way.
R=esprehn@chromium.org
Review URL: https://codereview.chromium.org/839153002
This makes skydb pass a command_port to prompt.cc
as a commandline argument. I removed passing of the
url and instead pass the url via a separate /load command.
This has the nice side effect of guarenteeing that
the sky instance is up and ready to respond to commands
when skydb exits. It also prepares us for running
more than one copy of prompt.cc as jamesr requested
for both Release and Debug or for on both your android
device as well as your local machine.
R=abarth@chromium.org, jamesr@chromium.org
BUG=
Review URL: https://codereview.chromium.org/841113003
This makes it much easier to work with a device where we
don't expect a persistent commandline session. Prompt no longer
actually makes a prompt but rather just runs an http server.
This is just a v1 patch. It doesn't work with android yet
and it isn't smart enough to allow you to run more than one
copy of prompt.cc at the same time (since you can't control
the port it listens on). If you have a second copy of
prompt runnning (or anything else bound to port 7777) it will
just crash.
We could make this a lot better, including splitting out the
pid-file tracking for sky_server into sky_server instead of
having skydb manage it.
R=ojan@chromium.org, abarth@chromium.org
BUG=
Review URL: https://codereview.chromium.org/840973002
Prior to this change the magic sequence was '#!mojo:' and the url of the content handler app included mojo:. This works only for mojo: urls, but we want
other schemes. So, the magic sequence is now '#!mojo ' and 'mojo ' is not part of the resulting url.
R=aa@chromium.org
Review URL: https://codereview.chromium.org/821403003
Enable Sky applications to be written in terms of the Application,
Shell, ServiceProvider classes.
Add a shellProxyHandle() method to the Sky Internals class. It returns
a message pipe handle that the JS Shell class will assume ownership of.
BUG=
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/837283002
This way we get some broad pixel test coverage.
Do this by dumping the png from the flights app,
uploading it to google storage and then having
the reference file load the uploaded file.
This isn't a good long-term solution. Long-term
we should dump paint commands (or some other
textual representation) and/or make more targetted
reftests that don't need pngs. As such, the process
for doing this is painful and manual. If we decide
we want to have pixel tests properly, we'll want
to do something more automated obviously.
Also, turn on the discard_transparency bool when
encoding the pngs. Otherwise, the png is lossy
and none of this works.
R=esprehn@chromium.org
Review URL: https://codereview.chromium.org/836363003
This patch is largely just a rename since updateLayoutIgnorePendingStylesheets()
didn't really do anything except call updateLayout() now as nothing was reading
the ignorePendingStyleSheets state, and no callers used the synchronous post
layout task option which was meant for plugins (which Sky doesn't have).
Placeholder styles were related and just add confusion since things pretend to
be display: none while <import>'s are loading. We should expose a real API for
avoiding FOUC instead of pumping frames with display: none elements when
imports are loading.
I had to skip the layout/continuations.sky test since it always crashes now
with an ASSERT failure about a bad cast (filed as bug 446739). The bug already
existed, this patch just makes that one test hit it.
BUG=446739
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/834693007
1. If notifyTestComplete is called before the first paint,
give a clear assert instead of a confusing crash.
2. Add runAfterDisplay. This is a copy of the equivalent
file in Blink. Avoids the incorrect 100ms setTimeout. I had
thought there was a deeper bug here, but it appears to just
be the issue from #1 now that we properly pump frames
in testing mode by using a face Surfaces application.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/826343003
This is a proof of concept for replacing ui/views
code with Sky instead. erg says this will allow him
to delete 10s of thousands of LOC from mojo.
Mojo does not yet expose the current binary's URL:
https://docs.google.com/a/chromium.org/document/d/1AQ2y6ekzvbdaMF5WrUQmneyXJnke-MnYYL4Gz1AKDos
So I've worked around that by passing the url
of the binary via the helper script.
I discovered several bugs in the wm_flow code
including that it doesn't handle view resizes
(during embiggen). Related, I discovered that
every time a new window is made it drops the
connections to the embedded.cc app from the
previous window, since the ViewManagerDelegate
is incorrectly implemented as part of the
ApplicationDelegate on both app.cc and embedded.cc.
We'd need to split out a separate per-view object
in both of those apps to handle the
ViewManagerDelegate calls.
There are some changes to logging during loading
as well as the CopyToFile helper to have better
error reporting. I hit several issues early on trying
to get mojo to load the http: urls correctly, including
eventually running out of disk space on my /tmp
and mojo then silently failing to launch the app
(due to mojo never clearing its caches crbug.com/446302).
I had to re-write the mojo_demo.sh script in python
as well as split the sky_server handling code out of
skydb into a separate python module in order to cleanly
launch sky_server. We could use a separate server
if we wanted to but the primary benefit of sky_server
is that it sets up the proper url->disk mappings into
the generated file directories, etc.
BUG=443439
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/817573003
This adds two benchmarks, one for flights-app which doesn't use data binding
and one for city-list which uses lots of it.
1st runs in each benchmark contain the cost of collecting all the metadata
about bindings and templates in addition to creating instances. Later runs
only contain the cost of creating instances.
Overall it looks like SkyBinder is 24.4% - 35.5% faster depending on if
you're using data binding (the performance improvement is larger if you are).
It also appears to put less pressure on the GC.
== flights-app.sky benchmark ==
TemplateBinding:
flights-app.sky => [103.0, 27.0, 26.0, 26.0, 27.0, 26.0, 39.0, 29.0, 29.0, 72.0]
flights-app.sky => [101.0, 27.0, 27.0, 27.0, 27.0, 26.0, 37.0, 33.0, 26.0, 69.0]
flights-app.sky => [103.0, 27.0, 26.0, 26.0, 27.0, 26.0, 37.0, 27.0, 28.0, 71.0]
1st run avg = 102.33333333333333
avg = 33.148148148148145
SkyBinder:
flights-app.sky => [78.0, 25.0, 25.0, 25.0, 25.0, 30.0, 34.0, 26.0, 25.0, 32.0]
flights-app.sky => [77.0, 28.0, 25.0, 26.0, 26.0, 28.0, 31.0, 23.0, 26.0, 26.0]
flights-app.sky => [77.0, 25.0, 25.0, 24.0, 25.0, 28.0, 31.0, 23.0, 25.0, 24.0]
1st run avg = 77.33333333333333
avg = 26.51851851851852
24.4% reduction for 1st run, 20% reduction for normal runs. Normal runs
actually seem maybe only 5% faster, but it looks like pre SkyBinder there
were occasional runs that took 250% longer than normal from GC pauses. If I
increase the iteration count for SkyBinder I can see those long pauses
again, but they're much less frequent presumably because SkyBinder creates
less garbage.
== city-list.sky benchmark ==
TemplateBinding:
city-list.sky => [820.0, 609.0, 600.0, 529.0, 430.0, 437.0, 387.0, 462.0, 541.0, 415.0]
city-list.sky => [827.0, 599.0, 551.0, 481.0, 436.0, 425.0, 363.0, 366.0, 427.0, 364.0]
city-list.sky => [823.0, 574.0, 467.0, 483.0, 444.0, 429.0, 364.0, 363.0, 433.0, 367.0]
1st run avg = 823.3333333333334
avg = 457.25925925925924
SkyBinder:
city-list.sky => [521.0, 369.0, 320.0, 285.0, 319.0, 273.0, 267.0, 262.0, 272.0, 331.0]
city-list.sky => [553.0, 362.0, 314.0, 284.0, 327.0, 278.0, 263.0, 264.0, 249.0, 290.0]
city-list.sky => [556.0, 355.0, 317.0, 289.0, 333.0, 277.0, 269.0, 266.0, 264.0, 263.0]
1st run avg = 543.3333333333334
avg = 294.8888888888889
34% reduction for 1st run, 35.5% reduction for subsequent runs. This also
shows less variance in the later runs than pre SkyBinder which I think might
again be less GC pressure.
TBR=ojan@chromium.org
BUG=
Review URL: https://codereview.chromium.org/834983002
Includes changes for CommandLine moving into the base:: namespace, some
PickleIterator updates, and some animation API changes.
Review URL: https://codereview.chromium.org/817653003
The ownerScope property is equivalent to walking up the parentNode
pointers until you hit the top and returning that node if it's a
Document or ShadowRoot.
This means that the ownerScope of ShadowRoot and Document is always
itself, and the ownerScope of an Element that is not the descendant
of a ShadowRoot, and is not in the document is null.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/810793005
We were not setting the __proto__ property of the generated constructor
so the generated class didn't inherit from the passed class which meant
that statics were not available.
This patch adds the missing call to setPrototype (which sets __proto__).
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/814683002
The syntax for implementing a SkyElement is now:
<sky-element name="element-name">
<template>
<!-- template here -->
</template>
<script>
module.exports = class extends SkyElement {
attached() {
// ...
}
// .. methods here ..
}.register();
</script>
</sky-element>
The register() static method on SkyElement subclasses calls
document.registerElement() and returns the generated constructor.
It uses the parent <sky-element>'s name attribute to set the name
of the element.
R=rafaelw@chromium.org
Review URL: https://codereview.chromium.org/788943003
Surface IDs are composed of a namespace component and a local
identifier component. This splits up the two pieces in the mojom to make
it clearer.
This also simplifies the path for connecting to the surfaces service. In
order to perform any operations with surfaces, each client must know
what its id namespace value is. This was done by first connecting to a
SurfacesService interface and then calling CreateSurfaceConnection which
returned a Surface pointer and the namespace. Having to connect to this
extra interface and receive the Surface impl asynchronously complicated
startup code for applications by adding extra states in startup.
Instead of that, this allows connecting to the Surface interface
directly and promises that the ID namespace will be provided as the
first message in the pipe directed at the SurfaceClient. Callers can
then either block on startup or handle setting the ID namespace
asynchronously depending on what other things that thread could be doing
at the time.
In a follow-up, I plan to define the id namespace value 0 as meaning "the
namespace of this connection" which will allow creating surfaces and
submitting frames before learning the connection's namespace. The only
thing the namespace will be passing surface IDs to other clients for them
to embed.
This also removes the Size parameter from CreateSurface, which wasn't
used by anything. The size of submitted frames is part of the embedder /
embedee contract.
R=esprehn@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/807733002