| 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 "ui/compositor/dip_util.h" | 5 #include "ui/compositor/dip_util.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "ui/compositor/compositor.h" | 9 #include "ui/compositor/compositor.h" |
| 10 #include "ui/compositor/compositor_switches.h" | 10 #include "ui/compositor/compositor_switches.h" |
| 11 #include "ui/compositor/layer.h" | 11 #include "ui/compositor/layer.h" |
| 12 #include "ui/gfx/display.h" | 12 #include "ui/gfx/display.h" |
| 13 #include "ui/gfx/geometry/point.h" |
| 13 #include "ui/gfx/geometry/safe_integer_conversions.h" | 14 #include "ui/gfx/geometry/safe_integer_conversions.h" |
| 14 #include "ui/gfx/point.h" | |
| 15 #include "ui/gfx/point_conversions.h" | 15 #include "ui/gfx/point_conversions.h" |
| 16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 17 #include "ui/gfx/rect_conversions.h" | 17 #include "ui/gfx/rect_conversions.h" |
| 18 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
| 19 #include "ui/gfx/size_conversions.h" | 19 #include "ui/gfx/size_conversions.h" |
| 20 | 20 |
| 21 namespace ui { | 21 namespace ui { |
| 22 | 22 |
| 23 float GetDeviceScaleFactor(const Layer* layer) { | 23 float GetDeviceScaleFactor(const Layer* layer) { |
| 24 return layer->device_scale_factor(); | 24 return layer->device_scale_factor(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 gfx::Point p; | 107 gfx::Point p; |
| 108 Layer::ConvertPointToLayer(layer_to_snap->parent(), snapped_layer, &p); | 108 Layer::ConvertPointToLayer(layer_to_snap->parent(), snapped_layer, &p); |
| 109 cc::Layer* cc_layer = layer_to_snap->cc_layer(); | 109 cc::Layer* cc_layer = layer_to_snap->cc_layer(); |
| 110 gfx::PointF origin = cc_layer->position(); | 110 gfx::PointF origin = cc_layer->position(); |
| 111 CheckSnapped((p.x() + origin.x()) * scale_factor); | 111 CheckSnapped((p.x() + origin.x()) * scale_factor); |
| 112 CheckSnapped((p.y() + origin.y()) * scale_factor); | 112 CheckSnapped((p.y() + origin.y()) * scale_factor); |
| 113 #endif | 113 #endif |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace ui | 116 } // namespace ui |
| OLD | NEW |