Chromium Code Reviews| Index: cc/resources/resource_provider.h |
| diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h |
| index df178194d943f080060e5b1f3e4f7a6e2e17d451..59bab813c709cf4e08f4ce8dc83acb5bedada91e 100644 |
| --- a/cc/resources/resource_provider.h |
| +++ b/cc/resources/resource_provider.h |
| @@ -491,6 +491,7 @@ class CC_EXPORT ResourceProvider { |
| inline unsigned BytesPerPixel(ResourceFormat format) { |
|
aelias_OOO_until_Jul13
2013/10/18 01:59:24
Please rename this method to BitsPerPixel and mult
powei
2013/10/23 05:36:15
Done.
|
| DCHECK_LE(format, RESOURCE_FORMAT_MAX); |
| static const unsigned format_bytes_per_pixel[RESOURCE_FORMAT_MAX + 1] = { |
| + 0, // ETC1 |
| 4, // RGBA_8888 |
| 2, // RGBA_4444 |
| 4, // BGRA_8888 |
| @@ -503,6 +504,7 @@ inline unsigned BytesPerPixel(ResourceFormat format) { |
| inline GLenum GLDataType(ResourceFormat format) { |
| DCHECK_LE(format, RESOURCE_FORMAT_MAX); |
| static const unsigned format_gl_data_type[RESOURCE_FORMAT_MAX + 1] = { |
| + GL_UNSIGNED_BYTE, // ETC1 |
| GL_UNSIGNED_BYTE, // RGBA_8888 |
| GL_UNSIGNED_SHORT_4_4_4_4, // RGBA_4444 |
| GL_UNSIGNED_BYTE, // BGRA_8888 |
| @@ -515,11 +517,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_ETC1_RGB8_OES, // ETC1 |
|
kaanb
2013/10/18 16:54:49
Is this a GL data format or a GL internal format?
powei
2013/10/23 05:36:15
If I'm reading the spec correctly. We're suppose
|
| + GL_RGBA, // RGBA_8888 |
| + GL_RGBA, // RGBA_4444 |
| + GL_BGRA_EXT, // BGRA_8888 |
| + GL_LUMINANCE, // LUMINANCE_8 |
| + GL_RGB // RGB_565 |
| }; |
| return format_gl_data_format[format]; |
| } |