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

Unified Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 9544001: ui: Let skia do the conversion work for us by using the integer version of set() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: peter review Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/painter.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/touchui/touch_selection_controller_impl.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index 47dedf6d52cca9f9dcfff25a4c192a9ee79ae451..694d5eef30473162abb499870d1f72ad8fe6dd24 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -12,7 +12,6 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/canvas_skia.h"
-#include "ui/gfx/path.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
@@ -72,16 +71,13 @@ void PaintCircle(const Circle& circle, gfx::Canvas* canvas) {
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kFill_Style);
paint.setColor(circle.color);
- gfx::Path path;
+ SkPath path;
gfx::Rect bounds(circle.center.x() - circle.radius,
circle.center.y() - circle.radius,
circle.radius * 2,
circle.radius * 2);
- SkRect rect;
- rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()),
- SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
SkScalar radius = SkIntToScalar(circle.radius);
- path.addRoundRect(rect, radius, radius);
+ path.addRoundRect(gfx::RectToSkRect(bounds), radius, radius);
canvas->GetSkCanvas()->drawPath(path, paint);
}
@@ -262,8 +258,8 @@ class TouchSelectionControllerImpl::TouchContextMenuView
};
SkPoint points[2];
- points[0].set(SkIntToScalar(0), SkIntToScalar(0));
- points[1].set(SkIntToScalar(0), SkIntToScalar(height()));
+ points[0].iset(0, 0);
+ points[1].iset(0, height());
SkShader* shader = SkGradientShader::CreateLinear(points,
kGradientColors, kGradientPoints, arraysize(kGradientPoints),
« no previous file with comments | « ui/views/painter.cc ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698