| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 // root layer. | 407 // root layer. |
| 408 blink::WebDeviceEmulationParams modified_params = params_; | 408 blink::WebDeviceEmulationParams modified_params = params_; |
| 409 modified_params.deviceScaleFactor = original_screen_info_.deviceScaleFactor; | 409 modified_params.deviceScaleFactor = original_screen_info_.deviceScaleFactor; |
| 410 modified_params.offset = blink::WebFloatPoint(offset_.x(), offset_.y()); | 410 modified_params.offset = blink::WebFloatPoint(offset_.x(), offset_.y()); |
| 411 modified_params.scale = scale_; | 411 modified_params.scale = scale_; |
| 412 widget_->SetScreenMetricsEmulationParameters(true, modified_params); | 412 widget_->SetScreenMetricsEmulationParameters(true, modified_params); |
| 413 | 413 |
| 414 widget_->SetDeviceScaleFactor(applied_device_scale_factor); | 414 widget_->SetDeviceScaleFactor(applied_device_scale_factor); |
| 415 widget_->view_screen_rect_ = applied_widget_rect_; | 415 widget_->view_screen_rect_ = applied_widget_rect_; |
| 416 | 416 |
| 417 gfx::Size physical_backing_size = gfx::ToCeiledSize(gfx::ScaleSize( | 417 gfx::Size physical_backing_size = gfx::ScaleToCeiledSize( |
| 418 original_size_, original_screen_info_.deviceScaleFactor)); | 418 original_size_, original_screen_info_.deviceScaleFactor); |
| 419 widget_->Resize(applied_widget_rect_.size(), | 419 widget_->Resize(applied_widget_rect_.size(), |
| 420 physical_backing_size, | 420 physical_backing_size, |
| 421 top_controls_shrink_blink_size, | 421 top_controls_shrink_blink_size, |
| 422 top_controls_height, | 422 top_controls_height, |
| 423 applied_widget_rect_.size(), | 423 applied_widget_rect_.size(), |
| 424 resizer_rect, | 424 resizer_rect, |
| 425 is_fullscreen_granted, | 425 is_fullscreen_granted, |
| 426 display_mode, | 426 display_mode, |
| 427 NO_RESIZE_ACK); | 427 NO_RESIZE_ACK); |
| 428 } | 428 } |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 } | 1356 } |
| 1357 | 1357 |
| 1358 AutoResizeCompositor(); | 1358 AutoResizeCompositor(); |
| 1359 | 1359 |
| 1360 if (!resizing_mode_selector_->is_synchronous_mode()) | 1360 if (!resizing_mode_selector_->is_synchronous_mode()) |
| 1361 need_update_rect_for_auto_resize_ = true; | 1361 need_update_rect_for_auto_resize_ = true; |
| 1362 } | 1362 } |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 void RenderWidget::AutoResizeCompositor() { | 1365 void RenderWidget::AutoResizeCompositor() { |
| 1366 physical_backing_size_ = gfx::ToCeiledSize(gfx::ScaleSize(size_, | 1366 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); |
| 1367 device_scale_factor_)); | |
| 1368 if (compositor_) | 1367 if (compositor_) |
| 1369 compositor_->setViewportSize(size_, physical_backing_size_); | 1368 compositor_->setViewportSize(size_, physical_backing_size_); |
| 1370 } | 1369 } |
| 1371 | 1370 |
| 1372 void RenderWidget::initializeLayerTreeView() { | 1371 void RenderWidget::initializeLayerTreeView() { |
| 1373 DCHECK(!host_closing_); | 1372 DCHECK(!host_closing_); |
| 1374 | 1373 |
| 1375 compositor_ = RenderWidgetCompositor::Create(this, compositor_deps_); | 1374 compositor_ = RenderWidgetCompositor::Create(this, compositor_deps_); |
| 1376 compositor_->setViewportSize(size_, physical_backing_size_); | 1375 compositor_->setViewportSize(size_, physical_backing_size_); |
| 1377 if (init_complete_) | 1376 if (init_complete_) |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2419 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2421 video_hole_frames_.AddObserver(frame); | 2420 video_hole_frames_.AddObserver(frame); |
| 2422 } | 2421 } |
| 2423 | 2422 |
| 2424 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2423 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2425 video_hole_frames_.RemoveObserver(frame); | 2424 video_hole_frames_.RemoveObserver(frame); |
| 2426 } | 2425 } |
| 2427 #endif // defined(VIDEO_HOLE) | 2426 #endif // defined(VIDEO_HOLE) |
| 2428 | 2427 |
| 2429 } // namespace content | 2428 } // namespace content |
| OLD | NEW |