Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: content/browser/devtools/protocol/color_picker.cc

Issue 771563003: use SkClipOps where we can, legacyClip where we need to rework Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/renderer_host/render_widget_host_view_base.h" 9 #include "content/browser/renderer_host/render_widget_host_view_base.h"
10 #include "content/common/cursors/webcursor.h" 10 #include "content/common/cursors/webcursor.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 paint.setStrokeWidth(2); 200 paint.setStrokeWidth(2);
201 paint.setAntiAlias(true); 201 paint.setAntiAlias(true);
202 canvas.drawCircle(kHotspotOffset, kHotspotOffset, kHotspotRadius, paint); 202 canvas.drawCircle(kHotspotOffset, kHotspotOffset, kHotspotRadius, paint);
203 } 203 }
204 204
205 // Clip circle for magnified projection. 205 // Clip circle for magnified projection.
206 float padding = (kCursorSize - kDiameter) / 2; 206 float padding = (kCursorSize - kDiameter) / 2;
207 SkPath clip_path; 207 SkPath clip_path;
208 clip_path.addOval(SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter)); 208 clip_path.addOval(SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter));
209 clip_path.close(); 209 clip_path.close();
210 canvas.clipPath(clip_path, SkRegion::kIntersect_Op, true); 210 canvas.clipPath(clip_path, kIntersect_SkClipOp, true);
211 211
212 // Project pixels. 212 // Project pixels.
213 int pixel_count = kDiameter / kPixelSize; 213 int pixel_count = kDiameter / kPixelSize;
214 SkRect src_rect = SkRect::MakeXYWH(last_cursor_x_ - pixel_count / 2, 214 SkRect src_rect = SkRect::MakeXYWH(last_cursor_x_ - pixel_count / 2,
215 last_cursor_y_ - pixel_count / 2, 215 last_cursor_y_ - pixel_count / 2,
216 pixel_count, pixel_count); 216 pixel_count, pixel_count);
217 SkRect dst_rect = SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter); 217 SkRect dst_rect = SkRect::MakeXYWH(padding, padding, kDiameter, kDiameter);
218 canvas.drawBitmapRectToRect(frame_, &src_rect, dst_rect); 218 canvas.drawBitmapRectToRect(frame_, &src_rect, dst_rect);
219 219
220 // Paint grid. 220 // Paint grid.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 #endif 255 #endif
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698