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

Unified Diff: ui/native_theme/native_theme_aura.cc

Issue 12041085: Fix menu corners: the menu background was being painted as a rect when in fact, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_config.h » ('j') | ui/views/controls/menu/menu_host.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_aura.cc
diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc
index 6382593f3e63d8752143d4a6c46efb3c3d263115..fc8cfb50c5e0cdb3e257f659ca1e12dc9193806d 100644
--- a/ui/native_theme/native_theme_aura.cc
+++ b/ui/native_theme/native_theme_aura.cc
@@ -9,10 +9,13 @@
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/path.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
#include "ui/gfx/skbitmap_operations.h"
#include "ui/native_theme/common_theme.h"
+#include "ui/views/controls/menu/menu_config.h"
sky 2013/01/25 16:10:52 ui shouldn't depend upon views like this. Otherwis
varunjain 2013/01/25 18:50:40 Done as discussed offline.
+#include "ui/views/round_rect_painter.h"
namespace {
@@ -195,7 +198,19 @@ SkColor NativeThemeAura::GetSystemColor(ColorId color_id) const {
void NativeThemeAura::PaintMenuPopupBackground(SkCanvas* canvas,
const gfx::Size& size) const {
- canvas->drawColor(kMenuBackgroundColor, SkXfermode::kSrc_Mode);
+ if (views::MenuConfig::instance(instance()).has_rounded_corners) {
+ SkPaint paint;
+ paint.setStyle(SkPaint::kFill_Style);
+ paint.setFlags(SkPaint::kAntiAlias_Flag);
+ paint.setColor(kMenuBackgroundColor);
+
+ gfx::Path path;
+ views::RoundRectPainter::CreateRoundRectPath(gfx::Rect(size), &path);
+
+ canvas->drawPath(path, paint);
+ } else {
+ canvas->drawColor(kMenuBackgroundColor, SkXfermode::kSrc_Mode);
+ }
}
void NativeThemeAura::PaintScrollbarTrack(
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_config.h » ('j') | ui/views/controls/menu/menu_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698