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

Unified Diff: ui/gl/gl_image_io_surface.mm

Issue 1708263002: gpu: Expose internal format R8 instead of RED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to 'Address reveman's comments'. Created 4 years, 10 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 | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_io_surface.mm
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
index 3059333cc8896feb96c15f2b4147e3e927a3f417..536ce6c92b30d1331d012bebb380783a4940c0a6 100644
--- a/ui/gl/gl_image_io_surface.mm
+++ b/ui/gl/gl_image_io_surface.mm
@@ -16,6 +16,7 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_helper.h"
+#include "ui/gl/gl_version_info.h"
#include "ui/gl/scoped_binders.h"
// Note that this must be included after gl_bindings.h to avoid conflicts.
@@ -68,7 +69,7 @@ STRINGIZE(
bool ValidInternalFormat(unsigned internalformat) {
switch (internalformat) {
- case GL_RED:
+ case GL_R8:
case GL_BGRA_EXT:
case GL_RGB:
case GL_RGB_YCBCR_420V_CHROMIUM:
@@ -107,7 +108,9 @@ bool ValidFormat(BufferFormat format) {
GLenum TextureFormat(BufferFormat format) {
switch (format) {
case BufferFormat::R_8:
- return GL_RED;
+ return gfx::GLContext::GetCurrent()->GetVersionInfo()->IsES3Capable()
+ ? GL_R8
+ : GL_RED;
case BufferFormat::BGRA_8888:
case BufferFormat::RGBA_8888:
return GL_RGBA;
« no previous file with comments | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698