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/delegated_frame_provider.h" | 10 #include "cc/layers/delegated_frame_provider.h" |
11 #include "cc/layers/delegated_frame_resource_collection.h" | 11 #include "cc/layers/delegated_frame_resource_collection.h" |
12 #include "cc/layers/delegated_renderer_layer.h" | 12 #include "cc/layers/delegated_renderer_layer.h" |
13 #include "cc/layers/solid_color_layer.h" | 13 #include "cc/layers/solid_color_layer.h" |
14 #include "cc/layers/surface_layer.h" | 14 #include "cc/layers/surface_layer.h" |
15 #include "cc/output/context_provider.h" | 15 #include "cc/output/context_provider.h" |
16 #include "cc/output/copy_output_request.h" | 16 #include "cc/output/copy_output_request.h" |
17 #include "cc/output/copy_output_result.h" | 17 #include "cc/output/copy_output_result.h" |
18 #include "cc/resources/single_release_callback.h" | 18 #include "cc/resources/single_release_callback.h" |
19 #include "content/child/thread_safe_sender.h" | 19 #include "content/child/thread_safe_sender.h" |
20 #include "content/common/browser_plugin/browser_plugin_messages.h" | 20 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| 21 #include "content/common/content_switches_internal.h" |
21 #include "content/common/frame_messages.h" | 22 #include "content/common/frame_messages.h" |
22 #include "content/common/gpu/client/context_provider_command_buffer.h" | 23 #include "content/common/gpu/client/context_provider_command_buffer.h" |
23 #include "content/renderer/browser_plugin/browser_plugin.h" | 24 #include "content/renderer/browser_plugin/browser_plugin.h" |
24 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 25 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
25 #include "content/renderer/render_frame_impl.h" | 26 #include "content/renderer/render_frame_impl.h" |
26 #include "content/renderer/render_frame_proxy.h" | 27 #include "content/renderer/render_frame_proxy.h" |
27 #include "content/renderer/render_thread_impl.h" | 28 #include "content/renderer/render_thread_impl.h" |
28 #include "skia/ext/image_operations.h" | 29 #include "skia/ext/image_operations.h" |
29 #include "third_party/WebKit/public/web/WebFrame.h" | 30 #include "third_party/WebKit/public/web/WebFrame.h" |
30 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 31 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 render_frame_proxy_ | 308 render_frame_proxy_ |
308 ? base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender, | 309 ? base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender, |
309 host_routing_id_) | 310 host_routing_id_) |
310 : base::Bind( | 311 : base::Bind( |
311 &ChildFrameCompositingHelper::RequireCallbackBrowserPlugin, | 312 &ChildFrameCompositingHelper::RequireCallbackBrowserPlugin, |
312 sender, host_routing_id_, | 313 sender, host_routing_id_, |
313 browser_plugin_->browser_plugin_instance_id()); | 314 browser_plugin_->browser_plugin_instance_id()); |
314 scoped_refptr<cc::SurfaceLayer> surface_layer = | 315 scoped_refptr<cc::SurfaceLayer> surface_layer = |
315 cc::SurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), | 316 cc::SurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), |
316 satisfy_callback, require_callback); | 317 satisfy_callback, require_callback); |
| 318 // TODO(oshima): This is a stopgap fix so that the compositor does not |
| 319 // scaledown the content when 2x frame data is added to 1x parent frame data. |
| 320 // Fix this in cc/. |
| 321 if (IsUseZoomForDSFEnabled()) |
| 322 scale_factor = 1.0f; |
| 323 |
317 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size); | 324 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size); |
318 blink::WebLayer* layer = new cc_blink::WebLayerImpl(surface_layer); | 325 blink::WebLayer* layer = new cc_blink::WebLayerImpl(surface_layer); |
319 UpdateWebLayer(layer); | 326 UpdateWebLayer(layer); |
320 | 327 |
321 UpdateVisibility(true); | 328 UpdateVisibility(true); |
322 | 329 |
323 // The RWHV creates a destruction dependency on the surface that needs to be | 330 // The RWHV creates a destruction dependency on the surface that needs to be |
324 // satisfied. Note: render_frame_proxy_ is null in the case our client is a | 331 // satisfied. Note: render_frame_proxy_ is null in the case our client is a |
325 // BrowserPlugin; in this case the BrowserPlugin sends its own SatisfySequence | 332 // BrowserPlugin; in this case the BrowserPlugin sends its own SatisfySequence |
326 // message. | 333 // message. |
(...skipping 28 matching lines...) Expand all Loading... |
355 ¶ms.ack.resources); | 362 ¶ms.ack.resources); |
356 DCHECK(!params.ack.resources.empty()); | 363 DCHECK(!params.ack.resources.empty()); |
357 | 364 |
358 params.route_id = last_route_id_; | 365 params.route_id = last_route_id_; |
359 params.output_surface_id = last_output_surface_id_; | 366 params.output_surface_id = last_output_surface_id_; |
360 params.renderer_host_id = last_host_id_; | 367 params.renderer_host_id = last_host_id_; |
361 SendReclaimCompositorResourcesToBrowser(params); | 368 SendReclaimCompositorResourcesToBrowser(params); |
362 } | 369 } |
363 | 370 |
364 } // namespace content | 371 } // namespace content |
OLD | NEW |