| 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 return WindowOpenDisposition::NEW_POPUP; | 322 return WindowOpenDisposition::NEW_POPUP; |
| 323 default: | 323 default: |
| 324 NOTREACHED() << "Unexpected WebNavigationPolicy"; | 324 NOTREACHED() << "Unexpected WebNavigationPolicy"; |
| 325 return WindowOpenDisposition::IGNORE_ACTION; | 325 return WindowOpenDisposition::IGNORE_ACTION; |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 // Returns true if the device scale is high enough that losing subpixel | 329 // Returns true if the device scale is high enough that losing subpixel |
| 330 // antialiasing won't have a noticeable effect on text quality. | 330 // antialiasing won't have a noticeable effect on text quality. |
| 331 static bool DeviceScaleEnsuresTextQuality(float device_scale_factor) { | 331 static bool DeviceScaleEnsuresTextQuality(float device_scale_factor) { |
| 332 #if defined(OS_ANDROID) | 332 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 333 // On Android, we never have subpixel antialiasing. | 333 // On Android, we never have subpixel antialiasing. On Chrome OS we prefer to |
| 334 // composite all scrollers so that we get animated overlay scrollbars. |
| 334 return true; | 335 return true; |
| 335 #else | 336 #else |
| 336 // 1.5 is a common touchscreen tablet device scale factor. For such | 337 // 1.5 is a common touchscreen tablet device scale factor. For such |
| 337 // devices main thread antialiasing is a heavy burden. | 338 // devices main thread antialiasing is a heavy burden. |
| 338 return device_scale_factor >= 1.5f; | 339 return device_scale_factor >= 1.5f; |
| 339 #endif | 340 #endif |
| 340 } | 341 } |
| 341 | 342 |
| 342 static bool PreferCompositingToLCDText(CompositorDependencies* compositor_deps, | 343 static bool PreferCompositingToLCDText(CompositorDependencies* compositor_deps, |
| 343 float device_scale_factor) { | 344 float device_scale_factor) { |
| (...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2712 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2713 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2713 } | 2714 } |
| 2714 | 2715 |
| 2715 std::unique_ptr<InputEventAck> ack( | 2716 std::unique_ptr<InputEventAck> ack( |
| 2716 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), | 2717 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type(), |
| 2717 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2718 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 2718 OnInputEventAck(std::move(ack)); | 2719 OnInputEventAck(std::move(ack)); |
| 2719 } | 2720 } |
| 2720 | 2721 |
| 2721 } // namespace content | 2722 } // namespace content |
| OLD | NEW |