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

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

Issue 2122023002: Cross-process frames should be notified of device scale factor changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Version of patch without second test. Created 4 years, 4 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 997
998 return size_; 998 return size_;
999 } 999 }
1000 1000
1001 void RenderWidget::Resize(const ResizeParams& params) { 1001 void RenderWidget::Resize(const ResizeParams& params) {
1002 bool orientation_changed = 1002 bool orientation_changed =
1003 screen_info_.orientationAngle != params.screen_info.orientationAngle || 1003 screen_info_.orientationAngle != params.screen_info.orientationAngle ||
1004 screen_info_.orientationType != params.screen_info.orientationType; 1004 screen_info_.orientationType != params.screen_info.orientationType;
1005 1005
1006 screen_info_ = params.screen_info; 1006 screen_info_ = params.screen_info;
1007 SetDeviceScaleFactor(screen_info_.deviceScaleFactor); 1007
1008 if (device_scale_factor_ != screen_info_.deviceScaleFactor) {
1009 device_scale_factor_ = screen_info_.deviceScaleFactor;
1010 OnDeviceScaleFactorChanged();
1011 ScheduleComposite();
1012 }
1008 1013
1009 if (resizing_mode_selector_->NeverUsesSynchronousResize()) { 1014 if (resizing_mode_selector_->NeverUsesSynchronousResize()) {
1010 // A resize ack shouldn't be requested if we have not ACK'd the previous 1015 // A resize ack shouldn't be requested if we have not ACK'd the previous
1011 // one. 1016 // one.
1012 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack()); 1017 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack());
1013 } 1018 }
1014 1019
1015 // Ignore this during shutdown. 1020 // Ignore this during shutdown.
1016 if (!webwidget_) 1021 if (!webwidget_)
1017 return; 1022 return;
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 for (size_t i = 0u; i < text_input_info_history_.size() - 1u; ++i) { 1589 for (size_t i = 0u; i < text_input_info_history_.size() - 1u; ++i) {
1585 if (text_input_info_history_[i] != text_input_info_) 1590 if (text_input_info_history_[i] != text_input_info_)
1586 return false; 1591 return false;
1587 } 1592 }
1588 return true; 1593 return true;
1589 #else 1594 #else
1590 return !!webwidget_; 1595 return !!webwidget_;
1591 #endif 1596 #endif
1592 } 1597 }
1593 1598
1594 void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { 1599 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) {
1595 if (device_scale_factor_ == device_scale_factor) 1600 if (device_scale_factor_ == device_scale_factor)
1596 return; 1601 return;
1597 1602
1598 device_scale_factor_ = device_scale_factor; 1603 device_scale_factor_ = device_scale_factor;
1599 1604
1600 OnDeviceScaleFactorChanged(); 1605 OnDeviceScaleFactorChanged();
1606 ScheduleComposite();
1601 1607
1602 ScheduleComposite(); 1608 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_);
1603 } 1609 }
1604 1610
1605 bool RenderWidget::SetDeviceColorProfile( 1611 bool RenderWidget::SetDeviceColorProfile(
1606 const std::vector<char>& color_profile) { 1612 const std::vector<char>& color_profile) {
1607 if (device_color_profile_ == color_profile) 1613 if (device_color_profile_ == color_profile)
1608 return false; 1614 return false;
1609 1615
1610 device_color_profile_ = color_profile; 1616 device_color_profile_ = color_profile;
1611 1617
1612 if (owner_delegate_) 1618 if (owner_delegate_)
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 void RenderWidget::requestPointerUnlock() { 2065 void RenderWidget::requestPointerUnlock() {
2060 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); 2066 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get());
2061 } 2067 }
2062 2068
2063 bool RenderWidget::isPointerLocked() { 2069 bool RenderWidget::isPointerLocked() {
2064 return mouse_lock_dispatcher_->IsMouseLockedTo( 2070 return mouse_lock_dispatcher_->IsMouseLockedTo(
2065 webwidget_mouse_lock_target_.get()); 2071 webwidget_mouse_lock_target_.get());
2066 } 2072 }
2067 2073
2068 } // namespace content 2074 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/test/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698