| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 181 SkPaint paint; | 181 SkPaint paint; |
| 182 | 182 |
| 183 // Paint original spot with cross. | 183 // Paint original spot with cross. |
| 184 if (kHotspotRadius) { | 184 if (kHotspotRadius > 0) { |
| 185 paint.setStrokeWidth(1); | 185 paint.setStrokeWidth(1); |
| 186 paint.setAntiAlias(false); | 186 paint.setAntiAlias(false); |
| 187 paint.setColor(SK_ColorDKGRAY); | 187 paint.setColor(SK_ColorDKGRAY); |
| 188 paint.setStyle(SkPaint::kStroke_Style); | 188 paint.setStyle(SkPaint::kStroke_Style); |
| 189 | 189 |
| 190 canvas.drawLine(kHotspotOffset, kHotspotOffset - 2 * kHotspotRadius, | 190 canvas.drawLine(kHotspotOffset, kHotspotOffset - 2 * kHotspotRadius, |
| 191 kHotspotOffset, kHotspotOffset - kHotspotRadius, | 191 kHotspotOffset, kHotspotOffset - kHotspotRadius, |
| 192 paint); | 192 paint); |
| 193 canvas.drawLine(kHotspotOffset, kHotspotOffset + kHotspotRadius, | 193 canvas.drawLine(kHotspotOffset, kHotspotOffset + kHotspotRadius, |
| 194 kHotspotOffset, kHotspotOffset + 2 * kHotspotRadius, | 194 kHotspotOffset, kHotspotOffset + 2 * kHotspotRadius, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 #endif | 258 #endif |
| 259 | 259 |
| 260 cursor.InitFromCursorInfo(cursor_info); | 260 cursor.InitFromCursorInfo(cursor_info); |
| 261 DCHECK(host_); | 261 DCHECK(host_); |
| 262 host_->SetCursor(cursor); | 262 host_->SetCursor(cursor); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace page | 265 } // namespace page |
| 266 } // namespace devtools | 266 } // namespace devtools |
| 267 } // namespace content | 267 } // namespace content |
| OLD | NEW |