| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 surface_id_ = surface_info.id(); | 215 surface_id_ = surface_info.id(); |
| 216 scoped_refptr<cc::SurfaceLayer> surface_layer = | 216 scoped_refptr<cc::SurfaceLayer> surface_layer = |
| 217 cc::SurfaceLayer::Create(surface_reference_factory_); | 217 cc::SurfaceLayer::Create(surface_reference_factory_); |
| 218 // TODO(oshima): This is a stopgap fix so that the compositor does not | 218 // TODO(oshima): This is a stopgap fix so that the compositor does not |
| 219 // scaledown the content when 2x frame data is added to 1x parent frame data. | 219 // scaledown the content when 2x frame data is added to 1x parent frame data. |
| 220 // Fix this in cc/. | 220 // Fix this in cc/. |
| 221 if (IsUseZoomForDSFEnabled()) | 221 if (IsUseZoomForDSFEnabled()) |
| 222 scale_factor = 1.0f; | 222 scale_factor = 1.0f; |
| 223 | 223 |
| 224 surface_layer->SetSurfaceInfo(cc::SurfaceInfo(surface_info.id(), scale_factor, | 224 surface_layer->SetSurfaceInfo(cc::SurfaceInfo(surface_info.id(), scale_factor, |
| 225 surface_info.size_in_pixels()), | 225 surface_info.size_in_pixels())); |
| 226 false /* stretch_content_to_fill_bounds */); | |
| 227 surface_layer->SetMasksToBounds(true); | 226 surface_layer->SetMasksToBounds(true); |
| 228 std::unique_ptr<cc_blink::WebLayerImpl> layer( | 227 std::unique_ptr<cc_blink::WebLayerImpl> layer( |
| 229 new cc_blink::WebLayerImpl(surface_layer)); | 228 new cc_blink::WebLayerImpl(surface_layer)); |
| 230 // TODO(lfg): Investigate if it's possible to propagate the information about | 229 // TODO(lfg): Investigate if it's possible to propagate the information about |
| 231 // the child surface's opacity. https://crbug.com/629851. | 230 // the child surface's opacity. https://crbug.com/629851. |
| 232 layer->setOpaque(false); | 231 layer->setOpaque(false); |
| 233 layer->SetContentsOpaqueIsFixed(true); | 232 layer->SetContentsOpaqueIsFixed(true); |
| 234 UpdateWebLayer(std::move(layer)); | 233 UpdateWebLayer(std::move(layer)); |
| 235 | 234 |
| 236 UpdateVisibility(true); | 235 UpdateVisibility(true); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 250 surface_info.size_in_pixels(), surface_info.device_scale_factor(), | 249 surface_info.size_in_pixels(), surface_info.device_scale_factor(), |
| 251 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); | 250 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); |
| 252 } | 251 } |
| 253 | 252 |
| 254 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { | 253 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { |
| 255 if (web_layer_) | 254 if (web_layer_) |
| 256 web_layer_->setDrawsContent(visible); | 255 web_layer_->setDrawsContent(visible); |
| 257 } | 256 } |
| 258 | 257 |
| 259 } // namespace content | 258 } // namespace content |
| OLD | NEW |