diff options
Diffstat (limited to 'cc/resources/resource.cc')
-rw-r--r-- | cc/resources/resource.cc | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/cc/resources/resource.cc b/cc/resources/resource.cc index 192eaeb..c97db7f 100644 --- a/cc/resources/resource.cc +++ b/cc/resources/resource.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "cc/resources/resource.h" -#include "third_party/khronos/GLES2/gl2ext.h" namespace cc { @@ -14,26 +13,8 @@ size_t Resource::bytes() const { return MemorySizeBytes(size_, format_); } -size_t Resource::BytesPerPixel(GLenum format) { - size_t components_per_pixel = 0; - size_t bytes_per_component = 1; - switch (format) { - case GL_RGBA: - case GL_BGRA_EXT: - components_per_pixel = 4; - break; - case GL_LUMINANCE: - components_per_pixel = 1; - break; - default: - NOTREACHED(); - } - return components_per_pixel * bytes_per_component; +size_t Resource::MemorySizeBytes(gfx::Size size, ResourceFormat format) { + return ResourceProvider::BytesPerPixel(format) * size.width() * size.height(); } -size_t Resource::MemorySizeBytes(gfx::Size size, GLenum format) { - return BytesPerPixel(format) * size.width() * size.height(); -} - - } // namespace cc |