1. With introduction of compressed formats, e.g. ETC1, the number of
bits per pixel is becoming less than 8. Computing bytes per pixel by
BitsPerPixel(format) / 8, might give different values. So compute the
bits per row first and divide it by 8 to get the bytes per row.
2. Move resource size computation functions to separate file,
i.e. resource_util.cc.
3. Move resource format related functions to resource_format.h. As
there is dependecy on third_party/khronos/GLES2/gl2.h &
third_party/khronos/GLES2/gl2ext.h, the inlined functions have been
written as non-inlined functions and header files have been included
in resource_format.cc.
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1202843008
Cr-Commit-Position: refs/heads/master@{#341492}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index e421db1..92e5917d 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -394,6 +394,7 @@
"resources/resource_pool.h",
"resources/resource_provider.cc",
"resources/resource_provider.h",
+ "resources/resource_util.h",
"resources/returned_resource.h",
"resources/scoped_resource.cc",
"resources/scoped_resource.h",
@@ -798,6 +799,7 @@
"resources/platform_color_unittest.cc",
"resources/resource_pool_unittest.cc",
"resources/resource_provider_unittest.cc",
+ "resources/resource_util_unittest.cc",
"resources/scoped_resource_unittest.cc",
"resources/video_resource_updater_unittest.cc",
"scheduler/begin_frame_source_unittest.cc",