| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "cc/surfaces/surface.h" | 10 #include "cc/surfaces/surface.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 if (!frame->delegated_frame_data || !use_surfaces_) { | 264 if (!frame->delegated_frame_data || !use_surfaces_) { |
| 265 frame_connector_->ChildFrameCompositorFrameSwapped( | 265 frame_connector_->ChildFrameCompositorFrameSwapped( |
| 266 output_surface_id, | 266 output_surface_id, |
| 267 host_->GetProcess()->GetID(), | 267 host_->GetProcess()->GetID(), |
| 268 host_->GetRoutingID(), | 268 host_->GetRoutingID(), |
| 269 frame.Pass()); | 269 frame.Pass()); |
| 270 return; | 270 return; |
| 271 } | 271 } |
| 272 | 272 |
| 273 cc::RenderPass* root_pass = | 273 cc::RenderPass* root_pass = |
| 274 frame->delegated_frame_data->render_pass_list.back(); | 274 frame->delegated_frame_data->render_pass_list.back().get(); |
| 275 | 275 |
| 276 gfx::Size frame_size = root_pass->output_rect.size(); | 276 gfx::Size frame_size = root_pass->output_rect.size(); |
| 277 float scale_factor = frame->metadata.device_scale_factor; | 277 float scale_factor = frame->metadata.device_scale_factor; |
| 278 | 278 |
| 279 // Check whether we need to recreate the cc::Surface, which means the child | 279 // Check whether we need to recreate the cc::Surface, which means the child |
| 280 // frame renderer has changed its output surface, or size, or scale factor. | 280 // frame renderer has changed its output surface, or size, or scale factor. |
| 281 if (output_surface_id != last_output_surface_id_ && surface_factory_) { | 281 if (output_surface_id != last_output_surface_id_ && surface_factory_) { |
| 282 surface_factory_->Destroy(surface_id_); | 282 surface_factory_->Destroy(surface_id_); |
| 283 surface_factory_.reset(); | 283 surface_factory_.reset(); |
| 284 } | 284 } |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 #endif | 484 #endif |
| 485 } | 485 } |
| 486 | 486 |
| 487 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { | 487 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { |
| 488 if (surface_factory_ && !surface_id_.is_null()) | 488 if (surface_factory_ && !surface_id_.is_null()) |
| 489 surface_factory_->Destroy(surface_id_); | 489 surface_factory_->Destroy(surface_id_); |
| 490 surface_id_ = cc::SurfaceId(); | 490 surface_id_ = cc::SurfaceId(); |
| 491 } | 491 } |
| 492 | 492 |
| 493 } // namespace content | 493 } // namespace content |
| OLD | NEW |