| 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" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 blink::WebScreenInfo screen_info; |
| 169 view->GetScreenInfo(&screen_info); | 169 host_->GetWebScreenInfo(&screen_info); |
| 170 double device_scale_factor = screen_info.deviceScaleFactor; | 170 double device_scale_factor = screen_info.deviceScaleFactor; |
| 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); |
| (...skipping 75 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 |