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

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

Issue 432093003: Enqueuing new frames in a Surface should cause Displays to reaggregate it (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
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 09b1c27ff62deed054900d045005952664b4b0fe..4be1901226139bba63466e78df944fcb0d5121eb 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -343,9 +343,11 @@ void DelegatedFrameHost::SwapDelegatedFrame(
}
last_output_surface_id_ = output_surface_id;
}
+ bool modified_layers = false;
if (frame_size.IsEmpty()) {
DCHECK(frame_data->resource_list.empty());
EvictDelegatedFrame();
+ modified_layers = true;
} else {
if (use_surfaces_) {
if (!surface_factory_) {
@@ -357,12 +359,15 @@ void DelegatedFrameHost::SwapDelegatedFrame(
}
if (surface_id_.is_null() || frame_size != current_surface_size_ ||
frame_size_in_dip != current_frame_size_in_dip_) {
+ // TODO(jbauman): Wait to destroy this surface until the parent has
+ // finished using it.
if (!surface_id_.is_null())
surface_factory_->Destroy(surface_id_);
surface_id_ = id_allocator_->GenerateId();
surface_factory_->Create(surface_id_, frame_size);
client_->GetLayer()->SetShowSurface(surface_id_, frame_size_in_dip);
current_surface_size_ = frame_size;
+ modified_layers = true;
}
scoped_ptr<cc::CompositorFrame> compositor_frame =
make_scoped_ptr(new cc::CompositorFrame());
@@ -388,18 +393,23 @@ void DelegatedFrameHost::SwapDelegatedFrame(
} else {
frame_provider_->SetFrameData(frame_data.Pass());
}
+ modified_layers = true;
}
}
released_front_lock_ = NULL;
current_frame_size_in_dip_ = frame_size_in_dip;
CheckResizeLock();
- client_->SchedulePaintInRect(damage_rect_in_dip);
+ if (modified_layers) {
+ // TODO(jbauman): Need to always tell the window observer about the
+ // damage.
+ client_->SchedulePaintInRect(damage_rect_in_dip);
+ }
pending_delegated_ack_count_++;
ui::Compositor* compositor = client_->GetCompositor();
- if (!compositor) {
+ if (!compositor || !modified_layers) {
SendDelegatedFrameAck(output_surface_id);
} else {
std::vector<ui::LatencyInfo>::const_iterator it;

Powered by Google App Engine
This is Rietveld 408576698