fix slowness of getImageData() for CanvasRenderingContext2D in linux due to un-optimized format for glReadPixels

This is a continuation of https://codereview.chromium.org/15331003/

BUG=242093
R=robertphillips@google.com, jun.a.jiang@intel.com, bsalomon@google.com

Author: bsalomon@google.com

Review URL: https://chromiumcodereview.appspot.com/15746007

git-svn-id: http://skia.googlecode.com/svn/trunk@9280 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index ade6431..5b556c5 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -152,11 +152,18 @@
     void forceRenderTargetFlush();
 
     /**
-     * Gets a preferred 8888 config to use for writing / reading pixel data. The returned config
-     * must have at least as many bits per channel as the config param.
+     * Gets a preferred 8888 config to use for writing/reading pixel data to/from a surface with
+     * config surfaceConfig. The returned config must have at least as many bits per channel as the
+     * readConfig or writeConfig param.
      */
-    virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig config) const { return config; }
-    virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig config) const { return config; }
+    virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig,
+                                                    GrPixelConfig surfaceConfig) const {
+        return readConfig;
+    }
+    virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig,
+                                                     GrPixelConfig surfaceConfig) const {
+        return writeConfig;
+    }
 
     /**
      * Called before uploading writing pixels to a GrTexture when the src pixel config doesn't