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

Unified Diff: cc/resources/resource.cc

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.cc
diff --git a/cc/resources/resource.cc b/cc/resources/resource.cc
index 9bbcd4f498b96628507ce6da25eed352b932f009..43ab60661ca2f09a2704760b8364631c068afe0b 100644
--- a/cc/resources/resource.cc
+++ b/cc/resources/resource.cc
@@ -13,5 +13,11 @@ size_t Resource::bytes() const {
return MemorySizeBytes(size_, format_);
}
+size_t Resource::ETC1SizeInBytes(gfx::Size size) {
+ size_t block_size = 64;
kaanb 2013/10/18 16:54:49 const size_t kBlockSize = 64; as this is a compil
powei 2013/10/23 05:36:15 Done.
+ size_t compressed_width = size.width() / 4 + (size.width() % 4 ? 1 : 0);
aelias_OOO_until_Jul13 2013/10/18 01:59:24 Could we just DCHECK that the resource size is div
powei 2013/10/23 05:36:15 Done.
+ size_t compressed_height = size.height() / 4 + (size.height() % 4 ? 1 : 0);
+ return block_size * compressed_width * compressed_height;
+}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698