Commit faa1c522 authored by abarth's avatar abarth Committed by Commit bot

OutputSurfaceMojo should bind its SurfacePtr on the impl thread

We can't call set_client on the main thread because that determines the thread
affinity of the SurfacePtr. Instead, we need to wait for the BindToClient
callback so we can bind the SurfacePtr on the impl thread.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/603663002

Cr-Commit-Position: refs/heads/master@{#296474}
parent 9236b542
......@@ -20,7 +20,6 @@ OutputSurfaceMojo::OutputSurfaceMojo(
output_surface_mojo_client_(client),
surface_(surface.Pass()),
id_allocator_(id_namespace) {
surface_.set_client(this);
capabilities_.delegated_rendering = true;
capabilities_.max_frames_pending = 1;
}
......@@ -31,6 +30,11 @@ OutputSurfaceMojo::~OutputSurfaceMojo() {
void OutputSurfaceMojo::ReturnResources(Array<ReturnedResourcePtr> resources) {
}
bool OutputSurfaceMojo::BindToClient(cc::OutputSurfaceClient* client) {
surface_.set_client(this);
return cc::OutputSurface::BindToClient(client);
}
void OutputSurfaceMojo::SwapBuffers(cc::CompositorFrame* frame) {
gfx::Size frame_size =
frame->delegated_frame_data->render_pass_list.back()->output_rect.size();
......
......@@ -31,6 +31,7 @@ class OutputSurfaceMojo : public cc::OutputSurface, public SurfaceClient {
// cc::OutputSurface implementation.
virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE;
virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE;
protected:
virtual ~OutputSurfaceMojo();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment