Index: skia/ext/vector_platform_device_skia.cc |
=================================================================== |
--- skia/ext/vector_platform_device_skia.cc (revision 91504) |
+++ skia/ext/vector_platform_device_skia.cc (working copy) |
@@ -13,6 +13,19 @@ |
namespace skia { |
+SkDevice* VectorPlatformDeviceSkiaFactory::newDevice(SkCanvas* canvas, |
+ SkBitmap::Config config, |
+ int width, int height, |
+ bool isOpaque, |
+ bool isForLayer) { |
+ SkASSERT(config == SkBitmap::kARGB_8888_Config); |
+ SkRefPtr<SkDevice> device = factory_.newDevice(canvas, config, width, height, |
+ isOpaque, isForLayer); |
+ device->unref(); // SkRefPtr and new both took a reference. |
+ SkPDFDevice* pdf_device = static_cast<SkPDFDevice*>(device.get()); |
+ return new VectorPlatformDeviceSkia(pdf_device); |
+} |
+ |
static inline SkBitmap makeABitmap(int width, int height) { |
SkBitmap bitmap; |
bitmap.setConfig(SkBitmap::kNo_Config, width, height); |
@@ -211,13 +224,8 @@ |
#endif |
-SkDevice* VectorPlatformDeviceSkia::onCreateCompatibleDevice( |
- SkBitmap::Config config, int width, int height, bool isOpaque, |
- Usage /*usage*/) { |
- SkAutoTUnref<SkDevice> dev(pdf_device_->createCompatibleDevice(config, width, |
- height, |
- isOpaque)); |
- return new VectorPlatformDeviceSkia(static_cast<SkPDFDevice*>(dev.get())); |
+SkDeviceFactory* VectorPlatformDeviceSkia::onNewDeviceFactory() { |
+ return SkNEW(VectorPlatformDeviceSkiaFactory); |
} |
} // namespace skia |