Index: ui/native_theme/native_theme_win.cc |
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc |
index 27a00a510c00e2a5355756b12b37a14e0d559b60..3b7e2fa4ab69dc45bc4b2191645063c07bde1484 100644 |
--- a/ui/native_theme/native_theme_win.cc |
+++ b/ui/native_theme/native_theme_win.cc |
@@ -81,16 +81,15 @@ void SetCheckerboardShader(SkPaint* paint, const RECT& align_rect) { |
temp_bitmap.setPixels(buffer); |
SkBitmap bitmap; |
temp_bitmap.copyTo(&bitmap, temp_bitmap.config()); |
- SkShader* shader = SkShader::CreateBitmapShader(bitmap, |
- SkShader::kRepeat_TileMode, |
- SkShader::kRepeat_TileMode); |
+ skia::RefPtr<SkShader> shader = SkShader::CreateBitmapShader( |
+ bitmap, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode)); |
// Align the pattern with the upper corner of |align_rect|. |
SkMatrix matrix; |
matrix.setTranslate(SkIntToScalar(align_rect.left), |
SkIntToScalar(align_rect.top)); |
shader->setLocalMatrix(matrix); |
- SkSafeUnref(paint->setShader(shader)); |
+ skia::RefPtr<SkShader>(paint->setShader(shader.get())); |
} |
// <-a-> |
@@ -509,11 +508,11 @@ void NativeThemeWin::PaintIndirect(SkCanvas* canvas, |
// keeping a cache of the resulting bitmaps. |
// Create an offscreen canvas that is backed by an HDC. |
- skia::BitmapPlatformDevice* device = skia::BitmapPlatformDevice::Create( |
- rect.width(), rect.height(), false, NULL); |
+ skia::RefPtr<skia::BitmapPlatformDevice> device = |
+ skia::BitmapPlatformDevice::Create( |
+ rect.width(), rect.height(), false, NULL); |
DCHECK(device); |
- SkCanvas offscreen_canvas(device); |
- device->unref(); |
+ SkCanvas offscreen_canvas(device.get()); |
DCHECK(skia::SupportsPlatformPaint(&offscreen_canvas)); |
// Some of the Windows theme drawing operations do not write correct alpha |