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

Unified Diff: ui/gfx/canvas.cc

Issue 568343002: Removed a few manual roundrect path creations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change variable names Created 6 years, 3 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
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index e8d6a9166fb1136c5d94fca30912b80f137a01be..6a41587b71325bf3143324c929a727678a123427 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -297,6 +297,22 @@ void Canvas::DrawRoundRect(const Rect& rect,
SkIntToScalar(radius), paint);
}
+void Canvas::DrawRoundRect(const Rect& rect,
+ int rad_top_left,
+ int rad_top_right,
+ int rad_bottom_left,
+ int rad_bottom_right,
+ const SkPaint& paint) {
+ SkScalar rad[8] = {
+ SkIntToScalar(rad_top_left), SkIntToScalar(rad_top_left),
+ SkIntToScalar(rad_top_right), SkIntToScalar(rad_top_right),
+ SkIntToScalar(rad_bottom_left), SkIntToScalar(rad_bottom_left),
+ SkIntToScalar(rad_bottom_right), SkIntToScalar(rad_bottom_right)};
+ SkRRect rrect;
+ rrect.setRectRadii(RectToSkRect(rect), (const SkVector*)rad);
+ canvas_->drawRRect(rrect, paint);
+}
+
void Canvas::DrawPath(const SkPath& path, const SkPaint& paint) {
canvas_->drawPath(path, paint);
}

Powered by Google App Engine
This is Rietveld 408576698