summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-09 16:47:25 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-09 16:47:25 +0000
commit2dfcd62c749a9414670c8ddcab54516b21f964cc (patch)
tree7f80c52afa1583c67fed3f702277199ed3d0af0d /skia
parent87d4321bbed8d21bf8284e2a970ac4a862681bc0 (diff)
downloadchromium_src-2dfcd62c749a9414670c8ddcab54516b21f964cc.zip
chromium_src-2dfcd62c749a9414670c8ddcab54516b21f964cc.tar.gz
chromium_src-2dfcd62c749a9414670c8ddcab54516b21f964cc.tar.bz2
Update SkPDFDeviceFactory for change in Skia.
- Use SkPDFDeviceFactory instead of duplicating it's functionaily (which changed in this roll). BUG=79519 TEST=NONE Review URL: http://codereview.chromium.org/6965009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84631 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/vector_platform_device_skia.cc18
-rw-r--r--skia/ext/vector_platform_device_skia.h2
2 files changed, 8 insertions, 12 deletions
diff --git a/skia/ext/vector_platform_device_skia.cc b/skia/ext/vector_platform_device_skia.cc
index 8fe6d77f..9d2415e 100644
--- a/skia/ext/vector_platform_device_skia.cc
+++ b/skia/ext/vector_platform_device_skia.cc
@@ -13,23 +13,17 @@
namespace skia {
-SkDevice* VectorPlatformDeviceSkiaFactory::newDevice(SkCanvas* noUsed,
+SkDevice* VectorPlatformDeviceSkiaFactory::newDevice(SkCanvas* canvas,
SkBitmap::Config config,
int width, int height,
bool isOpaque,
bool isForLayer) {
SkASSERT(config == SkBitmap::kARGB_8888_Config);
- SkMatrix initialTransform;
- initialTransform.reset();
- if (isForLayer) {
- initialTransform.setTranslate(0, height);
- initialTransform.preScale(1, -1);
- }
- SkISize size = SkISize::Make(width, height);
- SkRefPtr<SkPDFDevice> pdf_device =
- new SkPDFDevice(size, size, initialTransform);
- pdf_device->unref(); // SkRefPtr and new both took a reference.
- return new VectorPlatformDeviceSkia(pdf_device.get());
+ 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) {
diff --git a/skia/ext/vector_platform_device_skia.h b/skia/ext/vector_platform_device_skia.h
index 4fcd315d..74f2817 100644
--- a/skia/ext/vector_platform_device_skia.h
+++ b/skia/ext/vector_platform_device_skia.h
@@ -27,6 +27,8 @@ class VectorPlatformDeviceSkiaFactory : public SkDeviceFactory {
virtual SkDevice* newDevice(SkCanvas* notUsed, SkBitmap::Config config,
int width, int height, bool isOpaque,
bool isForLayer);
+ private:
+ SkPDFDeviceFactory factory_;
};
class VectorPlatformDeviceSkia : public PlatformDevice {