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..ae915a92815473b5435ea2640f3b5b7c4c784c13 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_); |
lazyboy
2015/06/26 18:03:21
nit: indent
wjmaclean
2015/06/27 16:30:58
Done.
|
+ surface_id_ = cc::SurfaceId(); |
+} |
+ |
} // namespace content |