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

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

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizefconvert-gfx: . Created 5 years, 2 months 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 "cc/blink/web_layer_impl.h" 7 #include "cc/blink/web_layer_impl.h"
8 #include "cc/layers/delegated_frame_provider.h" 8 #include "cc/layers/delegated_frame_provider.h"
9 #include "cc/layers/delegated_frame_resource_collection.h" 9 #include "cc/layers/delegated_frame_resource_collection.h"
10 #include "cc/layers/delegated_renderer_layer.h" 10 #include "cc/layers/delegated_renderer_layer.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 void ChildFrameCompositingHelper::CheckSizeAndAdjustLayerProperties( 155 void ChildFrameCompositingHelper::CheckSizeAndAdjustLayerProperties(
156 const gfx::Size& new_size, 156 const gfx::Size& new_size,
157 float device_scale_factor, 157 float device_scale_factor,
158 cc::Layer* layer) { 158 cc::Layer* layer) {
159 if (buffer_size_ != new_size) { 159 if (buffer_size_ != new_size) {
160 buffer_size_ = new_size; 160 buffer_size_ = new_size;
161 // The container size is in DIP, so is the layer size. 161 // The container size is in DIP, so is the layer size.
162 // Buffer size is in physical pixels, so we need to adjust 162 // Buffer size is in physical pixels, so we need to adjust
163 // it by the device scale factor. 163 // it by the device scale factor.
164 gfx::Size device_scale_adjusted_size = gfx::ToFlooredSize( 164 gfx::Size device_scale_adjusted_size =
165 gfx::ScaleSize(buffer_size_, 1.0f / device_scale_factor)); 165 gfx::ScaleToFlooredSize(buffer_size_, 1.0f / device_scale_factor);
166 layer->SetBounds(device_scale_adjusted_size); 166 layer->SetBounds(device_scale_adjusted_size);
167 } 167 }
168 168
169 // Manually manage background layer for transparent webview. 169 // Manually manage background layer for transparent webview.
170 if (!opaque_) 170 if (!opaque_)
171 background_layer_->SetIsDrawable(false); 171 background_layer_->SetIsDrawable(false);
172 } 172 }
173 173
174 void ChildFrameCompositingHelper::OnContainerDestroy() { 174 void ChildFrameCompositingHelper::OnContainerDestroy() {
175 // If we have a pending ACK, then ACK now so we don't lose frames in the 175 // If we have a pending ACK, then ACK now so we don't lose frames in the
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 394
395 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) { 395 void ChildFrameCompositingHelper::SetContentsOpaque(bool opaque) {
396 opaque_ = opaque; 396 opaque_ = opaque;
397 if (delegated_layer_.get()) 397 if (delegated_layer_.get())
398 delegated_layer_->SetContentsOpaque(opaque_); 398 delegated_layer_->SetContentsOpaque(opaque_);
399 if (surface_layer_.get()) 399 if (surface_layer_.get())
400 surface_layer_->SetContentsOpaque(opaque_); 400 surface_layer_->SetContentsOpaque(opaque_);
401 } 401 }
402 402
403 } // namespace content 403 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cursors/webcursor_mac.mm ('k') | content/renderer/disambiguation_popup_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698