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

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: fixed a signed vs. unsigned comparison in video_resource_updater.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
« no previous file with comments | « cc/resources/pixel_buffer_raster_worker_pool.cc ('k') | cc/resources/prioritized_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « cc/resources/pixel_buffer_raster_worker_pool.cc ('k') | cc/resources/prioritized_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698