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

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

Issue 1348833003: Fix NTP thumbnail generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit. Created 5 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
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | content/browser/renderer_host/render_widget_host_view_mac.mm » ('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 0fb665771107286d2e7998bd7ea91318b81ba0e5..8f362de8572e5cdd534aa4b8e947df9c4760abd4 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -376,7 +376,7 @@ void DelegatedFrameHost::SwapDelegatedFrame(
}
last_output_surface_id_ = output_surface_id;
}
- bool immediate_ack = !compositor_;
+ bool skip_frame_size_mismatch = false;
pending_delegated_ack_count_++;
if (frame_size.IsEmpty()) {
@@ -418,10 +418,10 @@ void DelegatedFrameHost::SwapDelegatedFrame(
gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP();
if (desired_size != frame_size_in_dip && !desired_size.IsEmpty())
- immediate_ack = true;
+ skip_frame_size_mismatch = true;
cc::SurfaceFactory::DrawCallback ack_callback;
- if (compositor_ && !immediate_ack) {
+ if (compositor_ && !skip_frame_size_mismatch) {
ack_callback = base::Bind(&DelegatedFrameHost::SurfaceDrawn,
AsWeakPtr(), output_surface_id);
}
@@ -457,7 +457,9 @@ void DelegatedFrameHost::SwapDelegatedFrame(
client_->DelegatedFrameHostGetLayer()->OnDelegatedFrameDamage(
damage_rect_in_dip);
- if (immediate_ack) {
+ // Note that |compositor_| may be reset by SetShowSurface or
+ // SetShowDelegatedContent above.
+ if (!compositor_ || skip_frame_size_mismatch) {
SendDelegatedFrameAck(output_surface_id);
} else if (!use_surfaces_) {
std::vector<ui::LatencyInfo>::const_iterator it;
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698