| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 scoped_refptr<cc::SurfaceLayer> surface_layer = | 198 scoped_refptr<cc::SurfaceLayer> surface_layer = |
| 199 cc::SurfaceLayer::Create(satisfy_callback, require_callback); | 199 cc::SurfaceLayer::Create(satisfy_callback, require_callback); |
| 200 // TODO(oshima): This is a stopgap fix so that the compositor does not | 200 // TODO(oshima): This is a stopgap fix so that the compositor does not |
| 201 // scaledown the content when 2x frame data is added to 1x parent frame data. | 201 // scaledown the content when 2x frame data is added to 1x parent frame data. |
| 202 // Fix this in cc/. | 202 // Fix this in cc/. |
| 203 if (IsUseZoomForDSFEnabled()) | 203 if (IsUseZoomForDSFEnabled()) |
| 204 scale_factor = 1.0f; | 204 scale_factor = 1.0f; |
| 205 | 205 |
| 206 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size); | 206 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size); |
| 207 surface_layer->SetMasksToBounds(true); | 207 surface_layer->SetMasksToBounds(true); |
| 208 blink::WebLayer* layer = new cc_blink::WebLayerImpl(surface_layer); | 208 cc_blink::WebLayerImpl* layer = new cc_blink::WebLayerImpl(surface_layer); |
| 209 // TODO(lfg): Investigate if it's possible to propagate the information about |
| 210 // the child surface's opacity. https://crbug.com/629851. |
| 211 layer->setOpaque(false); |
| 212 layer->SetContentsOpaqueIsFixed(true); |
| 209 UpdateWebLayer(layer); | 213 UpdateWebLayer(layer); |
| 210 | 214 |
| 211 UpdateVisibility(true); | 215 UpdateVisibility(true); |
| 212 | 216 |
| 213 // The RWHV creates a destruction dependency on the surface that needs to be | 217 // The RWHV creates a destruction dependency on the surface that needs to be |
| 214 // satisfied. Note: render_frame_proxy_ is null in the case our client is a | 218 // satisfied. Note: render_frame_proxy_ is null in the case our client is a |
| 215 // BrowserPlugin; in this case the BrowserPlugin sends its own SatisfySequence | 219 // BrowserPlugin; in this case the BrowserPlugin sends its own SatisfySequence |
| 216 // message. | 220 // message. |
| 217 if (render_frame_proxy_) { | 221 if (render_frame_proxy_) { |
| 218 render_frame_proxy_->Send( | 222 render_frame_proxy_->Send( |
| 219 new FrameHostMsg_SatisfySequence(host_routing_id_, sequence)); | 223 new FrameHostMsg_SatisfySequence(host_routing_id_, sequence)); |
| 220 } else if (browser_plugin_.get()) { | 224 } else if (browser_plugin_.get()) { |
| 221 browser_plugin_->SendSatisfySequence(sequence); | 225 browser_plugin_->SendSatisfySequence(sequence); |
| 222 } | 226 } |
| 223 | 227 |
| 224 CheckSizeAndAdjustLayerProperties( | 228 CheckSizeAndAdjustLayerProperties( |
| 225 frame_size, scale_factor, | 229 frame_size, scale_factor, |
| 226 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); | 230 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); |
| 227 } | 231 } |
| 228 | 232 |
| 229 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { | 233 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { |
| 230 if (web_layer_) | 234 if (web_layer_) |
| 231 web_layer_->setDrawsContent(visible); | 235 web_layer_->setDrawsContent(visible); |
| 232 } | 236 } |
| 233 | 237 |
| 234 } // namespace content | 238 } // namespace content |
| OLD | NEW |