Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Unified Diff: cc/resources/resource.h

Issue 27973002: cc: Adding ETC1 support to UIResourceBitmap and ResourceProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698