OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/devtools/protocol/color_picker.h" | 5 #include "content/browser/devtools/protocol/color_picker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 10 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
11 #include "content/common/cursors/webcursor.h" | 11 #include "content/common/cursors/webcursor.h" |
| 12 #include "content/public/common/screen_info.h" |
12 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 13 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
13 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | |
14 #include "third_party/WebKit/public/web/WebInputEvent.h" | 14 #include "third_party/WebKit/public/web/WebInputEvent.h" |
15 #include "third_party/skia/include/core/SkCanvas.h" | 15 #include "third_party/skia/include/core/SkCanvas.h" |
16 #include "third_party/skia/include/core/SkPaint.h" | 16 #include "third_party/skia/include/core/SkPaint.h" |
17 #include "third_party/skia/include/core/SkPath.h" | 17 #include "third_party/skia/include/core/SkPath.h" |
18 #include "ui/gfx/geometry/size_conversions.h" | 18 #include "ui/gfx/geometry/size_conversions.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 namespace devtools { | 21 namespace devtools { |
22 namespace page { | 22 namespace page { |
23 | 23 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 const float kHotspotRadius = 0; | 158 const float kHotspotRadius = 0; |
159 const float kPixelSize = 9; | 159 const float kPixelSize = 9; |
160 #else | 160 #else |
161 const float kCursorSize = 150; | 161 const float kCursorSize = 150; |
162 const float kDiameter = 110; | 162 const float kDiameter = 110; |
163 const float kHotspotOffset = 25; | 163 const float kHotspotOffset = 25; |
164 const float kHotspotRadius = 5; | 164 const float kHotspotRadius = 5; |
165 const float kPixelSize = 10; | 165 const float kPixelSize = 10; |
166 #endif | 166 #endif |
167 | 167 |
168 blink::WebScreenInfo screen_info; | 168 content::ScreenInfo screen_info; |
169 host_->GetWebScreenInfo(&screen_info); | 169 host_->GetScreenInfo(&screen_info); |
170 double device_scale_factor = screen_info.deviceScaleFactor; | 170 double device_scale_factor = screen_info.device_scale_factor; |
171 | 171 |
172 SkBitmap result; | 172 SkBitmap result; |
173 result.allocN32Pixels(kCursorSize * device_scale_factor, | 173 result.allocN32Pixels(kCursorSize * device_scale_factor, |
174 kCursorSize * device_scale_factor); | 174 kCursorSize * device_scale_factor); |
175 result.eraseARGB(0, 0, 0, 0); | 175 result.eraseARGB(0, 0, 0, 0); |
176 | 176 |
177 SkCanvas canvas(result); | 177 SkCanvas canvas(result); |
178 canvas.scale(device_scale_factor, device_scale_factor); | 178 canvas.scale(device_scale_factor, device_scale_factor); |
179 canvas.translate(0.5f, 0.5f); | 179 canvas.translate(0.5f, 0.5f); |
180 | 180 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 kHotspotOffset * device_scale_factor); | 255 kHotspotOffset * device_scale_factor); |
256 | 256 |
257 cursor.InitFromCursorInfo(cursor_info); | 257 cursor.InitFromCursorInfo(cursor_info); |
258 DCHECK(host_); | 258 DCHECK(host_); |
259 host_->SetCursor(cursor); | 259 host_->SetCursor(cursor); |
260 } | 260 } |
261 | 261 |
262 } // namespace page | 262 } // namespace page |
263 } // namespace devtools | 263 } // namespace devtools |
264 } // namespace content | 264 } // namespace content |
OLD | NEW |