| 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/renderer/child_frame_compositing_helper.h" | 5 #include "content/renderer/child_frame_compositing_helper.h" |
| 6 | 6 |
| 7 #include "cc/blink/web_layer_impl.h" | 7 #include "cc/blink/web_layer_impl.h" |
| 8 #include "cc/layers/delegated_frame_provider.h" | 8 #include "cc/layers/delegated_frame_provider.h" |
| 9 #include "cc/layers/delegated_frame_resource_collection.h" | 9 #include "cc/layers/delegated_frame_resource_collection.h" |
| 10 #include "cc/layers/delegated_renderer_layer.h" | 10 #include "cc/layers/delegated_renderer_layer.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 208 |
| 209 // Surface IDs and compositor frames should never be received | 209 // Surface IDs and compositor frames should never be received |
| 210 // interchangeably. | 210 // interchangeably. |
| 211 DCHECK(!surface_layer_.get()); | 211 DCHECK(!surface_layer_.get()); |
| 212 | 212 |
| 213 // Do nothing if we are getting destroyed or have no frame data. | 213 // Do nothing if we are getting destroyed or have no frame data. |
| 214 if (!frame_data || !background_layer_.get()) | 214 if (!frame_data || !background_layer_.get()) |
| 215 return; | 215 return; |
| 216 | 216 |
| 217 DCHECK(!frame_data->render_pass_list.empty()); | 217 DCHECK(!frame_data->render_pass_list.empty()); |
| 218 cc::RenderPass* root_pass = frame_data->render_pass_list.back(); | 218 cc::RenderPass* root_pass = frame_data->render_pass_list.back().get(); |
| 219 gfx::Size frame_size = root_pass->output_rect.size(); | 219 gfx::Size frame_size = root_pass->output_rect.size(); |
| 220 | 220 |
| 221 if (last_route_id_ != route_id || | 221 if (last_route_id_ != route_id || |
| 222 last_output_surface_id_ != output_surface_id || | 222 last_output_surface_id_ != output_surface_id || |
| 223 last_host_id_ != host_id) { | 223 last_host_id_ != host_id) { |
| 224 // Resource ids are scoped by the output surface. | 224 // Resource ids are scoped by the output surface. |
| 225 // If the originating output surface doesn't match the last one, it | 225 // If the originating output surface doesn't match the last one, it |
| 226 // indicates the guest's output surface may have been recreated, in which | 226 // indicates the guest's output surface may have been recreated, in which |
| 227 // case we should recreate the DelegatedRendererLayer, to avoid matching | 227 // case we should recreate the DelegatedRendererLayer, to avoid matching |
| 228 // resources from the old one with resources from the new one which would | 228 // resources from the old one with resources from the new one which would |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) { | 395 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) { |
| 396 opaque_ = opaque; | 396 opaque_ = opaque; |
| 397 if (delegated_layer_.get()) | 397 if (delegated_layer_.get()) |
| 398 delegated_layer_->SetContentsOpaque(opaque_); | 398 delegated_layer_->SetContentsOpaque(opaque_); |
| 399 if (surface_layer_.get()) | 399 if (surface_layer_.get()) |
| 400 surface_layer_->SetContentsOpaque(opaque_); | 400 surface_layer_->SetContentsOpaque(opaque_); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace content | 403 } // namespace content |
| OLD | NEW |