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

Unified Diff: cc/resources/resource_format.cc

Issue 1434453008: cc: Fix R_8 GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/resource_format.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_format.cc
diff --git a/cc/resources/resource_format.cc b/cc/resources/resource_format.cc
index c62ae934d728f5d749514164f5da80fc9094c4bd..84dce657bd1330b6af0f0092b940677adaf858dc 100644
--- a/cc/resources/resource_format.cc
+++ b/cc/resources/resource_format.cc
@@ -4,8 +4,7 @@
#include "cc/resources/resource_format.h"
-#include "third_party/khronos/GLES2/gl2.h"
-#include "third_party/khronos/GLES2/gl2ext.h"
+#include "ui/gl/gl_bindings.h"
namespace cc {
@@ -87,19 +86,26 @@ GLenum GLInternalFormat(ResourceFormat format) {
return GLDataFormat(format);
}
+GLenum GLImageFormat(ResourceFormat format) {
+ if (format == RED_8)
+ return GL_R8_EXT;
reveman 2015/11/05 13:46:01 Can we have normal textures use GL_R8_EXT as well?
ccameron 2015/11/05 19:09:20 That was the first thing that I tried, but GL_R8_E
+ return GLInternalFormat(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 RED_8:
+ return gfx::BufferFormat::R_8;
case RGBA_4444:
return gfx::BufferFormat::RGBA_4444;
+ case RGBA_8888:
+ return gfx::BufferFormat::RGBA_8888;
case ALPHA_8:
case LUMINANCE_8:
case RGB_565:
case ETC1:
- case RED_8:
break;
}
NOTREACHED();
« no previous file with comments | « cc/resources/resource_format.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698