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

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

Issue 2495373003: Match html canvas which is transferred to OffscreenCanvas to CSS style (Closed)
Patch Set: fix compilation error Created 4 years 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"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 sender, host_routing_id_, 198 sender, host_routing_id_,
199 browser_plugin_->browser_plugin_instance_id()); 199 browser_plugin_->browser_plugin_instance_id());
200 scoped_refptr<cc::SurfaceLayer> surface_layer = 200 scoped_refptr<cc::SurfaceLayer> surface_layer =
201 cc::SurfaceLayer::Create(satisfy_callback, require_callback); 201 cc::SurfaceLayer::Create(satisfy_callback, require_callback);
202 // TODO(oshima): This is a stopgap fix so that the compositor does not 202 // 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. 203 // scaledown the content when 2x frame data is added to 1x parent frame data.
204 // Fix this in cc/. 204 // Fix this in cc/.
205 if (IsUseZoomForDSFEnabled()) 205 if (IsUseZoomForDSFEnabled())
206 scale_factor = 1.0f; 206 scale_factor = 1.0f;
207 207
208 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size); 208 surface_layer->SetSurfaceId(surface_id, scale_factor, frame_size,
209 false /* stretch_content_to_fill_bounds */);
209 surface_layer->SetMasksToBounds(true); 210 surface_layer->SetMasksToBounds(true);
210 std::unique_ptr<cc_blink::WebLayerImpl> layer( 211 std::unique_ptr<cc_blink::WebLayerImpl> layer(
211 new cc_blink::WebLayerImpl(surface_layer)); 212 new cc_blink::WebLayerImpl(surface_layer));
212 // TODO(lfg): Investigate if it's possible to propagate the information about 213 // TODO(lfg): Investigate if it's possible to propagate the information about
213 // the child surface's opacity. https://crbug.com/629851. 214 // the child surface's opacity. https://crbug.com/629851.
214 layer->setOpaque(false); 215 layer->setOpaque(false);
215 layer->SetContentsOpaqueIsFixed(true); 216 layer->SetContentsOpaqueIsFixed(true);
216 UpdateWebLayer(std::move(layer)); 217 UpdateWebLayer(std::move(layer));
217 218
218 UpdateVisibility(true); 219 UpdateVisibility(true);
(...skipping 13 matching lines...) Expand all
232 frame_size, scale_factor, 233 frame_size, scale_factor,
233 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer()); 234 static_cast<cc_blink::WebLayerImpl*>(web_layer_.get())->layer());
234 } 235 }
235 236
236 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) { 237 void ChildFrameCompositingHelper::UpdateVisibility(bool visible) {
237 if (web_layer_) 238 if (web_layer_)
238 web_layer_->setDrawsContent(visible); 239 web_layer_->setDrawsContent(visible);
239 } 240 }
240 241
241 } // namespace content 242 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698