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

Side by Side Diff: ui/views/bubble/bubble_border.cc

Issue 568343002: Removed a few manual roundrect path creations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/bubble/bubble_border.h" 5 #include "ui/views/bubble/bubble_border.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 // Fill the contents with a round-rect region to match the border images. 345 // Fill the contents with a round-rect region to match the border images.
346 SkPaint paint; 346 SkPaint paint;
347 paint.setAntiAlias(true); 347 paint.setAntiAlias(true);
348 paint.setStyle(SkPaint::kFill_Style); 348 paint.setStyle(SkPaint::kFill_Style);
349 paint.setColor(border_->background_color()); 349 paint.setColor(border_->background_color());
350 SkPath path; 350 SkPath path;
351 gfx::Rect bounds(view->GetLocalBounds()); 351 gfx::Rect bounds(view->GetLocalBounds());
352 bounds.Inset(border_->GetInsets()); 352 bounds.Inset(border_->GetInsets());
353 353
354 SkScalar radius = SkIntToScalar(border_->GetBorderCornerRadius()); 354 canvas->DrawRoundRect(bounds, border_->GetBorderCornerRadius(), paint);
355 path.addRoundRect(gfx::RectToSkRect(bounds), radius, radius);
356 canvas->DrawPath(path, paint);
357 } 355 }
358 356
359 } // namespace views 357 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_bubble_views.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698