| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 paint.setStrokeWidth(2); | 202 paint.setStrokeWidth(2); |
| 203 paint.setAntiAlias(true); | 203 paint.setAntiAlias(true); |
| 204 canvas.drawCircle(kHotspotOffset, kHotspotOffset, kHotspotRadius, paint); | 204 canvas.drawCircle(kHotspotOffset, kHotspotOffset, kHotspotRadius, paint); |
| 205 } | 205 } |
| 206 | 206 |
| 207 // Clip circle for magnified projection. | 207 // Clip circle for magnified projection. |
| 208 float padding = (kCursorSize - kDiameter) / 2; | 208 float padding = (kCursorSize - kDiameter) / 2; |
| 209 SkPath clip_path; | 209 SkPath clip_path; |
| 210 clip_path.addOval(SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter)); | 210 clip_path.addOval(SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter)); |
| 211 clip_path.close(); | 211 clip_path.close(); |
| 212 canvas.clipPath(clip_path, kIntersect_SkClipOp, true); | 212 canvas.clipPath(clip_path, SkClipOp::kIntersect, true); |
| 213 | 213 |
| 214 // Project pixels. | 214 // Project pixels. |
| 215 int pixel_count = kDiameter / kPixelSize; | 215 int pixel_count = kDiameter / kPixelSize; |
| 216 SkRect src_rect = SkRect::MakeXYWH(last_cursor_x_ - pixel_count / 2, | 216 SkRect src_rect = SkRect::MakeXYWH(last_cursor_x_ - pixel_count / 2, |
| 217 last_cursor_y_ - pixel_count / 2, | 217 last_cursor_y_ - pixel_count / 2, |
| 218 pixel_count, pixel_count); | 218 pixel_count, pixel_count); |
| 219 SkRect dst_rect = SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter); | 219 SkRect dst_rect = SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter); |
| 220 canvas.drawBitmapRect(frame_, src_rect, dst_rect, NULL); | 220 canvas.drawBitmapRect(frame_, src_rect, dst_rect, NULL); |
| 221 | 221 |
| 222 // Paint grid. | 222 // Paint grid. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 253 gfx::Point(kHotspotOffset * device_scale_factor, | 253 gfx::Point(kHotspotOffset * device_scale_factor, |
| 254 kHotspotOffset * device_scale_factor); | 254 kHotspotOffset * device_scale_factor); |
| 255 | 255 |
| 256 cursor.InitFromCursorInfo(cursor_info); | 256 cursor.InitFromCursorInfo(cursor_info); |
| 257 DCHECK(host_); | 257 DCHECK(host_); |
| 258 host_->SetCursor(cursor); | 258 host_->SetCursor(cursor); |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace protocol | 261 } // namespace protocol |
| 262 } // namespace content | 262 } // namespace content |
| OLD | NEW |