Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: sky/compositor/surface_holder.cc

Issue 744753003: Use the scheduler to drive the Sky compositor (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/compositor/surface_holder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sky/compositor/surface_holder.h" 5 #include "sky/compositor/surface_holder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
8 #include "mojo/converters/geometry/geometry_type_converters.h" 9 #include "mojo/converters/geometry/geometry_type_converters.h"
9 #include "mojo/public/cpp/application/connect.h" 10 #include "mojo/public/cpp/application/connect.h"
10 #include "mojo/public/interfaces/application/shell.mojom.h" 11 #include "mojo/public/interfaces/application/shell.mojom.h"
11 #include "sky/compositor/surface_allocator.h" 12 #include "sky/compositor/surface_allocator.h"
12 13
13 namespace sky { 14 namespace sky {
14 15
15 SurfaceHolder::Client::~Client() { 16 SurfaceHolder::Client::~Client() {
16 } 17 }
17 18
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 52
52 client_->OnSurfaceIdAvailable(surface_id_.Clone()); 53 client_->OnSurfaceIdAvailable(surface_id_.Clone());
53 } 54 }
54 55
55 void SurfaceHolder::ReturnResources( 56 void SurfaceHolder::ReturnResources(
56 mojo::Array<mojo::ReturnedResourcePtr> resources) { 57 mojo::Array<mojo::ReturnedResourcePtr> resources) {
57 // TODO(abarth): The surface service shouldn't spam us with empty calls. 58 // TODO(abarth): The surface service shouldn't spam us with empty calls.
58 if (!resources.size()) 59 if (!resources.size())
59 return; 60 return;
60 client_->ReturnResources(resources.Pass()); 61 client_->ReturnResources(resources.Pass());
61 client_->OnReadyForNextFrame();
62 } 62 }
63 63
64 void SurfaceHolder::OnSurfaceConnectionCreated(mojo::SurfacePtr surface, 64 void SurfaceHolder::OnSurfaceConnectionCreated(mojo::SurfacePtr surface,
65 uint32_t id_namespace) { 65 uint32_t id_namespace) {
66 surface_ = surface.Pass(); 66 surface_ = surface.Pass();
67 surface_.set_client(this); 67 surface_.set_client(this);
68 surface_allocator_.reset(new SurfaceAllocator(id_namespace)); 68 surface_allocator_.reset(new SurfaceAllocator(id_namespace));
69
70 client_->OnReadyForNextFrame();
71 } 69 }
72 70
73 } // namespace sky 71 } // namespace sky
OLDNEW
« no previous file with comments | « sky/compositor/surface_holder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698