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

Unified Diff: chrome/browser/ui/views/theme_helpers.cc

Issue 11280251: chrome: Use skia::RefPtr for skia ref-counted objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: linuxbuild Created 8 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 | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/common/badge_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/theme_helpers.cc
diff --git a/chrome/browser/ui/views/theme_helpers.cc b/chrome/browser/ui/views/theme_helpers.cc
index 833f49c28bb95083c1fad1a8cd6ba9ec9860b5f8..27d0b4c4c1a13615521c0cf2b486c3f5652dd730 100644
--- a/chrome/browser/ui/views/theme_helpers.cc
+++ b/chrome/browser/ui/views/theme_helpers.cc
@@ -49,13 +49,13 @@ void GetRebarGradientColors(int width, int x1, int x2,
SkPoint grad_points[2];
grad_points[0].set(SkIntToScalar(0), SkIntToScalar(0));
grad_points[1].set(SkIntToScalar(width), SkIntToScalar(0));
- SkShader* gradient_shader = SkGradientShader::CreateLinear(
- grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode);
+ skia::RefPtr<SkShader> gradient_shader = skia::AdoptRef(
+ SkGradientShader::CreateLinear(
+ grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode));
SkPaint paint;
- paint.setShader(gradient_shader);
+ paint.setShader(gradient_shader.get());
// Shader created with a ref count of 1, release as the paint now owns
// the gradient.
- gradient_shader->unref();
paint.setStyle(SkPaint::kFill_Style);
canvas.sk_canvas()->drawRectCoords(
SkIntToScalar(0), SkIntToScalar(0),
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/common/badge_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698