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

Side by Side Diff: chrome/browser/ui/libgtkui/native_theme_gtk2.cc

Issue 2717943002: Fix cc/paint skia type mismatches (Closed)
Patch Set: Rebase Created 3 years, 9 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/libgtkui/BUILD.gn ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/ui/libgtkui/native_theme_gtk2.h" 5 #include "chrome/browser/ui/libgtkui/native_theme_gtk2.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "chrome/browser/ui/libgtkui/chrome_gtk_frame.h" 9 #include "chrome/browser/ui/libgtkui/chrome_gtk_frame.h"
10 #include "chrome/browser/ui/libgtkui/chrome_gtk_menu_subclasses.h" 10 #include "chrome/browser/ui/libgtkui/chrome_gtk_menu_subclasses.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // This doesn't actually get called 70 // This doesn't actually get called
71 NativeThemeGtk2::~NativeThemeGtk2() {} 71 NativeThemeGtk2::~NativeThemeGtk2() {}
72 72
73 void NativeThemeGtk2::PaintMenuPopupBackground( 73 void NativeThemeGtk2::PaintMenuPopupBackground(
74 cc::PaintCanvas* canvas, 74 cc::PaintCanvas* canvas,
75 const gfx::Size& size, 75 const gfx::Size& size,
76 const MenuBackgroundExtraParams& menu_background) const { 76 const MenuBackgroundExtraParams& menu_background) const {
77 if (menu_background.corner_radius > 0) { 77 if (menu_background.corner_radius > 0) {
78 cc::PaintFlags flags; 78 cc::PaintFlags flags;
79 flags.setStyle(cc::PaintFlags::kFill_Style); 79 flags.setStyle(cc::PaintFlags::kFill_Style);
80 flags.setFlags(cc::PaintFlags::kAntiAlias_Flag); 80 flags.setAntiAlias(true);
81 flags.setColor(GetSystemColor(kColorId_MenuBackgroundColor)); 81 flags.setColor(GetSystemColor(kColorId_MenuBackgroundColor));
82 82
83 gfx::Path path; 83 gfx::Path path;
84 SkRect rect = SkRect::MakeWH(SkIntToScalar(size.width()), 84 SkRect rect = SkRect::MakeWH(SkIntToScalar(size.width()),
85 SkIntToScalar(size.height())); 85 SkIntToScalar(size.height()));
86 SkScalar radius = SkIntToScalar(menu_background.corner_radius); 86 SkScalar radius = SkIntToScalar(menu_background.corner_radius);
87 SkScalar radii[8] = {radius, radius, radius, radius, 87 SkScalar radii[8] = {radius, radius, radius, radius,
88 radius, radius, radius, radius}; 88 radius, radius, radius, radius};
89 path.addRoundRect(rect, radii); 89 path.addRoundRect(rect, radii);
90 90
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 GtkWidget* NativeThemeGtk2::GetSeparator() const { 460 GtkWidget* NativeThemeGtk2::GetSeparator() const {
461 static GtkWidget* fake_separator = nullptr; 461 static GtkWidget* fake_separator = nullptr;
462 462
463 if (!fake_separator) 463 if (!fake_separator)
464 fake_separator = gtk_hseparator_new(); 464 fake_separator = gtk_hseparator_new();
465 465
466 return fake_separator; 466 return fake_separator;
467 } 467 }
468 468
469 } // namespace libgtkui 469 } // namespace libgtkui
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtkui/BUILD.gn ('k') | chrome/browser/ui/libgtkui/native_theme_gtk3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698