Split SkDevice into SkBaseDevice and SkBitmapDevice

https://codereview.chromium.org/22978012/



git-svn-id: http://skia.googlecode.com/svn/trunk@10995 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/utils/SkPictureUtils.cpp b/src/utils/SkPictureUtils.cpp
index 45d3f1b..ce51614 100644
--- a/src/utils/SkPictureUtils.cpp
+++ b/src/utils/SkPictureUtils.cpp
@@ -5,13 +5,13 @@
  * found in the LICENSE file.
  */
 
-#include "SkPictureUtils.h"
+#include "SkBitmapDevice.h"
 #include "SkCanvas.h"
 #include "SkData.h"
-#include "SkDevice.h"
+#include "SkPictureUtils.h"
 #include "SkPixelRef.h"
-#include "SkShader.h"
 #include "SkRRect.h"
+#include "SkShader.h"
 
 class PixelRefSet {
 public:
@@ -47,7 +47,7 @@
  *  It should never actually draw anything, so there need not be any pixels
  *  behind its device-bitmap.
  */
-class GatherPixelRefDevice : public SkDevice {
+class GatherPixelRefDevice : public SkBitmapDevice {
 private:
     PixelRefSet*  fPRSet;
 
@@ -70,7 +70,7 @@
     }
 
 public:
-    GatherPixelRefDevice(const SkBitmap& bm, PixelRefSet* prset) : SkDevice(bm) {
+    GatherPixelRefDevice(const SkBitmap& bm, PixelRefSet* prset) : SkBitmapDevice(bm) {
         fPRSet = prset;
     }
 
@@ -138,7 +138,7 @@
                               const SkPaint& paint) SK_OVERRIDE {
         this->addBitmapFromPaint(paint);
     }
-    virtual void drawDevice(const SkDraw&, SkDevice*, int x, int y,
+    virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
                             const SkPaint&) SK_OVERRIDE {
         nothing_to_do();
     }
@@ -150,11 +150,14 @@
         not_supported();
         return false;
     }
+
+private:
+    typedef SkBitmapDevice INHERITED;
 };
 
 class NoSaveLayerCanvas : public SkCanvas {
 public:
-    NoSaveLayerCanvas(SkDevice* device) : INHERITED(device) {}
+    NoSaveLayerCanvas(SkBaseDevice* device) : INHERITED(device) {}
 
     // turn saveLayer() into save() for speed, should not affect correctness.
     virtual int saveLayer(const SkRect* bounds, const SkPaint* paint,