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

Unified Diff: ui/gfx/canvas.cc

Issue 1428623005: views::Border: Added CreateRoundedRectBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@boxlayout-collapse_when_hidden
Patch Set: Explain why the float version is preferred. Created 5 years, 1 month 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
« ui/gfx/canvas.h ('K') | « ui/gfx/canvas.h ('k') | ui/views/border.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index b228cd880bb35c3a1dbef1130bff7ec55584198a..eb9a5872af8c6d92c06db5290890acaa0b71a457 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -14,6 +14,7 @@
#include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
+#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/safe_integer_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/scoped_canvas.h"
@@ -305,6 +306,13 @@ void Canvas::DrawRoundRect(const Rect& rect,
SkIntToScalar(radius), paint);
}
+void Canvas::DrawRoundRect(const RectF& rect,
+ float radius,
+ const SkPaint& paint) {
+ canvas_->drawRoundRect(RectFToSkRect(rect), SkFloatToScalar(radius),
+ SkFloatToScalar(radius), paint);
+}
+
void Canvas::DrawPath(const SkPath& path, const SkPaint& paint) {
canvas_->drawPath(path, paint);
}
« ui/gfx/canvas.h ('K') | « ui/gfx/canvas.h ('k') | ui/views/border.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698