There were two problems (both fixed in this CL):
1) When we were resized by the view manager, we forgot to deflate by the
device-pixel-ratio when converting to engine types. That caused use to
allocate a backing texture that was 9x what we needed.
2) When the surfaces system returned textures to us for re-use, we'd put them
into the cache even if they were the old size. That caused us to thrash the
texture cache. In this CL, we make the size of the textures in the cache
explicit.
R=eseidel@chromium.org
BUG=449001
Review URL: https://codereview.chromium.org/868263002
We now only preserve the whitespace inside a <t> element inside
the parser. This removes the known n^2 from reattaching whitespace
which should make parsing and appending nodes faster. I also
removed the dead WhitespaceMode code from the parser, and made
the dom-seralizer.sky auto indent the markup so the test output
would be readable.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/867963006
Many of the .so files in out/Debug are hundreds
of megabytes in size. md5sum can take seconds
to churn through them all, so I've added
a small caching layer which makes this script
take no time in the common case.
R=abarth@chromium.org
BUG=
Review URL: https://codereview.chromium.org/865463004
This replaces my previous --gdb work:
https://codereview.chromium.org/848013004/
And obsoletes my build-id based attempt:
https://codereview.chromium.org/788903011
Context:
mojo_shell downloads arbitrary binaries from
urls copying them to temp files before calling
dlopen. Because the names it used were random
this broke gdb, pprof, etc. tools which wanted
to make address -> symbol translations based
on the library load path.
The major thing this change does is move away
from the previous method of watching the logs
of mojo_shell for 'Caching %url as %file...'
messages or the /tmp/mojo_shell.%pid.map
file to having mojo_shell use a priori knowable
names for all of its library loads. Thus
we can similarly build a directory of correctly
named symboled binaries corresponding to the
expected load names of libraries.
This change does this in 3 pieces:
1. Introduces the concept of 'app ids' (which
are currently just the md5 of the distributed app
binary) and teaches dynamic_application_loader to
rename all apps to APP_ID.mojo before loading them.
This has the nice side-effect of always loading
an app with a dlopen/library name which is both
unique to the application as well as predictable.
2. Re-writes the mojo_cache_linker script to
no longer watch stdin/adb logcat for 'caching...'
messages and instead build a links directory
based on pre-determined app_ids (md5s) linking
back to the symboled binaries.
3. Remove a bunch of the former mojo_cache_linker
calling code which is no longer needed now that
the library_names of loaded application .so's are
predictable before launching mojo_shell
I'm happy to make app_ids fancier, originally I
was going to use ELF's build-id's directly:
https://codereview.chromium.org/788903011
but unfortunately gdbserver does not know
how to do a build-id lookup on the serverside:
https://groups.google.com/a/google.com/forum/#!topic/gdb-discuss/Fd0R-gFaqXkR=aa@chromium.org, abarth@chromium.org
Review URL: https://codereview.chromium.org/866383004
This removes the symmetrical nature of ServiceProvider and consistently
passes and uses a ServiceProvider + ServiceProvider& pair in places that
wish to bidirectionally expose services, such as the view manager.
The
view manager library now deals with InterfaceRequest<ServiceProvider>
and ServiceProviderPtr objects (i.e. c++ wrappers for handles) instead
of a concrete implementation of ServiceProvider to make it easier for
callers.
A number of places that were assuming a particular
ServiceProvider would always exist are updated to reflect the nullability
of the parameters in mojom and places that do not wish to ever look up
or provide services now pass nullptr instead of doomed pipe handles.
The JS application startup classes are reworked a bit to accomodate
exposing services on the third ConnectToApplication/AcceptConnection
parameter.
BUG=449432
R=abarth@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/858103002
Instead lets just iterate the list of sheets and ask each one questions. This
shouldn't be much slower since most widgets only have one sheet anyway.
I also moved the media query matching to the sheet collection. We weren't
correctly matching them since we only guarded the feature set, not the
addition to the list of active sheets.
R=abarth@chromium.org, ojan@chromium.org
Review URL: https://codereview.chromium.org/858423002
Previously, if you had a generated background image and a translucent (or
rounded) border, we would draw the image nine times because we would inflate
the fill rect to draw behind the border. With no-repeat, we only draw the image
once.
This saves 4.5% of record time on flights-app.
R=esprehn@chromium.org
Review URL: https://codereview.chromium.org/844193009
--origin tells mojo_shell to map all mojo: urls
to to a new base-url instead of the build directory.
This makes skydb's mojo_shell *always* use the network
loading path, which is what Android mojo_shell does
and is more like how mojo_shell will eventually be
used.
I also fixed the disk-space leak in the
dynamic_application_loader's NetworkLoader path
by having it immediately unlink the /tmp copy
of the library after dlopen.
In order to keep pprof working I had to teach the
dynamic_application_loader to write out a map of
/tmp/file -> url mappings so that we can fix
the pprof file afterwords.
This will "break" skydb --gdb on linux in exactly
as much as it is already broken on Android, but
I'm working on a build-id based solution for both
so that gdb knows how to find symbols for
non-existant randomly named /tmp libraries.
R=abarth@chromium.org, viettrungluu@chromium.org
BUG=450696
Review URL: https://codereview.chromium.org/829183005
In order for pprof to find the symbols in the profile, we need to rename the
binaries from foo.mojo to libfoo_library.so. This CL adds that step to the
stop_profiling command in skydb.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/812573006
This CL teaches the Sky compositor to record an SkPicture instead of just
drawing in immediate mode. Using an SkPicture will let us experiment with
various optimizations in Skia that preprocess the SkPicture before translating
the Skia commands to GL commands.
This CL also refactors the "display delegate" system now that we can hand off
an SkPicture to a rasterization backend. The new design requires fewer
backpointers and removes the static display delegate factory.
R=eseidel@google.com
Review URL: https://codereview.chromium.org/854303002
This only barely works. We pull down system libraries
once before we attach. The libraries we pull from
the device do not have debug symbols, but have enough
that we have decent callstacks. We launch a background
process to repeatedly update a cache directory with
symlinks into our build directory corresponding to the cache
names used on the device, however gdb doesn't watch
the solib-search-path directories to notice the links
as we add them.
Better solutions would be to add support for pulling
down full android symboled system images and using those
instead of pulling libraries off the device as well as
figure out how to get android binaries to support
build-id so that we can present a directory of build-id
associated libraries to gdb on boot and have it to build-id
based lookups of libraries instead of our current broken
watch-logs-and-add-symlinks approach.
If you know what you're doing with this you can actually
make debugging work on the device. It's not particularly
user friendly yet, but we'll work on it.
I added a build_dir member to skypy.paths.Paths
as a temporary measure before we move off of skypy's
paths and onto mopy's paths. This helped eliminate
problems with using a relative path in args.build_dir
as is common.
R=abarth@chromium.org, ojan@chromium.org, qsr@chromium.org
BUG=
Review URL: https://codereview.chromium.org/855663003
This mostly works. I haven't yet set up pulling down the
system binaries from the device to the host so that symbols
appear correctly, but I'll do that in the next patch.
One of the crazy things this patch adds it a script
to watch for loads on adb logcat and set up mappings
from the cache library names to the symboled binaries
in the out directory. Presumably other scripts may
want to share this functionality so I've made it its
own script.
Better would be to have mojo_shell spit out a file
including the cache mapping information and we could
watch that file instead of logcat, but this works
for now.
R=qsr@chromium.org
BUG=
Review URL: https://codereview.chromium.org/848013004
Instead of storing primitive values which makes the data
binding system throw away DOM each time we update each slot
lets just use objects and shift + pop. This means very little
data binding churn.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/802153004
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