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

Unified Diff: ui/native_theme/native_theme_mac.mm

Issue 1831883002: Use sk_sp-based shader creation APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/native_theme/native_theme_mac.h ('k') | ui/views/controls/scrollbar/cocoa_scroll_bar.mm » ('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 32e6cbdb616e7e45a73fa117eef401bf326d8987..2fba8f861a91c62aafdc42037210d0039927c624 100644
--- a/ui/native_theme/native_theme_mac.mm
+++ b/ui/native_theme/native_theme_mac.mm
@@ -268,7 +268,7 @@ void NativeThemeMac::PaintMenuItemBackground(
}
// static
-skia::RefPtr<SkShader> NativeThemeMac::GetButtonBackgroundShader(
+sk_sp<SkShader> NativeThemeMac::GetButtonBackgroundShader(
NativeTheme::State state, int height) {
typedef SkColor ColorByState[NativeTheme::State::kNumStates];
SkPoint gradient_points[2];
@@ -292,11 +292,9 @@ skia::RefPtr<SkShader> NativeThemeMac::GetButtonBackgroundShader(
start_colors[state], start_colors[state], end_colors[state]
};
- skia::RefPtr<SkShader> gradient_shader = skia::AdoptRef(
- SkGradientShader::CreateLinear(
- gradient_points, gradient_colors, gradient_positions, 3,
- SkShader::kClamp_TileMode));
- return gradient_shader;
+ return SkGradientShader::MakeLinear(
+ gradient_points, gradient_colors, gradient_positions, 3,
+ SkShader::kClamp_TileMode);
}
NativeThemeMac::NativeThemeMac() {
« no previous file with comments | « ui/native_theme/native_theme_mac.h ('k') | ui/views/controls/scrollbar/cocoa_scroll_bar.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698