| 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/layers/delegated_frame_provider.h" | 7 #include "cc/layers/delegated_frame_provider.h" | 
| 8 #include "cc/layers/delegated_frame_resource_collection.h" | 8 #include "cc/layers/delegated_frame_resource_collection.h" | 
| 9 #include "cc/layers/delegated_renderer_layer.h" | 9 #include "cc/layers/delegated_renderer_layer.h" | 
| 10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" | 
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 272   ack_pending_ = false; | 272   ack_pending_ = false; | 
| 273   software_ack_pending_ = false; | 273   software_ack_pending_ = false; | 
| 274   resource_collection_ = NULL; | 274   resource_collection_ = NULL; | 
| 275   frame_provider_ = NULL; | 275   frame_provider_ = NULL; | 
| 276   texture_layer_ = NULL; | 276   texture_layer_ = NULL; | 
| 277   delegated_layer_ = NULL; | 277   delegated_layer_ = NULL; | 
| 278   background_layer_ = NULL; | 278   background_layer_ = NULL; | 
| 279   web_layer_.reset(); | 279   web_layer_.reset(); | 
| 280 } | 280 } | 
| 281 | 281 | 
|  | 282 void ChildFrameCompositingHelper::ChildFrameGone() { | 
|  | 283   background_layer_->SetBackgroundColor(SkColorSetARGBInline(255, 0, 128, 0)); | 
|  | 284   background_layer_->RemoveAllChildren(); | 
|  | 285   background_layer_->SetIsDrawable(true); | 
|  | 286   background_layer_->SetContentsOpaque(true); | 
|  | 287 } | 
|  | 288 | 
| 282 void ChildFrameCompositingHelper::OnBuffersSwappedPrivate( | 289 void ChildFrameCompositingHelper::OnBuffersSwappedPrivate( | 
| 283     const SwapBuffersInfo& mailbox, | 290     const SwapBuffersInfo& mailbox, | 
| 284     unsigned sync_point, | 291     unsigned sync_point, | 
| 285     float device_scale_factor) { | 292     float device_scale_factor) { | 
| 286   DCHECK(!delegated_layer_.get()); | 293   DCHECK(!delegated_layer_.get()); | 
| 287   // If these mismatch, we are either just starting up, GPU process crashed or | 294   // If these mismatch, we are either just starting up, GPU process crashed or | 
| 288   // guest renderer crashed. | 295   // guest renderer crashed. | 
| 289   // In this case, we are communicating with a new image transport | 296   // In this case, we are communicating with a new image transport | 
| 290   // surface and must ACK with the new ID's and an empty mailbox. | 297   // surface and must ACK with the new ID's and an empty mailbox. | 
| 291   if (last_route_id_ != mailbox.route_id || | 298   if (last_route_id_ != mailbox.route_id || | 
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 536                                       skia::ImageOperations::RESIZE_BEST, | 543                                       skia::ImageOperations::RESIZE_BEST, | 
| 537                                       dest_size.width(), | 544                                       dest_size.width(), | 
| 538                                       dest_size.height()); | 545                                       dest_size.height()); | 
| 539   } | 546   } | 
| 540   browser_plugin_manager_->Send( | 547   browser_plugin_manager_->Send( | 
| 541       new BrowserPluginHostMsg_CopyFromCompositingSurfaceAck( | 548       new BrowserPluginHostMsg_CopyFromCompositingSurfaceAck( | 
| 542           host_routing_id_, instance_id_, request_id, resized_bitmap)); | 549           host_routing_id_, instance_id_, request_id, resized_bitmap)); | 
| 543 } | 550 } | 
| 544 | 551 | 
| 545 }  // namespace content | 552 }  // namespace content | 
| OLD | NEW | 
|---|