13 Commits

Author SHA1 Message Date
James Robinson
50527025ca Update from https://crrev.com/315085
This includes the switch to libc++ on Android.

Other fixes:

*) Add (dumb) impl of OrderingBarrier() to command buffer
*) "base/debug/trace_event.h" -> "base/trace_event/trace_event.h"
*) Added a few <cmath> includes to sky

Review URL: https://codereview.chromium.org/903273002
2015-02-06 15:14:04 -08:00
Adam Barth
407fb582bd Sky should use an SkPicture when drawing
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
2015-01-19 18:47:53 -08:00
James Robinson
a88056c0b1 Use local ids for Surfaces APIs that can only apply to local surfaces
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
2015-01-14 10:25:31 -08:00
Ojan Vafai
0fcf250d03 Make reftests work for sky.
-Add a --testing flag to sky_viewer and cause it to paint into an
SkBitmap instead of a ganesh surface so we can get the pixels out.
-Add GetPixelsForTesting to layer.cc to actually grab out the pixels.
-Add a reftest and a mismatch reftest. They need a setTimeout after
the load event. Unclear why or what the right fix is. Maybe we should
give internals some way to force the paint? If we don't have the
setTimeout, we paint a white page (so we do a paint, but with no
content).
-Add a DisplayDelegate to Layer so that Viewer can decide whether
to use the real ganesh backend or the SkBitmap one without littering
the whole code-base with is_testing bools and logic.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/797063002
2014-12-12 16:45:49 -08:00
Colin Blundell
7db78fcb33 Restructure public side of surfaces service.
This CL goes from this:
  //mojo/services/public/cpp/surfaces
  //mojo/services/public/interfaces/surfaces

to this:
  //mojo/services/surfaces/public/cpp
  //mojo/services/surfaces/public/interfaces

This CL also makes the Mojo-side changes required to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/792813002
2014-12-10 14:43:23 +01:00
Adam Barth
426d193ca6 Fix DCHECK(gr_texture) when running test_sky
We shouldn't bother trying to draw a 0x0 sky::Layer. It makes Ganesh unhappy.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/759763002
2014-11-25 12:11:59 -08:00
Adam Barth
79c704dc99 Fix several leaks in the Sky compositor
When tearing down the Sky compostior, we need to destroy the GL context and all
the textures in the resource manager.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/761503004
2014-11-25 12:11:05 -08:00
Adam Barth
f94dc376d4 Surfaces should acknowledge frame submissions
Previously, there was no way for clients of the surfaces service to
appropriately rate-limit their frame submissions. We tried using the "return
resources" signal to rate-limit, but that's really a measure of how quickly
you're submitting new resources rather than how quickly the system is putting
up frames.

Currently, only the Sky compositor listens to this signal. Using this signal,
we're able to run sky/examples/spinning-square.sky in sync with the surfaces
service (that is, submitting exactly one frames every 17ms).

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/756673004
2014-11-24 16:21:53 -08:00
Adam Barth
93d4190547 Add some trace events to Sky compositor
This CL adds some basic trace events to the Sky compositor so we can see what's
going on.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/757643002
2014-11-24 09:54:28 -08:00
Adam Barth
8c30238f4f Enable the Sky compositor again
This CL fixes two bugs:

1) We need to enter the Ganesh context in order to destroy the GrContext.

2) We had a race condition whereby we'd try to upload a frame to a surface that
   didn't yet exist. This CL fixes that race by adding a state to LayerHost to
   wait for the surface to be created before trying to upload to it.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/753643002
2014-11-21 12:15:30 -08:00
Adam Barth
cc9da50737 Enable the Sky compositor
Turns out we need to reset the context before switching back to drawing with
Ganesh (i.e., call resetContext on the GrContext) to clean out whatever state we've
changed in the GL context. Now the city-list and the flights-app demos work.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/752653002
2014-11-21 09:57:47 -08:00
Adam Barth
83b49ee3ae Use the scheduler to drive the Sky compositor
This CL lets us put up more than one frame by using the scheduler to schedule
the next frame.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/744753003
2014-11-20 14:13:36 -08:00
Adam Barth
59f18e7ef2 Add a simple compositor for Sky
Currently we're only able to put up one frame and we can have only one layer, but
this is enough to draw a green circle in a sample app. A future CL will wire this
up to Sky and add support for drawing a second frame.

R=eseidel@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/740923002
2014-11-20 14:10:40 -08:00