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

Unified Diff: ui/native_theme/native_theme_mac.mm

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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 | « ui/native_theme/native_theme_mac.h ('k') | ui/native_theme/native_theme_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_mac.mm
diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm
index 36a58dc1d810ba40479bf2b03a421c9b16c67f28..7e1bb77f435b56aecb199e4b97634bed68c61d56 100644
--- a/ui/native_theme/native_theme_mac.mm
+++ b/ui/native_theme/native_theme_mac.mm
@@ -252,10 +252,10 @@ SkColor NativeThemeMac::GetSystemColor(ColorId color_id) const {
}
void NativeThemeMac::PaintMenuPopupBackground(
- SkCanvas* canvas,
+ CdlCanvas* canvas,
const gfx::Size& size,
const MenuBackgroundExtraParams& menu_background) const {
- SkPaint paint;
+ CdlPaint paint;
paint.setAntiAlias(true);
if (base::mac::IsOS10_9())
paint.setColor(kMenuPopupBackgroundColorMavericks);
@@ -267,11 +267,11 @@ void NativeThemeMac::PaintMenuPopupBackground(
}
void NativeThemeMac::PaintMenuItemBackground(
- SkCanvas* canvas,
+ CdlCanvas* canvas,
State state,
const gfx::Rect& rect,
const MenuItemExtraParams& menu_item) const {
- SkPaint paint;
+ CdlPaint paint;
switch (state) {
case NativeTheme::kNormal:
case NativeTheme::kDisabled:
@@ -369,7 +369,7 @@ sk_sp<SkShader> NativeThemeMac::GetButtonBorderShader(ButtonBackgroundType type,
}
// static
-void NativeThemeMac::PaintStyledGradientButton(SkCanvas* canvas,
+void NativeThemeMac::PaintStyledGradientButton(CdlCanvas* canvas,
const gfx::Rect& integer_bounds,
ButtonBackgroundType type,
bool round_left,
@@ -408,20 +408,22 @@ void NativeThemeMac::PaintStyledGradientButton(SkCanvas* canvas,
else
shape.setRect(bounds);
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
+ CdlPaint paint;
+ paint.setStyle(CdlPaint::kFill_Style);
paint.setAntiAlias(true);
// First draw the darker "outer" border, with its gradient and shadow. Inside
// a tab strip, this will draw over the outer border and inner separator.
paint.setLooper(gfx::CreateShadowDrawLooper(shadows));
- paint.setShader(GetButtonBorderShader(type, shape.height()));
+ paint.setShader(
+ CdlShader::WrapSkShader(GetButtonBorderShader(type, shape.height())));
canvas->drawRRect(shape, paint);
// Then, inset the rounded rect and draw over that with the inner gradient.
shape.inset(kBorderThickness, kBorderThickness);
paint.setLooper(nullptr);
- paint.setShader(GetButtonBackgroundShader(type, shape.height()));
+ paint.setShader(
+ CdlShader::WrapSkShader(GetButtonBackgroundShader(type, shape.height())));
canvas->drawRRect(shape, paint);
if (!focus)
« no previous file with comments | « ui/native_theme/native_theme_mac.h ('k') | ui/native_theme/native_theme_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698