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

Side by Side Diff: ui/gl/gl_image_io_surface.mm

Issue 2689453002: Introduce gfx::BufferFormat::YUYV_422
Patch Set: rebase to ToT Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/mojo/buffer_types_struct_traits.h ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_image_io_surface.h" 5 #include "ui/gl/gl_image_io_surface.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/mac/bind_objc_block.h" 10 #include "base/mac/bind_objc_block.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 case gfx::BufferFormat::RG_88: 57 case gfx::BufferFormat::RG_88:
58 case gfx::BufferFormat::ATC: 58 case gfx::BufferFormat::ATC:
59 case gfx::BufferFormat::ATCIA: 59 case gfx::BufferFormat::ATCIA:
60 case gfx::BufferFormat::DXT1: 60 case gfx::BufferFormat::DXT1:
61 case gfx::BufferFormat::DXT5: 61 case gfx::BufferFormat::DXT5:
62 case gfx::BufferFormat::ETC1: 62 case gfx::BufferFormat::ETC1:
63 case gfx::BufferFormat::BGR_565: 63 case gfx::BufferFormat::BGR_565:
64 case gfx::BufferFormat::RGBA_4444: 64 case gfx::BufferFormat::RGBA_4444:
65 case gfx::BufferFormat::RGBX_8888: 65 case gfx::BufferFormat::RGBX_8888:
66 case gfx::BufferFormat::YVU_420: 66 case gfx::BufferFormat::YVU_420:
67 case gfx::BufferFormat::YUYV_422:
67 return false; 68 return false;
68 } 69 }
69 70
70 NOTREACHED(); 71 NOTREACHED();
71 return false; 72 return false;
72 } 73 }
73 74
74 GLenum TextureFormat(gfx::BufferFormat format) { 75 GLenum TextureFormat(gfx::BufferFormat format) {
75 switch (format) { 76 switch (format) {
76 case gfx::BufferFormat::R_8: 77 case gfx::BufferFormat::R_8:
(...skipping 11 matching lines...) Expand all
88 return GL_RGB_YCBCR_420V_CHROMIUM; 89 return GL_RGB_YCBCR_420V_CHROMIUM;
89 case gfx::BufferFormat::ATC: 90 case gfx::BufferFormat::ATC:
90 case gfx::BufferFormat::ATCIA: 91 case gfx::BufferFormat::ATCIA:
91 case gfx::BufferFormat::DXT1: 92 case gfx::BufferFormat::DXT1:
92 case gfx::BufferFormat::DXT5: 93 case gfx::BufferFormat::DXT5:
93 case gfx::BufferFormat::ETC1: 94 case gfx::BufferFormat::ETC1:
94 case gfx::BufferFormat::BGR_565: 95 case gfx::BufferFormat::BGR_565:
95 case gfx::BufferFormat::RGBA_4444: 96 case gfx::BufferFormat::RGBA_4444:
96 case gfx::BufferFormat::RGBX_8888: 97 case gfx::BufferFormat::RGBX_8888:
97 case gfx::BufferFormat::YVU_420: 98 case gfx::BufferFormat::YVU_420:
99 case gfx::BufferFormat::YUYV_422:
98 NOTREACHED(); 100 NOTREACHED();
99 return 0; 101 return 0;
100 } 102 }
101 103
102 NOTREACHED(); 104 NOTREACHED();
103 return 0; 105 return 0;
104 } 106 }
105 107
106 GLenum DataFormat(gfx::BufferFormat format) { 108 GLenum DataFormat(gfx::BufferFormat format) {
107 switch (format) { 109 switch (format) {
(...skipping 12 matching lines...) Expand all
120 case gfx::BufferFormat::ATC: 122 case gfx::BufferFormat::ATC:
121 case gfx::BufferFormat::ATCIA: 123 case gfx::BufferFormat::ATCIA:
122 case gfx::BufferFormat::DXT1: 124 case gfx::BufferFormat::DXT1:
123 case gfx::BufferFormat::DXT5: 125 case gfx::BufferFormat::DXT5:
124 case gfx::BufferFormat::ETC1: 126 case gfx::BufferFormat::ETC1:
125 case gfx::BufferFormat::BGR_565: 127 case gfx::BufferFormat::BGR_565:
126 case gfx::BufferFormat::RGBA_4444: 128 case gfx::BufferFormat::RGBA_4444:
127 case gfx::BufferFormat::RGBX_8888: 129 case gfx::BufferFormat::RGBX_8888:
128 case gfx::BufferFormat::YVU_420: 130 case gfx::BufferFormat::YVU_420:
129 case gfx::BufferFormat::YUV_420_BIPLANAR: 131 case gfx::BufferFormat::YUV_420_BIPLANAR:
132 case gfx::BufferFormat::YUYV_422:
130 NOTREACHED(); 133 NOTREACHED();
131 return 0; 134 return 0;
132 } 135 }
133 136
134 NOTREACHED(); 137 NOTREACHED();
135 return 0; 138 return 0;
136 } 139 }
137 140
138 GLenum DataType(gfx::BufferFormat format) { 141 GLenum DataType(gfx::BufferFormat format) {
139 switch (format) { 142 switch (format) {
(...skipping 12 matching lines...) Expand all
152 case gfx::BufferFormat::ATC: 155 case gfx::BufferFormat::ATC:
153 case gfx::BufferFormat::ATCIA: 156 case gfx::BufferFormat::ATCIA:
154 case gfx::BufferFormat::DXT1: 157 case gfx::BufferFormat::DXT1:
155 case gfx::BufferFormat::DXT5: 158 case gfx::BufferFormat::DXT5:
156 case gfx::BufferFormat::ETC1: 159 case gfx::BufferFormat::ETC1:
157 case gfx::BufferFormat::BGR_565: 160 case gfx::BufferFormat::BGR_565:
158 case gfx::BufferFormat::RGBA_4444: 161 case gfx::BufferFormat::RGBA_4444:
159 case gfx::BufferFormat::RGBX_8888: 162 case gfx::BufferFormat::RGBX_8888:
160 case gfx::BufferFormat::YVU_420: 163 case gfx::BufferFormat::YVU_420:
161 case gfx::BufferFormat::YUV_420_BIPLANAR: 164 case gfx::BufferFormat::YUV_420_BIPLANAR:
165 case gfx::BufferFormat::YUYV_422:
162 NOTREACHED(); 166 NOTREACHED();
163 return 0; 167 return 0;
164 } 168 }
165 169
166 NOTREACHED(); 170 NOTREACHED();
167 return 0; 171 return 0;
168 } 172 }
169 173
170 // When an IOSurface is bound to a texture with internalformat "GL_RGB", many 174 // When an IOSurface is bound to a texture with internalformat "GL_RGB", many
171 // OpenGL operations are broken. Therefore, don't allow an IOSurface to be bound 175 // OpenGL operations are broken. Therefore, don't allow an IOSurface to be bound
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 421 }
418 422
419 // static 423 // static
420 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) { 424 GLImageIOSurface* GLImageIOSurface::FromGLImage(GLImage* image) {
421 if (!image || image->GetType() != Type::IOSURFACE) 425 if (!image || image->GetType() != Type::IOSURFACE)
422 return nullptr; 426 return nullptr;
423 return static_cast<GLImageIOSurface*>(image); 427 return static_cast<GLImageIOSurface*>(image);
424 } 428 }
425 429
426 } // namespace gl 430 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gfx/mojo/buffer_types_struct_traits.h ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698