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

Unified Diff: cc/resources/platform_color.h

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/platform_color.h
diff --git a/cc/resources/platform_color.h b/cc/resources/platform_color.h
index bd27d82d7128c6667c1079511f6c378acbac5eb2..d3e042056c670b95fe23c4707372e0aef21e7182 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_provider.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,28 @@ class PlatformColor {
}
// Returns the most efficient texture format for this platform.
- static GLenum BestTextureFormat(bool supports_bgra8888) {
+ static ResourceProvider::TextureFormat BestTextureFormat(
+ bool supports_bgra8888) {
switch (Format()) {
case SOURCE_FORMAT_BGRA8:
- if (supports_bgra8888)
- return GL_BGRA_EXT;
- return GL_RGBA;
+ return (supports_bgra8888) ?
+ ResourceProvider::BGRA_8888 : ResourceProvider::RGBA_8888;
case SOURCE_FORMAT_RGBA8:
- return GL_RGBA;
+ return ResourceProvider::RGBA_8888;
}
NOTREACHED();
- return GL_RGBA;
+ return ResourceProvider::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(ResourceProvider::TextureFormat format) {
switch (Format()) {
case SOURCE_FORMAT_RGBA8:
- return texture_format == GL_RGBA;
+ return format == ResourceProvider::RGBA_8888 ||
+ format == ResourceProvider::RGBA_4444;
case SOURCE_FORMAT_BGRA8:
- return texture_format == GL_BGRA_EXT;
+ return format == ResourceProvider::BGRA_8888;
}
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698