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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 invalidation_task_posted_(false), | 110 invalidation_task_posted_(false), |
111 screen_info_(screen_info), | 111 screen_info_(screen_info), |
112 device_scale_factor_(1), | 112 device_scale_factor_(1), |
113 throttle_input_events_(true), | 113 throttle_input_events_(true), |
114 next_smooth_scroll_gesture_id_(0) { | 114 next_smooth_scroll_gesture_id_(0) { |
115 if (!swapped_out) | 115 if (!swapped_out) |
116 RenderProcess::current()->AddRefProcess(); | 116 RenderProcess::current()->AddRefProcess(); |
117 DCHECK(RenderThread::Get()); | 117 DCHECK(RenderThread::Get()); |
118 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( | 118 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( |
119 switches::kDisableGpuVsync); | 119 switches::kDisableGpuVsync); |
120 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) | 120 // TODO(skyostil): Move device scale factor initialization to gfx::Display. |
121 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_ANDROID) | |
johnme
2012/10/31 11:48:37
Woah, this code path includes a static_cast<int>;
Sami
2012/10/31 11:51:40
Ack, serves me right for not re-testing on all dev
| |
121 device_scale_factor_ = screen_info.verticalDPI / kStandardDPI; | 122 device_scale_factor_ = screen_info.verticalDPI / kStandardDPI; |
122 // Unless an explicit scale factor was provided for testing, ensure the scale | 123 // Unless an explicit scale factor was provided for testing, ensure the scale |
123 // is integral. | 124 // is integral. |
124 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 125 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
125 switches::kForceDeviceScaleFactor)) | 126 switches::kForceDeviceScaleFactor)) |
126 device_scale_factor_ = static_cast<int>(device_scale_factor_); | 127 device_scale_factor_ = static_cast<int>(device_scale_factor_); |
127 device_scale_factor_ = std::max(1.0f, device_scale_factor_); | 128 device_scale_factor_ = std::max(1.0f, device_scale_factor_); |
128 #endif | 129 #endif |
129 } | 130 } |
130 | 131 |
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1903 | 1904 |
1904 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1905 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1905 return false; | 1906 return false; |
1906 } | 1907 } |
1907 | 1908 |
1908 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1909 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1909 return false; | 1910 return false; |
1910 } | 1911 } |
1911 | 1912 |
1912 } // namespace content | 1913 } // namespace content |
OLD | NEW |