Index: skia/ext/vector_platform_device_skia.cc |
diff --git a/skia/ext/vector_platform_device_skia.cc b/skia/ext/vector_platform_device_skia.cc |
index 14376222b49c4dd397acf76b85e052db94e613f6..d8d3084afcbe40fadf20f19ee08a75184b032ef6 100644 |
--- a/skia/ext/vector_platform_device_skia.cc |
+++ b/skia/ext/vector_platform_device_skia.cc |
@@ -41,9 +41,8 @@ PlatformSurface VectorPlatformDeviceSkia::BeginPlatformPaint() { |
// and return the context from it, then layer on the raster data as an |
// image in EndPlatformPaint. |
DCHECK(raster_surface_ == NULL); |
- raster_surface_ = BitmapPlatformDevice::CreateAndClear(width(), height(), |
- false); |
- raster_surface_->unref(); // SkRefPtr and create both took a reference. |
+ raster_surface_ = skia::AdoptRef( |
+ BitmapPlatformDevice::CreateAndClear(width(), height(), false)); |
return raster_surface_->BeginPlatformPaint(); |
} |
@@ -58,7 +57,7 @@ void VectorPlatformDeviceSkia::EndPlatformPaint() { |
drawSprite(draw, raster_surface_->accessBitmap(false), 0, 0, paint); |
// BitmapPlatformDevice matches begin and end calls. |
raster_surface_->EndPlatformPaint(); |
- raster_surface_ = NULL; |
+ raster_surface_.clear(); |
} |
#if defined(OS_WIN) |