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

Unified Diff: content/browser/frame_host/render_widget_host_view_child_frame.cc

Issue 1199963011: Force new surface on BrowserPluginGuest reattach. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test, and add check for null surface id in test. Created 5 years, 6 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/frame_host/render_widget_host_view_child_frame.cc
diff --git a/content/browser/frame_host/render_widget_host_view_child_frame.cc b/content/browser/frame_host/render_widget_host_view_child_frame.cc
index 8be87ea534e50001aea2e9176ce6b34c0ebfb4a5..03a2a800aadc3624debcfe64ef4b6df9dda51ee9 100644
--- a/content/browser/frame_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/frame_host/render_widget_host_view_child_frame.cc
@@ -250,9 +250,7 @@ void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame(
if (output_surface_id != last_output_surface_id_ ||
frame_size != current_surface_size_ ||
scale_factor != current_surface_scale_factor_) {
- if (surface_factory_ && !surface_id_.is_null())
- surface_factory_->Destroy(surface_id_);
- surface_id_ = cc::SurfaceId();
+ ClearCompositorSurfaceIfNecessary();
last_output_surface_id_ = output_surface_id;
current_surface_size_ = frame_size;
current_surface_scale_factor_ = scale_factor;
@@ -418,4 +416,10 @@ RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager(
BrowserAccessibilityManager::GetEmptyDocument(), delegate);
}
+void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() {
+ if (surface_factory_ && !surface_id_.is_null())
+ surface_factory_->Destroy(surface_id_);
+ surface_id_ = cc::SurfaceId();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698