Index: cc/resources/platform_color.h |
diff --git a/cc/resources/platform_color.h b/cc/resources/platform_color.h |
index bd27d82d7128c6667c1079511f6c378acbac5eb2..ecdf7c166f2dfe080b28cfa4d0d566abd7645b9f 100644 |
--- a/cc/resources/platform_color.h |
+++ b/cc/resources/platform_color.h |
@@ -7,6 +7,7 @@ |
#include "base/basictypes.h" |
#include "base/logging.h" |
+#include "cc/resources/resource_format.h" |
#include "third_party/khronos/GLES2/gl2.h" |
#include "third_party/khronos/GLES2/gl2ext.h" |
#include "third_party/skia/include/core/SkTypes.h" |
@@ -25,27 +26,25 @@ class PlatformColor { |
} |
// Returns the most efficient texture format for this platform. |
- static GLenum BestTextureFormat(bool supports_bgra8888) { |
+ static ResourceFormat BestTextureFormat(bool supports_bgra8888) { |
switch (Format()) { |
case SOURCE_FORMAT_BGRA8: |
- if (supports_bgra8888) |
- return GL_BGRA_EXT; |
- return GL_RGBA; |
+ return (supports_bgra8888) ? BGRA_8888 : RGBA_8888; |
case SOURCE_FORMAT_RGBA8: |
- return GL_RGBA; |
+ return RGBA_8888; |
} |
NOTREACHED(); |
- return GL_RGBA; |
+ return RGBA_8888; |
} |
// Return true if the given texture format has the same component order |
// as the color on this platform. |
- static bool SameComponentOrder(GLenum texture_format) { |
+ static bool SameComponentOrder(ResourceFormat format) { |
switch (Format()) { |
case SOURCE_FORMAT_RGBA8: |
- return texture_format == GL_RGBA; |
+ return format == RGBA_8888 || format == RGBA_4444; |
case SOURCE_FORMAT_BGRA8: |
- return texture_format == GL_BGRA_EXT; |
+ return format == BGRA_8888; |
} |
NOTREACHED(); |
return false; |