Chromium Code Reviews| Index: cc/resources/resource.h |
| diff --git a/cc/resources/resource.h b/cc/resources/resource.h |
| index 2650a0c8b6f365e9a318ac3d4fc2e663a52f906a..e5ba095aabcb5b033886eccbef98b44e633e3fa7 100644 |
| --- a/cc/resources/resource.h |
| +++ b/cc/resources/resource.h |
| @@ -26,9 +26,16 @@ class CC_EXPORT Resource { |
| size_t bytes() const; |
| inline static size_t MemorySizeBytes(gfx::Size size, ResourceFormat format) { |
| - return BytesPerPixel(format) * size.width() * size.height(); |
| + if (format == ETC1) |
| + return ETC1SizeInBytes(size); |
| + else |
|
kaanb
2013/10/18 16:54:49
nit: else is redundant
powei
2013/10/23 05:36:15
Done.
|
| + return BytesPerPixel(format) * size.width() * size.height(); |
| } |
| + // Calculates the size of the raw data in bytes given width and height of the |
| + // compressed bitmap. |
| + static size_t ETC1SizeInBytes(gfx::Size size); |
| + |
| protected: |
| void set_id(ResourceProvider::ResourceId id) { id_ = id; } |
| void set_dimensions(gfx::Size size, ResourceFormat format) { |