Index: cc/resources/resource_format.cc |
diff --git a/cc/resources/resource_format.cc b/cc/resources/resource_format.cc |
index ce9fe7d93af86d8c511efae63886b1f9df7316aa..c62ae934d728f5d749514164f5da80fc9094c4bd 100644 |
--- a/cc/resources/resource_format.cc |
+++ b/cc/resources/resource_format.cc |
@@ -87,4 +87,23 @@ GLenum GLInternalFormat(ResourceFormat format) { |
return GLDataFormat(format); |
} |
+gfx::BufferFormat BufferFormat(ResourceFormat format) { |
+ switch (format) { |
+ case RGBA_8888: |
+ return gfx::BufferFormat::RGBA_8888; |
+ case BGRA_8888: |
+ return gfx::BufferFormat::BGRA_8888; |
+ case RGBA_4444: |
+ return gfx::BufferFormat::RGBA_4444; |
+ case ALPHA_8: |
+ case LUMINANCE_8: |
+ case RGB_565: |
+ case ETC1: |
+ case RED_8: |
+ break; |
+ } |
+ NOTREACHED(); |
+ return gfx::BufferFormat::RGBA_8888; |
+} |
+ |
} // namespace cc |