Always use RGBA textures for color font atlases

This is the last use of kSkiaGamma8888_GrPixelConfig

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3417

Change-Id: I307479c41f1ca437733dfafd044bb1baeb42f31d
Reviewed-on: https://skia-review.googlesource.com/3417
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/GrBatchAtlas.cpp b/src/gpu/GrBatchAtlas.cpp
index e0828a4..e478ca1 100644
--- a/src/gpu/GrBatchAtlas.cpp
+++ b/src/gpu/GrBatchAtlas.cpp
@@ -62,11 +62,19 @@
     unsigned char* dataPtr = fData;
     dataPtr += fBytesPerPixel * fWidth * loc->fY;
     dataPtr += fBytesPerPixel * loc->fX;
-    // copy into the data buffer
-    for (int i = 0; i < height; ++i) {
-        memcpy(dataPtr, imagePtr, rowBytes);
-        dataPtr += fBytesPerPixel * fWidth;
-        imagePtr += rowBytes;
+    // copy into the data buffer, swizzling as we go if this is ARGB data
+    if (4 == fBytesPerPixel && kSkia8888_GrPixelConfig == kBGRA_8888_GrPixelConfig) {
+        for (int i = 0; i < height; ++i) {
+            SkOpts::RGBA_to_BGRA(reinterpret_cast<uint32_t*>(dataPtr), imagePtr, width);
+            dataPtr += fBytesPerPixel * fWidth;
+            imagePtr += rowBytes;
+        }
+    } else {
+        for (int i = 0; i < height; ++i) {
+            memcpy(dataPtr, imagePtr, rowBytes);
+            dataPtr += fBytesPerPixel * fWidth;
+            imagePtr += rowBytes;
+        }
     }
 
     fDirtyRect.join(loc->fX, loc->fY, loc->fX + width, loc->fY + height);