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

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
« no previous file with comments | « cc/surfaces/surfaces_pixeltest.cc ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('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 4f1d43a39699ea637a7009c450a6d30a69e2dd95..7a56f02e20ee6f6558dfe340f566d5b650fdffe8 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -350,9 +350,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_) {
@@ -364,12 +366,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());
@@ -395,18 +400,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;
« no previous file with comments | « cc/surfaces/surfaces_pixeltest.cc ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698