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

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

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop TNoRef Created 8 years, 1 month 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
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..7d80be6e0523383abc968f5a1fd7c92fdb6ce70c 100644
--- a/chrome/browser/ui/views/theme_helpers.cc
+++ b/chrome/browser/ui/views/theme_helpers.cc
@@ -49,13 +49,12 @@ 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(
+ skia::RefPtr<SkShader> gradient_shader = 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),

Powered by Google App Engine
This is Rietveld 408576698