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

Unified Diff: skia/ext/vector_platform_device_skia.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: nit+rebase 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 | « skia/ext/vector_platform_device_skia.h ('k') | skia/skia.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « skia/ext/vector_platform_device_skia.h ('k') | skia/skia.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698