clean read/write pixels signatures, augment SkSurface API

For now, not adding writePixels to surface, since it appears we may not
be able to remove writePixels from canvas :(

Bug: skia:3216
Change-Id: I64ccebb31effacffe615ae4537fb46a161a6768d
Reviewed-on: https://skia-review.googlesource.com/25562
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 5f2130b..57b2d41 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -194,15 +194,14 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-bool SkGpuDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
-                               int x, int y) {
+bool SkGpuDevice::onReadPixels(const SkPixmap& pm, int x, int y) {
     ASSERT_SINGLE_OWNER
 
-    if (!SkImageInfoValidConversion(dstInfo, this->imageInfo())) {
+    if (!SkImageInfoValidConversion(pm.info(), this->imageInfo())) {
         return false;
     }
 
-    SkReadPixelsRec rec(dstInfo, dstPixels, dstRowBytes, x, y);
+    SkReadPixelsRec rec(pm, x, y);
     if (!rec.trim(this->width(), this->height())) {
         return false;
     }
@@ -210,15 +209,14 @@
     return fRenderTargetContext->readPixels(rec.fInfo, rec.fPixels, rec.fRowBytes, rec.fX, rec.fY);
 }
 
-bool SkGpuDevice::onWritePixels(const SkImageInfo& srcInfo, const void* srcPixels,
-                                size_t srcRowBytes, int x, int y) {
+bool SkGpuDevice::onWritePixels(const SkPixmap& pm, int x, int y) {
     ASSERT_SINGLE_OWNER
 
-    if (!SkImageInfoValidConversion(this->imageInfo(), srcInfo)) {
+    if (!SkImageInfoValidConversion(this->imageInfo(), pm.info())) {
         return false;
     }
 
-    SkWritePixelsRec rec(srcInfo, srcPixels, srcRowBytes, x, y);
+    SkWritePixelsRec rec(pm, x, y);
     if (!rec.trim(this->width(), this->height())) {
         return false;
     }