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

Unified Diff: cc/resources/resource_provider.h

Issue 27973002: cc: Adding ETC1 support to UIResourceBitmap and ResourceProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: latest comments 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
« no previous file with comments | « cc/resources/resource_format.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index 3b9e8e0228955fdaaddaa7f87adee52f9b12cc7f..23f1414fa0d6d921c23ca2b4555e00f0296f12fb 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -482,6 +482,7 @@ class CC_EXPORT ResourceProvider {
bool use_texture_storage_ext_;
bool use_texture_usage_hint_;
bool use_shallow_flush_;
+ bool use_compressed_texture_etc1_;
scoped_ptr<TextureUploader> texture_uploader_;
int max_texture_size_;
ResourceFormat best_texture_format_;
@@ -497,16 +498,17 @@ class CC_EXPORT ResourceProvider {
// TODO(epenner): Move these format conversions to resource_format.h
// once that builds on mac (npapi.h currently #includes OpenGL.h).
-inline unsigned BytesPerPixel(ResourceFormat format) {
+inline unsigned BitsPerPixel(ResourceFormat format) {
DCHECK_LE(format, RESOURCE_FORMAT_MAX);
- static const unsigned format_bytes_per_pixel[RESOURCE_FORMAT_MAX + 1] = {
- 4, // RGBA_8888
- 2, // RGBA_4444
- 4, // BGRA_8888
- 1, // LUMINANCE_8
- 2 // RGB_565
+ static const unsigned format_bits_per_pixel[RESOURCE_FORMAT_MAX + 1] = {
+ 32, // RGBA_8888
+ 16, // RGBA_4444
+ 32, // BGRA_8888
+ 8, // LUMINANCE_8
+ 16, // RGB_565,
+ 4 // ETC1
};
- return format_bytes_per_pixel[format];
+ return format_bits_per_pixel[format];
}
inline GLenum GLDataType(ResourceFormat format) {
@@ -516,7 +518,8 @@ inline GLenum GLDataType(ResourceFormat format) {
GL_UNSIGNED_SHORT_4_4_4_4, // RGBA_4444
GL_UNSIGNED_BYTE, // BGRA_8888
GL_UNSIGNED_BYTE, // LUMINANCE_8
- GL_UNSIGNED_SHORT_5_6_5 // RGB_565
+ GL_UNSIGNED_SHORT_5_6_5, // RGB_565,
+ GL_UNSIGNED_BYTE // ETC1
};
return format_gl_data_type[format];
}
@@ -524,11 +527,12 @@ inline GLenum GLDataType(ResourceFormat format) {
inline GLenum GLDataFormat(ResourceFormat format) {
DCHECK_LE(format, RESOURCE_FORMAT_MAX);
static const unsigned format_gl_data_format[RESOURCE_FORMAT_MAX + 1] = {
- GL_RGBA, // RGBA_8888
- GL_RGBA, // RGBA_4444
- GL_BGRA_EXT, // BGRA_8888
- GL_LUMINANCE, // LUMINANCE_8
- GL_RGB // RGB_565
+ GL_RGBA, // RGBA_8888
+ GL_RGBA, // RGBA_4444
+ GL_BGRA_EXT, // BGRA_8888
+ GL_LUMINANCE, // LUMINANCE_8
+ GL_RGB, // RGB_565
+ GL_ETC1_RGB8_OES // ETC1
};
return format_gl_data_format[format];
}
« no previous file with comments | « cc/resources/resource_format.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698