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

Unified Diff: cc/surfaces/surface.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.cc
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc
index c7b11457d6076e814fb4239c01fcc16e13049d64..98ae58c0f3bcb2773c883f151101ee2c4ac125d6 100644
--- a/cc/surfaces/surface.cc
+++ b/cc/surfaces/surface.cc
@@ -33,10 +33,12 @@ Surface::~Surface() {
&current_resources);
factory_->UnrefResources(current_resources);
}
+ if (!draw_callback_.is_null())
+ draw_callback_.Run(false);
}
void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame,
- const base::Closure& callback) {
+ const DrawCallback& callback) {
DCHECK(factory_);
ClearCopyRequests();
TakeLatencyInfo(&frame->metadata.latency_info);
@@ -54,7 +56,7 @@ void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame,
factory_->UnrefResources(previous_resources);
}
if (!draw_callback_.is_null())
- draw_callback_.Run();
+ draw_callback_.Run(false);
draw_callback_ = callback;
factory_->manager()->DidSatisfySequences(
SurfaceIdAllocator::NamespaceForId(surface_id_),
@@ -106,9 +108,9 @@ void Surface::TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info) {
void Surface::RunDrawCallbacks() {
if (!draw_callback_.is_null()) {
- base::Closure callback = draw_callback_;
- draw_callback_ = base::Closure();
- callback.Run();
+ DrawCallback callback = draw_callback_;
+ draw_callback_ = DrawCallback();
+ callback.Run(true);
}
}
« no previous file with comments | « cc/surfaces/surface.h ('k') | cc/surfaces/surface_aggregator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698