Add zlib compression to memory program cache

The memory program cache currently uses quite a lot of memory: Up to 6MB
on desktop, 2MB on normal Android and 512Kb on low-end Android.

Compressing shader binaries results in a 4-10x decrease in size
(depending on the driver's binary representation).

Compression adds a measureable performance hit (around 500-1000
microseconds). But when compared to overall shader compile/link time,
which is around 6000 to 25000 microseconds, this seems acceptable for
the memory wins. UMA stats have been added so we can ensure these values
behave as expected in the wild.

Decompression is fairly cheap (<200 microseconds).

Currently, this feature is only turned on for low-end devices, as
those are the ones with the most memory pressure. However, if the
results are good, it might make sense to enable this in general.

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ie5d389f060504837efc86993811e83af8d630ce8
Reviewed-on: https://chromium-review.googlesource.com/572546
Commit-Queue: Eric Karl <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: Leon Scroggins <[email protected]>
Reviewed-by: Ilya Sherman <[email protected]>
Reviewed-by: Zhenyao Mo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#491865}
diff --git a/gpu/command_buffer/service/BUILD.gn b/gpu/command_buffer/service/BUILD.gn
index 743b21e..b4b40b9 100644
--- a/gpu/command_buffer/service/BUILD.gn
+++ b/gpu/command_buffer/service/BUILD.gn
@@ -179,6 +179,7 @@
     "//third_party/protobuf:protobuf_lite",
     "//third_party/re2",
     "//third_party/smhasher:cityhash",
+    "//third_party/zlib",
     "//ui/gfx",
     "//ui/gfx/geometry",
     "//ui/gfx/ipc/color",