Revert "Revert of implement readPixels and writePixels natively, w/o using the (deprecated) (https://codereview.chromium.org/199733016/)"

This reverts commit 9a90bd16dc6756395c422adf0f24560d033ed9ea.

BUG=skia:
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/211293002

git-svn-id: http://skia.googlecode.com/svn/trunk@13939 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 94e4c8c..db46b86 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -34,11 +34,22 @@
     SkColorTable* ctable = bitmap.getColorTable();
     char* dst = (char*)buffer;
 
-    uint32_t* colorTableDst = reinterpret_cast<uint32_t*>(dst);
-    const uint32_t* colorTableSrc = reinterpret_cast<const uint32_t*>(ctable->lockColors());
-    SkConvertConfig8888Pixels(colorTableDst, 0, SkCanvas::kRGBA_Premul_Config8888,
-                              colorTableSrc, 0, SkCanvas::kNative_Premul_Config8888,
-                              ctable->count(), 1);
+    const int count = ctable->count();
+
+    SkDstPixelInfo dstPI;
+    dstPI.fColorType = kRGBA_8888_SkColorType;
+    dstPI.fAlphaType = kPremul_SkAlphaType;
+    dstPI.fPixels = buffer;
+    dstPI.fRowBytes = count * sizeof(SkPMColor);
+
+    SkSrcPixelInfo srcPI;
+    srcPI.fColorType = kPMColor_SkColorType;
+    srcPI.fAlphaType = kPremul_SkAlphaType;
+    srcPI.fPixels = ctable->lockColors();
+    srcPI.fRowBytes = count * sizeof(SkPMColor);
+
+    srcPI.convertPixelsTo(&dstPI, count, 1);
+
     ctable->unlockColors();
 
     // always skip a full 256 number of entries, even if we memcpy'd fewer