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

Unified Diff: content/browser/compositor/delegated_frame_host.cc

Issue 465673003: Add callback when queueing frame on Surface to create backpressure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months 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/surfaces_pixeltest.cc ('k') | content/browser/compositor/surface_display_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/delegated_frame_host.cc
diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc
index 7a56f02e20ee6f6558dfe340f566d5b650fdffe8..74616ef9630582b8f1768c704a6315cb3b10a510 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -379,7 +379,12 @@ void DelegatedFrameHost::SwapDelegatedFrame(
scoped_ptr<cc::CompositorFrame> compositor_frame =
make_scoped_ptr(new cc::CompositorFrame());
compositor_frame->delegated_frame_data = frame_data.Pass();
- surface_factory_->SubmitFrame(surface_id_, compositor_frame.Pass());
+ surface_factory_->SubmitFrame(
+ surface_id_,
+ compositor_frame.Pass(),
+ base::Bind(&DelegatedFrameHost::SendDelegatedFrameAck,
+ AsWeakPtr(),
+ output_surface_id));
} else {
if (!resource_collection_) {
resource_collection_ = new cc::DelegatedFrameResourceCollection;
@@ -416,9 +421,9 @@ void DelegatedFrameHost::SwapDelegatedFrame(
pending_delegated_ack_count_++;
ui::Compositor* compositor = client_->GetCompositor();
- if (!compositor || !modified_layers) {
+ if (!compositor) {
SendDelegatedFrameAck(output_surface_id);
- } else {
+ } else if (!use_surfaces_) {
std::vector<ui::LatencyInfo>::const_iterator it;
for (it = latency_info.begin(); it != latency_info.end(); ++it)
compositor->SetLatencyInfo(*it);
« no previous file with comments | « cc/surfaces/surfaces_pixeltest.cc ('k') | content/browser/compositor/surface_display_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698