summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/views/detachable_toolbar_view.cc14
-rw-r--r--chrome/browser/views/sad_tab_view.cc6
-rw-r--r--gfx/native_theme_win.cc2
-rw-r--r--gfx/skia_util.h4
-rw-r--r--skia/ext/vector_platform_device_linux.cc4
-rw-r--r--skia/ext/vector_platform_device_win.cc4
-rw-r--r--webkit/tools/pepper_test_plugin/plugin_object.cc5
7 files changed, 18 insertions, 21 deletions
diff --git a/chrome/browser/views/detachable_toolbar_view.cc b/chrome/browser/views/detachable_toolbar_view.cc
index 796425f..e2aaa3a 100644
--- a/chrome/browser/views/detachable_toolbar_view.cc
+++ b/chrome/browser/views/detachable_toolbar_view.cc
@@ -97,10 +97,10 @@ void DetachableToolbarView::PaintVerticalDivider(
const SkColor& bottom_color) {
// Draw the upper half of the divider.
SkPaint paint;
- paint.setShader(gfx::CreateGradientShader(vertical_padding + 1,
- height / 2,
- top_color,
- middle_color))->safeUnref();
+ SkSafeUnref(paint.setShader(gfx::CreateGradientShader(vertical_padding + 1,
+ height / 2,
+ top_color,
+ middle_color)));
SkRect rc = { SkIntToScalar(x),
SkIntToScalar(vertical_padding + 1),
SkIntToScalar(x + 1),
@@ -109,10 +109,8 @@ void DetachableToolbarView::PaintVerticalDivider(
// Draw the lower half of the divider.
SkPaint paint_down;
- paint_down.setShader(gfx::CreateGradientShader(height / 2,
- height - vertical_padding,
- middle_color,
- bottom_color))->safeUnref();
+ SkSafeUnref(paint_down.setShader(gfx::CreateGradientShader(
+ height / 2, height - vertical_padding, middle_color, bottom_color)));
SkRect rc_down = { SkIntToScalar(x),
SkIntToScalar(height / 2),
SkIntToScalar(x + 1),
diff --git a/chrome/browser/views/sad_tab_view.cc b/chrome/browser/views/sad_tab_view.cc
index 680e7d3..31f45fd 100644
--- a/chrome/browser/views/sad_tab_view.cc
+++ b/chrome/browser/views/sad_tab_view.cc
@@ -54,9 +54,9 @@ SadTabView::SadTabView(TabContents* tab_contents)
void SadTabView::Paint(gfx::Canvas* canvas) {
SkPaint paint;
- paint.setShader(gfx::CreateGradientShader(0, height(),
- kBackgroundColor,
- kBackgroundEndColor))->safeUnref();
+ SkSafeUnref(paint.setShader(gfx::CreateGradientShader(0, height(),
+ kBackgroundColor,
+ kBackgroundEndColor)));
paint.setStyle(SkPaint::kFill_Style);
canvas->AsCanvasSkia()->drawRectCoords(
0, 0, SkIntToScalar(width()), SkIntToScalar(height()), paint);
diff --git a/gfx/native_theme_win.cc b/gfx/native_theme_win.cc
index 6b4a545..5ee77f9 100644
--- a/gfx/native_theme_win.cc
+++ b/gfx/native_theme_win.cc
@@ -45,7 +45,7 @@ void SetCheckerboardShader(SkPaint* paint, const RECT& align_rect) {
matrix.setTranslate(SkIntToScalar(align_rect.left),
SkIntToScalar(align_rect.top));
shader->setLocalMatrix(matrix);
- paint->setShader(shader)->safeUnref();
+ SkSafeUnref(paint->setShader(shader));
}
} // namespace
diff --git a/gfx/skia_util.h b/gfx/skia_util.h
index 26c54bf..00a1d1c 100644
--- a/gfx/skia_util.h
+++ b/gfx/skia_util.h
@@ -22,9 +22,9 @@ gfx::Rect SkRectToRect(const SkRect& rect);
// Creates a vertical gradient shader. The caller owns the shader.
// Example usage to avoid leaks:
-// paint.setShader(gfx::CreateGradientShader(0, 10, red, blue))->safeUnref();
+// SkSafeUnref(paint.setShader(gfx::CreateGradientShader(0, 10, red, blue)));
//
-// (The old shader in the paint, if any, needs to be freed, and safeUnref will
+// (The old shader in the paint, if any, needs to be freed, and SkSafeUnref will
// handle the NULL case.)
SkShader* CreateGradientShader(int start_point,
int end_point,
diff --git a/skia/ext/vector_platform_device_linux.cc b/skia/ext/vector_platform_device_linux.cc
index e3438e3..cbe465d 100644
--- a/skia/ext/vector_platform_device_linux.cc
+++ b/skia/ext/vector_platform_device_linux.cc
@@ -153,7 +153,7 @@ void VectorPlatformDevice::drawPath(const SkDraw& draw,
// Removes the path effect from the temporary SkPaint object.
SkPaint paint_no_effet(paint);
- paint_no_effet.setPathEffect(NULL)->safeUnref();
+ SkSafeUnref(paint_no_effet.setPathEffect(NULL));
// Draw the calculated path.
drawPath(draw, path_modified, paint_no_effet);
@@ -369,7 +369,7 @@ void VectorPlatformDevice::drawRect(const SkDraw& draw,
// Removes the path effect from the temporary SkPaint object.
SkPaint paint_no_effet(paint);
- paint_no_effet.setPathEffect(NULL)->safeUnref();
+ SkSafeUnref(paint_no_effet.setPathEffect(NULL));
// Draw the calculated path.
drawPath(draw, path_modified, paint_no_effet);
diff --git a/skia/ext/vector_platform_device_win.cc b/skia/ext/vector_platform_device_win.cc
index ce096af..49dbc13 100644
--- a/skia/ext/vector_platform_device_win.cc
+++ b/skia/ext/vector_platform_device_win.cc
@@ -140,7 +140,7 @@ void VectorPlatformDevice::drawRect(const SkDraw& draw,
// Removes the path effect from the temporary SkPaint object.
SkPaint paint_no_effet(paint);
- paint_no_effet.setPathEffect(NULL)->safeUnref();
+ SkSafeUnref(paint_no_effet.setPathEffect(NULL));
// Draw the calculated path.
drawPath(draw, path_modified, paint_no_effet);
@@ -170,7 +170,7 @@ void VectorPlatformDevice::drawPath(const SkDraw& draw,
// Removes the path effect from the temporary SkPaint object.
SkPaint paint_no_effet(paint);
- paint_no_effet.setPathEffect(NULL)->safeUnref();
+ SkSafeUnref(paint_no_effet.setPathEffect(NULL));
// Draw the calculated path.
drawPath(draw, path_modified, paint_no_effet);
diff --git a/webkit/tools/pepper_test_plugin/plugin_object.cc b/webkit/tools/pepper_test_plugin/plugin_object.cc
index bd11a8e..b66a2af 100644
--- a/webkit/tools/pepper_test_plugin/plugin_object.cc
+++ b/webkit/tools/pepper_test_plugin/plugin_object.cc
@@ -252,9 +252,8 @@ void DrawSampleBitmap(void *region, int width, int height) {
SkPoint grad_points[2];
grad_points[0].set(SkIntToScalar(0), SkIntToScalar(0));
grad_points[1].set(SkIntToScalar(0), SkIntToScalar(height));
- paint.setShader(SkGradientShader::CreateLinear(
- grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode))
- ->safeUnref();
+ SkSafeUnref(paint.setShader(SkGradientShader::CreateLinear(
+ grad_points, grad_colors, NULL, 2, SkShader::kRepeat_TileMode)));
canvas.drawPath(path, paint);
}