Make PackPixels take an angle::Format.

This removes the format type parameter from places where it isn't
needed. It also removes the 'write color' functions map. This map was
redundant with the angle::Format write function.

Bug: angleproject:2729
Change-Id: I24e4548a89342237d7ed25180fea156fba51ccab
Reviewed-on: https://chromium-review.googlesource.com/1142300
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/renderer_utils.h b/src/libANGLE/renderer/renderer_utils.h
index 78444cb..34140bf 100644
--- a/src/libANGLE/renderer/renderer_utils.h
+++ b/src/libANGLE/renderer/renderer_utils.h
@@ -21,6 +21,7 @@
 namespace angle
 {
 struct Format;
+enum class FormatID;
 }  // namespace angle
 
 namespace gl
@@ -130,8 +131,7 @@
   public:
     struct Entry
     {
-        GLenum format;
-        GLenum type;
+        angle::FormatID formatID;
         ColorCopyFunction func;
     };
 
@@ -139,8 +139,8 @@
 
     constexpr FastCopyFunctionMap(const Entry *data, size_t size) : mSize(size), mData(data) {}
 
-    bool has(const gl::FormatType &formatType) const;
-    ColorCopyFunction get(const gl::FormatType &formatType) const;
+    bool has(angle::FormatID formatID) const;
+    ColorCopyFunction get(angle::FormatID formatID) const;
 
   private:
     size_t mSize;
@@ -151,16 +151,14 @@
 {
     PackPixelsParams();
     PackPixelsParams(const gl::Rectangle &area,
-                     GLenum format,
-                     GLenum type,
+                     const angle::Format &destFormat,
                      GLuint outputPitch,
                      const gl::PixelPackState &pack,
                      gl::Buffer *packBufferIn,
                      ptrdiff_t offset);
 
     gl::Rectangle area;
-    GLenum format;
-    GLenum type;
+    const angle::Format *destFormat;
     GLuint outputPitch;
     gl::Buffer *packBuffer;
     gl::PixelPackState pack;
@@ -173,10 +171,6 @@
                 const uint8_t *source,
                 uint8_t *destination);
 
-ColorWriteFunction GetColorWriteFunction(const gl::FormatType &formatType);
-ColorCopyFunction GetFastCopyFunction(const FastCopyFunctionMap &fastCopyFunctions,
-                                      const gl::FormatType &formatType);
-
 using InitializeTextureDataFunction = void (*)(size_t width,
                                                size_t height,
                                                size_t depth,
@@ -274,6 +268,7 @@
 template <typename NonFloatT>
 void GetMatrixUniform(GLenum type, NonFloatT *dataOut, const NonFloatT *source, bool transpose);
 
+const angle::Format &GetFormatFromFormatType(GLenum format, GLenum type);
 }  // namespace rx
 
 #endif  // LIBANGLE_RENDERER_RENDERER_UTILS_H_