OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 cc::LayerSelectionBound ConvertWebSelectionBound( | 104 cc::LayerSelectionBound ConvertWebSelectionBound( |
105 const WebSelection& web_selection, | 105 const WebSelection& web_selection, |
106 bool is_start) { | 106 bool is_start) { |
107 cc::LayerSelectionBound cc_bound; | 107 cc::LayerSelectionBound cc_bound; |
108 if (web_selection.isNone()) | 108 if (web_selection.isNone()) |
109 return cc_bound; | 109 return cc_bound; |
110 | 110 |
111 const blink::WebSelectionBound& web_bound = | 111 const blink::WebSelectionBound& web_bound = |
112 is_start ? web_selection.start() : web_selection.end(); | 112 is_start ? web_selection.start() : web_selection.end(); |
113 DCHECK(web_bound.layerId); | 113 DCHECK(web_bound.layerId); |
114 cc_bound.type = cc::SELECTION_BOUND_CENTER; | 114 cc_bound.type = gfx::SelectionBound::CENTER; |
115 if (web_selection.isRange()) { | 115 if (web_selection.isRange()) { |
116 if (is_start) { | 116 if (is_start) { |
117 cc_bound.type = web_bound.isTextDirectionRTL ? cc::SELECTION_BOUND_RIGHT | 117 cc_bound.type = web_bound.isTextDirectionRTL ? gfx::SelectionBound::RIGHT |
118 : cc::SELECTION_BOUND_LEFT; | 118 : gfx::SelectionBound::LEFT; |
119 } else { | 119 } else { |
120 cc_bound.type = web_bound.isTextDirectionRTL ? cc::SELECTION_BOUND_LEFT | 120 cc_bound.type = web_bound.isTextDirectionRTL ? gfx::SelectionBound::LEFT |
121 : cc::SELECTION_BOUND_RIGHT; | 121 : gfx::SelectionBound::RIGHT; |
122 } | 122 } |
123 } | 123 } |
124 cc_bound.layer_id = web_bound.layerId; | 124 cc_bound.layer_id = web_bound.layerId; |
125 cc_bound.edge_top = gfx::Point(web_bound.edgeTopInLayer); | 125 cc_bound.edge_top = gfx::Point(web_bound.edgeTopInLayer); |
126 cc_bound.edge_bottom = gfx::Point(web_bound.edgeBottomInLayer); | 126 cc_bound.edge_bottom = gfx::Point(web_bound.edgeBottomInLayer); |
127 return cc_bound; | 127 return cc_bound; |
128 } | 128 } |
129 | 129 |
130 cc::LayerSelection ConvertWebSelection(const WebSelection& web_selection) { | 130 cc::LayerSelection ConvertWebSelection(const WebSelection& web_selection) { |
131 cc::LayerSelection cc_selection; | 131 cc::LayerSelection cc_selection; |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 #endif | 1157 #endif |
1158 return actual; | 1158 return actual; |
1159 } | 1159 } |
1160 | 1160 |
1161 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( | 1161 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( |
1162 float device_scale) { | 1162 float device_scale) { |
1163 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); | 1163 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); |
1164 } | 1164 } |
1165 | 1165 |
1166 } // namespace content | 1166 } // namespace content |
OLD | NEW |