Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: content/renderer/child_frame_compositing_helper.cc

Issue 2514033002: Introducing SurfaceReferenceFactory (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "cc/layers/solid_color_layer.h" 11 #include "cc/layers/solid_color_layer.h"
12 #include "cc/layers/surface_layer.h" 12 #include "cc/layers/surface_layer.h"
13 #include "cc/output/context_provider.h" 13 #include "cc/output/context_provider.h"
14 #include "cc/output/copy_output_request.h" 14 #include "cc/output/copy_output_request.h"
15 #include "cc/output/copy_output_result.h" 15 #include "cc/output/copy_output_result.h"
16 #include "cc/resources/single_release_callback.h" 16 #include "cc/resources/single_release_callback.h"
17 #include "cc/surfaces/surface_info.h"
17 #include "content/child/thread_safe_sender.h" 18 #include "content/child/thread_safe_sender.h"
18 #include "content/common/browser_plugin/browser_plugin_messages.h" 19 #include "content/common/browser_plugin/browser_plugin_messages.h"
19 #include "content/common/content_switches_internal.h" 20 #include "content/common/content_switches_internal.h"
20 #include "content/common/frame_messages.h" 21 #include "content/common/frame_messages.h"
21 #include "content/common/gpu/client/context_provider_command_buffer.h" 22 #include "content/common/gpu/client/context_provider_command_buffer.h"
22 #include "content/public/common/content_client.h" 23 #include "content/public/common/content_client.h"
23 #include "content/public/renderer/content_renderer_client.h" 24 #include "content/public/renderer/content_renderer_client.h"
24 #include "content/renderer/browser_plugin/browser_plugin.h" 25 #include "content/renderer/browser_plugin/browser_plugin.h"
25 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 26 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
26 #include "content/renderer/render_frame_impl.h" 27 #include "content/renderer/render_frame_impl.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 sender, host_routing_id_, 199 sender, host_routing_id_,
199 browser_plugin_->browser_plugin_instance_id()); 200 browser_plugin_->browser_plugin_instance_id());
200 scoped_refptr<cc::SurfaceLayer> surface_layer = 201 scoped_refptr<cc::SurfaceLayer> surface_layer =
201 cc::SurfaceLayer::Create(satisfy_callback, require_callback); 202 cc::SurfaceLayer::Create(satisfy_callback, require_callback);
202 // TODO(oshima): This is a stopgap fix so that the compositor does not 203 // TODO(oshima): This is a stopgap fix so that the compositor does not
203 // scaledown the content when 2x frame data is added to 1x parent frame data. 204 // scaledown the content when 2x frame data is added to 1x parent frame data.
204 // Fix this in cc/. 205 // Fix this in cc/.
205 if (IsUseZoomForDSFEnabled()) 206 if (IsUseZoomForDSFEnabled())
206 scale_factor = 1.0f; 207 scale_factor = 1.0f;
207 208
208 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size); 209 surface_layer->SetSurfaceInfo(
210 cc::SurfaceInfo(surface_id, scale_factor, frame_size));
209 surface_layer->SetMasksToBounds(true); 211 surface_layer->SetMasksToBounds(true);
210 std::unique_ptr<cc_blink::WebLayerImpl> layer( 212 std::unique_ptr<cc_blink::WebLayerImpl> layer(
211 new cc_blink::WebLayerImpl(surface_layer)); 213 new cc_blink::WebLayerImpl(surface_layer));
212 // TODO(lfg): Investigate if it's possible to propagate the information about 214 // TODO(lfg): Investigate if it's possible to propagate the information about
213 // the child surface's opacity. https://crbug.com/629851. 215 // the child surface's opacity. https://crbug.com/629851.
214 layer->setOpaque(false); 216 layer->setOpaque(false);
215 layer->SetContentsOpaqueIsFixed(true); 217 layer->SetContentsOpaqueIsFixed(true);
216 UpdateWebLayer(std::move(layer)); 218 UpdateWebLayer(std::move(layer));
217 219
218 UpdateVisibility(true); 220 UpdateVisibility(true);
(...skipping 13 matching lines...) Expand all
232 frame_size, scale_factor, 234 frame_size, scale_factor,
233 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); 235 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer());
234 } 236 }
235 237
236 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { 238 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) {
237 if (web_layer_) 239 if (web_layer_)
238 web_layer_->setDrawsContent(visible); 240 web_layer_->setDrawsContent(visible);
239 } 241 }
240 242
241 } // namespace content 243 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698