| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "cc/blink/web_layer_impl.h" | 9 #include "cc/blink/web_layer_impl.h" |
| 10 #include "cc/layers/picture_image_layer.h" | 10 #include "cc/layers/picture_image_layer.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 blink::WebLayer* layer = new cc_blink::WebLayerImpl(crashed_layer); | 144 blink::WebLayer* layer = new cc_blink::WebLayerImpl(crashed_layer); |
| 145 UpdateWebLayer(layer); | 145 UpdateWebLayer(layer); |
| 146 } | 146 } |
| 147 | 147 |
| 148 // static | 148 // static |
| 149 void ChildFrameCompositingHelper::SatisfyCallback( | 149 void ChildFrameCompositingHelper::SatisfyCallback( |
| 150 scoped_refptr<ThreadSafeSender> sender, | 150 scoped_refptr<ThreadSafeSender> sender, |
| 151 int host_routing_id, | 151 int host_routing_id, |
| 152 cc::SurfaceSequence sequence) { | 152 const cc::SurfaceSequence& sequence) { |
| 153 // This may be called on either the main or impl thread. | 153 // This may be called on either the main or impl thread. |
| 154 sender->Send(new FrameHostMsg_SatisfySequence(host_routing_id, sequence)); | 154 sender->Send(new FrameHostMsg_SatisfySequence(host_routing_id, sequence)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 // static | 157 // static |
| 158 void ChildFrameCompositingHelper::SatisfyCallbackBrowserPlugin( | 158 void ChildFrameCompositingHelper::SatisfyCallbackBrowserPlugin( |
| 159 scoped_refptr<ThreadSafeSender> sender, | 159 scoped_refptr<ThreadSafeSender> sender, |
| 160 int host_routing_id, | 160 int host_routing_id, |
| 161 int browser_plugin_instance_id, | 161 int browser_plugin_instance_id, |
| 162 cc::SurfaceSequence sequence) { | 162 const cc::SurfaceSequence& sequence) { |
| 163 sender->Send(new BrowserPluginHostMsg_SatisfySequence( | 163 sender->Send(new BrowserPluginHostMsg_SatisfySequence( |
| 164 host_routing_id, browser_plugin_instance_id, sequence)); | 164 host_routing_id, browser_plugin_instance_id, sequence)); |
| 165 } | 165 } |
| 166 | 166 |
| 167 // static | 167 // static |
| 168 void ChildFrameCompositingHelper::RequireCallback( | 168 void ChildFrameCompositingHelper::RequireCallback( |
| 169 scoped_refptr<ThreadSafeSender> sender, | 169 scoped_refptr<ThreadSafeSender> sender, |
| 170 int host_routing_id, | 170 int host_routing_id, |
| 171 cc::SurfaceId id, | 171 const cc::SurfaceId& id, |
| 172 cc::SurfaceSequence sequence) { | 172 const cc::SurfaceSequence& sequence) { |
| 173 // This may be called on either the main or impl thread. | 173 // This may be called on either the main or impl thread. |
| 174 sender->Send(new FrameHostMsg_RequireSequence(host_routing_id, id, sequence)); | 174 sender->Send(new FrameHostMsg_RequireSequence(host_routing_id, id, sequence)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void ChildFrameCompositingHelper::RequireCallbackBrowserPlugin( | 177 void ChildFrameCompositingHelper::RequireCallbackBrowserPlugin( |
| 178 scoped_refptr<ThreadSafeSender> sender, | 178 scoped_refptr<ThreadSafeSender> sender, |
| 179 int host_routing_id, | 179 int host_routing_id, |
| 180 int browser_plugin_instance_id, | 180 int browser_plugin_instance_id, |
| 181 cc::SurfaceId id, | 181 const cc::SurfaceId& id, |
| 182 cc::SurfaceSequence sequence) { | 182 const cc::SurfaceSequence& sequence) { |
| 183 // This may be called on either the main or impl thread. | 183 // This may be called on either the main or impl thread. |
| 184 sender->Send(new BrowserPluginHostMsg_RequireSequence( | 184 sender->Send(new BrowserPluginHostMsg_RequireSequence( |
| 185 host_routing_id, browser_plugin_instance_id, id, sequence)); | 185 host_routing_id, browser_plugin_instance_id, id, sequence)); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void ChildFrameCompositingHelper::OnSetSurface( | 188 void ChildFrameCompositingHelper::OnSetSurface( |
| 189 const cc::SurfaceId& surface_id, | 189 const cc::SurfaceId& surface_id, |
| 190 const gfx::Size& frame_size, | 190 const gfx::Size& frame_size, |
| 191 float scale_factor, | 191 float scale_factor, |
| 192 const cc::SurfaceSequence& sequence) { | 192 const cc::SurfaceSequence& sequence) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 frame_size, scale_factor, | 239 frame_size, scale_factor, |
| 240 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); | 240 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { | 243 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { |
| 244 if (web_layer_) | 244 if (web_layer_) |
| 245 web_layer_->setDrawsContent(visible); | 245 web_layer_->setDrawsContent(visible); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace content | 248 } // namespace content |
| OLD | NEW |