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

Unified Diff: cc/resources/resource.cc

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: deprecate GLenum format throughout cc Created 7 years, 3 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 192eaebddc6d0c09fbf35619c8605f3144dff4ac..e1a156652529a06dfc1ece9b0732ab218269f57b 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,9 @@ 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, ResourceProvider::TextureFormat 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

Powered by Google App Engine
This is Rietveld 408576698