diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-20 17:49:04 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-20 17:49:04 +0000 |
commit | 3055b700189afdd02486ed8f2279cea1d8897243 (patch) | |
tree | a66e6ce6e9717464dd67eb206f76440da9bab059 /experimental/PdfViewer | |
parent | 4eaa6647e70c9404d1c920f674d706ca2d2a76b9 (diff) |
Split SkDevice out of SkBitmapDevice
https://codereview.chromium.org/22978012/
git-svn-id: http://skia.googlecode.com/svn/trunk@10830 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/PdfViewer')
-rw-r--r-- | experimental/PdfViewer/SkNulCanvas.h | 4 | ||||
-rw-r--r-- | experimental/PdfViewer/SkPdfRenderer.cpp | 4 | ||||
-rw-r--r-- | experimental/PdfViewer/SkTrackDevice.h | 14 | ||||
-rw-r--r-- | experimental/PdfViewer/pdf_viewer_main.cpp | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/experimental/PdfViewer/SkNulCanvas.h b/experimental/PdfViewer/SkNulCanvas.h index 27dd9910ac..612251229e 100644 --- a/experimental/PdfViewer/SkNulCanvas.h +++ b/experimental/PdfViewer/SkNulCanvas.h @@ -8,7 +8,7 @@ public: SK_DECLARE_INST_COUNT(SkNulCanvas); SkNulCanvas() {} - explicit SkNulCanvas(SkDevice* device) : SkCanvas(device) {} + explicit SkNulCanvas(SkBaseDevice* device) : SkCanvas(device) {} explicit SkNulCanvas(const SkBitmap& bitmap) : SkCanvas(bitmap) {} virtual ~SkNulCanvas() {} @@ -83,7 +83,7 @@ public: protected: virtual SkCanvas* canvasForDrawIter() {return NULL;} - virtual SkDevice* setDevice(SkDevice* device) {return NULL;} + virtual SkBaseDevice* setDevice(SkBaseDevice* device) {return NULL;} private: typedef SkCanvas INHERITED; diff --git a/experimental/PdfViewer/SkPdfRenderer.cpp b/experimental/PdfViewer/SkPdfRenderer.cpp index ef13c55305..22f274aeb9 100644 --- a/experimental/PdfViewer/SkPdfRenderer.cpp +++ b/experimental/PdfViewer/SkPdfRenderer.cpp @@ -242,7 +242,7 @@ static bool readToken(SkPdfNativeTokenizer* fTokenizer, PdfToken* token) { memcpy(bitmap.getPixels(), gDumpBitmap->getPixels(), gDumpBitmap->getSize()); - SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (bitmap))); + SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (bitmap))); SkCanvas canvas(device); // draw context stuff here @@ -2641,7 +2641,7 @@ bool SkPDFNativeRenderToBitmap(SkStream* stream, setup_bitmap(output, (int)SkScalarToDouble(width), (int)SkScalarToDouble(height)); - SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*output))); + SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output))); SkCanvas canvas(device); return renderer.renderPage(page, &canvas, rect); diff --git a/experimental/PdfViewer/SkTrackDevice.h b/experimental/PdfViewer/SkTrackDevice.h index 6f26121d18..b8c36d995b 100644 --- a/experimental/PdfViewer/SkTrackDevice.h +++ b/experimental/PdfViewer/SkTrackDevice.h @@ -4,24 +4,24 @@ #include "SkDevice.h" #include "SkTracker.h" -class SkTrackDevice : public SkDevice { +class SkTrackDevice : public SkBitmapDevice { public: SK_DECLARE_INST_COUNT(SkTrackDevice) - SkTrackDevice(const SkBitmap& bitmap) : SkDevice(bitmap) + SkTrackDevice(const SkBitmap& bitmap) : SkBitmapDevice(bitmap) , fTracker(NULL) {} SkTrackDevice(const SkBitmap& bitmap, const SkDeviceProperties& deviceProperties) - : SkDevice(bitmap, deviceProperties) + : SkBitmapDevice(bitmap, deviceProperties) , fTracker(NULL) {} SkTrackDevice(SkBitmap::Config config, int width, int height, bool isOpaque = false) - : SkDevice(config, width, height, isOpaque) + : SkBitmapDevice(config, width, height, isOpaque) , fTracker(NULL) {} SkTrackDevice(SkBitmap::Config config, int width, int height, bool isOpaque, const SkDeviceProperties& deviceProperties) - : SkDevice(config, width, height, isOpaque, deviceProperties) + : SkBitmapDevice(config, width, height, isOpaque, deviceProperties) , fTracker(NULL) {} virtual ~SkTrackDevice() {} @@ -147,7 +147,7 @@ protected: after(); } - virtual void drawDevice(const SkDraw& dummy1, SkDevice* dummy2, int x, int y, + virtual void drawDevice(const SkDraw& dummy1, SkBaseDevice* dummy2, int x, int y, const SkPaint& dummy3) { before(); INHERITED::drawDevice(dummy1, dummy2, x, y, dummy3); @@ -171,7 +171,7 @@ private: private: SkTracker* fTracker; - typedef SkDevice INHERITED; + typedef SkBitmapDevice INHERITED; }; #endif // EXPERIMENTAL_PDFVIEWER_SKTRACKDEVICE_H_ diff --git a/experimental/PdfViewer/pdf_viewer_main.cpp b/experimental/PdfViewer/pdf_viewer_main.cpp index 8949e7e20e..79338425ff 100644 --- a/experimental/PdfViewer/pdf_viewer_main.cpp +++ b/experimental/PdfViewer/pdf_viewer_main.cpp @@ -179,7 +179,7 @@ static bool render_page(const SkString& outputDir, // Exercise all pdf codepaths as in normal rendering, but no actual bits are changed. if (!FLAGS_config.isEmpty() && strcmp(FLAGS_config[0], "nul") == 0) { SkBitmap bitmap; - SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (bitmap))); + SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (bitmap))); SkNulCanvas canvas(device); renderer.renderPage(page < 0 ? 0 : page, &canvas, rect); } else { @@ -197,9 +197,9 @@ static bool render_page(const SkString& outputDir, #else setup_bitmap(&bitmap, (int)SkScalarToDouble(width), (int)SkScalarToDouble(height)); #endif - SkAutoTUnref<SkDevice> device; + SkAutoTUnref<SkBaseDevice> device; if (strcmp(FLAGS_config[0], "8888") == 0) { - device.reset(SkNEW_ARGS(SkDevice, (bitmap))); + device.reset(SkNEW_ARGS(SkBitmapDevice, (bitmap))); } #if SK_SUPPORT_GPU else if (strcmp(FLAGS_config[0], "gpu") == 0) { |