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

Unified Diff: mojo/services/surfaces/surfaces_impl.cc

Issue 756673004: Surfaces should acknowledge frame submissions (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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/surfaces/surfaces_impl.cc
diff --git a/mojo/services/surfaces/surfaces_impl.cc b/mojo/services/surfaces/surfaces_impl.cc
index 10414f92ccc4be7c7c763ef0a19c21bd55429f91..b1c24bfa3c5db6b6235a9c51dc72af2467a888c3 100644
--- a/mojo/services/surfaces/surfaces_impl.cc
+++ b/mojo/services/surfaces/surfaces_impl.cc
@@ -4,6 +4,7 @@
#include "mojo/services/surfaces/surfaces_impl.h"
+#include "base/debug/trace_event.h"
#include "cc/output/compositor_frame.h"
#include "cc/resources/returned_resource.h"
#include "cc/surfaces/display.h"
@@ -14,6 +15,11 @@
#include "mojo/converters/surfaces/surfaces_type_converters.h"
namespace mojo {
+namespace {
+void CallCallback(const mojo::Closure& callback) {
+ callback.Run();
+}
+}
SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager,
uint32_t id_namespace,
@@ -41,7 +47,10 @@ void SurfacesImpl::CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) {
factory_.Create(id.To<cc::SurfaceId>(), size.To<gfx::Size>());
}
-void SurfacesImpl::SubmitFrame(SurfaceIdPtr id, FramePtr frame_ptr) {
+void SurfacesImpl::SubmitFrame(SurfaceIdPtr id,
+ FramePtr frame_ptr,
+ const mojo::Closure& callback) {
+ TRACE_EVENT0("mojo", "SurfacesImpl::SubmitFrame");
cc::SurfaceId cc_id = id.To<cc::SurfaceId>();
if (cc::SurfaceIdAllocator::NamespaceForId(cc_id) != id_namespace_) {
// Bad message, do something bad to the caller?
@@ -51,8 +60,8 @@ void SurfacesImpl::SubmitFrame(SurfaceIdPtr id, FramePtr frame_ptr) {
return;
}
factory_.SubmitFrame(id.To<cc::SurfaceId>(),
- frame_ptr.To<scoped_ptr<cc::CompositorFrame> >(),
- base::Closure());
+ frame_ptr.To<scoped_ptr<cc::CompositorFrame>>(),
+ base::Bind(&CallCallback, callback));
client_->FrameSubmitted();
}

Powered by Google App Engine
This is Rietveld 408576698