| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser_plugin/browser_plugin_compositing_helper.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_compositing_helper.h" |
| 6 | 6 |
| 7 #include "cc/layers/delegated_renderer_layer.h" | 7 #include "cc/layers/delegated_renderer_layer.h" |
| 8 #include "cc/layers/solid_color_layer.h" | 8 #include "cc/layers/solid_color_layer.h" |
| 9 #include "cc/layers/texture_layer.h" | 9 #include "cc/layers/texture_layer.h" |
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 last_host_id_ = gpu_host_id; | 206 last_host_id_ = gpu_host_id; |
| 207 | 207 |
| 208 ack_pending_ = true; | 208 ack_pending_ = true; |
| 209 // Browser plugin getting destroyed, do a fast ACK. | 209 // Browser plugin getting destroyed, do a fast ACK. |
| 210 if (!background_layer_) { | 210 if (!background_layer_) { |
| 211 MailboxReleased(mailbox_name, gpu_route_id, gpu_host_id, 0); | 211 MailboxReleased(mailbox_name, gpu_route_id, gpu_host_id, 0); |
| 212 return; | 212 return; |
| 213 } | 213 } |
| 214 | 214 |
| 215 if (!texture_layer_) { | 215 if (!texture_layer_) { |
| 216 texture_layer_ = cc::TextureLayer::CreateForMailbox(); | 216 texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); |
| 217 texture_layer_->SetIsDrawable(true); | 217 texture_layer_->SetIsDrawable(true); |
| 218 texture_layer_->SetContentsOpaque(true); | 218 texture_layer_->SetContentsOpaque(true); |
| 219 | 219 |
| 220 background_layer_->AddChild(texture_layer_); | 220 background_layer_->AddChild(texture_layer_); |
| 221 } | 221 } |
| 222 | 222 |
| 223 // The size of browser plugin container is not always equal to the size | 223 // The size of browser plugin container is not always equal to the size |
| 224 // of the buffer that arrives here. This could be for a number of reasons, | 224 // of the buffer that arrives here. This could be for a number of reasons, |
| 225 // including autosize and a resize in progress. | 225 // including autosize and a resize in progress. |
| 226 // During resize, the container size changes first and then some time | 226 // During resize, the container size changes first and then some time |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 284 } |
| 285 | 285 |
| 286 void BrowserPluginCompositingHelper::UpdateVisibility(bool visible) { | 286 void BrowserPluginCompositingHelper::UpdateVisibility(bool visible) { |
| 287 if (texture_layer_) | 287 if (texture_layer_) |
| 288 texture_layer_->SetIsDrawable(visible); | 288 texture_layer_->SetIsDrawable(visible); |
| 289 if (delegated_layer_) | 289 if (delegated_layer_) |
| 290 delegated_layer_->SetIsDrawable(visible); | 290 delegated_layer_->SetIsDrawable(visible); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace content | 293 } // namespace content |
| OLD | NEW |