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
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index d96ffb8..4a89ef3 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -161,12 +161,12 @@
 }
 
 SkGpuDevice::SkGpuDevice(GrContext* context, GrTexture* texture)
-: SkDevice(make_bitmap(context, texture->asRenderTarget())) {
+    : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) {
     this->initFromRenderTarget(context, texture->asRenderTarget(), false);
 }
 
 SkGpuDevice::SkGpuDevice(GrContext* context, GrRenderTarget* renderTarget)
-: SkDevice(make_bitmap(context, renderTarget)) {
+    : SkBitmapDevice(make_bitmap(context, renderTarget)) {
     this->initFromRenderTarget(context, renderTarget, false);
 }
 
@@ -203,7 +203,7 @@
                          int width,
                          int height,
                          int sampleCount)
-    : SkDevice(config, width, height, false /*isOpaque*/) {
+    : SkBitmapDevice(config, width, height, false /*isOpaque*/) {
 
     fDrawProcs = NULL;
 
@@ -1436,7 +1436,7 @@
     fContext->drawRectToRect(grPaint, dstRect, paintRect, &m);
 }
 
-static bool filter_texture(SkDevice* device, GrContext* context,
+static bool filter_texture(SkBaseDevice* device, GrContext* context,
                            GrTexture* texture, SkImageFilter* filter,
                            int w, int h, const SkMatrix& ctm, SkBitmap* result,
                            SkIPoint* offset) {
@@ -1535,7 +1535,7 @@
     this->drawBitmapCommon(draw, bitmap, &tmpSrc, matrix, paint, flags);
 }
 
-void SkGpuDevice::drawDevice(const SkDraw& draw, SkDevice* device,
+void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
                              int x, int y, const SkPaint& paint) {
     // clear of the source device must occur before CHECK_SHOULD_DRAW
     SkGpuDevice* dev = static_cast<SkGpuDevice*>(device);
@@ -1818,10 +1818,10 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkDevice* SkGpuDevice::onCreateCompatibleDevice(SkBitmap::Config config,
-                                                int width, int height,
-                                                bool isOpaque,
-                                                Usage usage) {
+SkBaseDevice* SkGpuDevice::onCreateCompatibleDevice(SkBitmap::Config config,
+                                                    int width, int height,
+                                                    bool isOpaque,
+                                                    Usage usage) {
     GrTextureDesc desc;
     desc.fConfig = fRenderTarget->config();
     desc.fFlags = kRenderTarget_GrTextureFlagBit;
@@ -1854,7 +1854,7 @@
 SkGpuDevice::SkGpuDevice(GrContext* context,
                          GrTexture* texture,
                          bool needClear)
-    : SkDevice(make_bitmap(context, texture->asRenderTarget())) {
+    : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) {
 
     SkASSERT(texture && texture->asRenderTarget());
     // This constructor is called from onCreateCompatibleDevice. It has locked the RT in the texture