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

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

Issue 1282313002: Add YUV_420_BIPLANAR to gfx::BufferFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmb-planes
Patch Set: Fixes for reveman Created 5 years, 4 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
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/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 27 matching lines...) Expand all
38 return true; 38 return true;
39 case BufferFormat::ATC: 39 case BufferFormat::ATC:
40 case BufferFormat::ATCIA: 40 case BufferFormat::ATCIA:
41 case BufferFormat::DXT1: 41 case BufferFormat::DXT1:
42 case BufferFormat::DXT5: 42 case BufferFormat::DXT5:
43 case BufferFormat::ETC1: 43 case BufferFormat::ETC1:
44 case BufferFormat::RGBA_4444: 44 case BufferFormat::RGBA_4444:
45 case BufferFormat::RGBA_8888: 45 case BufferFormat::RGBA_8888:
46 case BufferFormat::RGBX_8888: 46 case BufferFormat::RGBX_8888:
47 case BufferFormat::YUV_420: 47 case BufferFormat::YUV_420:
48 case BufferFormat::YUV_420_BIPLANAR:
48 return false; 49 return false;
49 } 50 }
50 51
51 NOTREACHED(); 52 NOTREACHED();
52 return false; 53 return false;
53 } 54 }
54 55
55 GLenum TextureFormat(BufferFormat format) { 56 GLenum TextureFormat(BufferFormat format) {
56 switch (format) { 57 switch (format) {
57 case BufferFormat::R_8: 58 case BufferFormat::R_8:
59 case BufferFormat::YUV_420_BIPLANAR:
reveman 2015/08/11 08:20:08 nit: move below ::YUV_420 as this it not yet valid
Andre 2015/08/11 18:15:44 Done.
58 return GL_RED; 60 return GL_RED;
59 case BufferFormat::BGRA_8888: 61 case BufferFormat::BGRA_8888:
60 return GL_RGBA; 62 return GL_RGBA;
61 case BufferFormat::ATC: 63 case BufferFormat::ATC:
62 case BufferFormat::ATCIA: 64 case BufferFormat::ATCIA:
63 case BufferFormat::DXT1: 65 case BufferFormat::DXT1:
64 case BufferFormat::DXT5: 66 case BufferFormat::DXT5:
65 case BufferFormat::ETC1: 67 case BufferFormat::ETC1:
66 case BufferFormat::RGBA_4444: 68 case BufferFormat::RGBA_4444:
67 case BufferFormat::RGBA_8888: 69 case BufferFormat::RGBA_8888:
68 case BufferFormat::RGBX_8888: 70 case BufferFormat::RGBX_8888:
69 case BufferFormat::YUV_420: 71 case BufferFormat::YUV_420:
70 NOTREACHED(); 72 NOTREACHED();
71 return 0; 73 return 0;
72 } 74 }
73 75
74 NOTREACHED(); 76 NOTREACHED();
75 return 0; 77 return 0;
76 } 78 }
77 79
78 GLenum DataFormat(BufferFormat format) { 80 GLenum DataFormat(BufferFormat format) {
79 switch (format) { 81 switch (format) {
80 case BufferFormat::R_8: 82 case BufferFormat::R_8:
83 case BufferFormat::YUV_420_BIPLANAR:
reveman 2015/08/11 08:20:08 nit: move below ::YUV_420 as this it not yet valid
Andre 2015/08/11 18:15:44 Done.
81 return GL_RED; 84 return GL_RED;
82 case BufferFormat::BGRA_8888: 85 case BufferFormat::BGRA_8888:
83 return GL_BGRA; 86 return GL_BGRA;
84 case BufferFormat::ATC: 87 case BufferFormat::ATC:
85 case BufferFormat::ATCIA: 88 case BufferFormat::ATCIA:
86 case BufferFormat::DXT1: 89 case BufferFormat::DXT1:
87 case BufferFormat::DXT5: 90 case BufferFormat::DXT5:
88 case BufferFormat::ETC1: 91 case BufferFormat::ETC1:
89 case BufferFormat::RGBA_4444: 92 case BufferFormat::RGBA_4444:
90 case BufferFormat::RGBA_8888: 93 case BufferFormat::RGBA_8888:
91 case BufferFormat::RGBX_8888: 94 case BufferFormat::RGBX_8888:
92 case BufferFormat::YUV_420: 95 case BufferFormat::YUV_420:
93 NOTREACHED(); 96 NOTREACHED();
94 return 0; 97 return 0;
95 } 98 }
96 99
97 NOTREACHED(); 100 NOTREACHED();
98 return 0; 101 return 0;
99 } 102 }
100 103
101 GLenum DataType(BufferFormat format) { 104 GLenum DataType(BufferFormat format) {
102 switch (format) { 105 switch (format) {
103 case BufferFormat::R_8: 106 case BufferFormat::R_8:
107 case BufferFormat::YUV_420_BIPLANAR:
reveman 2015/08/11 08:20:08 nit: move below ::YUV_420 as this it not yet valid
Andre 2015/08/11 18:15:44 Done.
104 return GL_UNSIGNED_BYTE; 108 return GL_UNSIGNED_BYTE;
105 case BufferFormat::BGRA_8888: 109 case BufferFormat::BGRA_8888:
106 return GL_UNSIGNED_INT_8_8_8_8_REV; 110 return GL_UNSIGNED_INT_8_8_8_8_REV;
107 case BufferFormat::ATC: 111 case BufferFormat::ATC:
108 case BufferFormat::ATCIA: 112 case BufferFormat::ATCIA:
109 case BufferFormat::DXT1: 113 case BufferFormat::DXT1:
110 case BufferFormat::DXT5: 114 case BufferFormat::DXT5:
111 case BufferFormat::ETC1: 115 case BufferFormat::ETC1:
112 case BufferFormat::RGBA_4444: 116 case BufferFormat::RGBA_4444:
113 case BufferFormat::RGBA_8888: 117 case BufferFormat::RGBA_8888:
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // static 214 // static
211 void GLImageIOSurface::SetLayerForWidget( 215 void GLImageIOSurface::SetLayerForWidget(
212 gfx::AcceleratedWidget widget, CALayer* layer) { 216 gfx::AcceleratedWidget widget, CALayer* layer) {
213 if (layer) 217 if (layer)
214 g_widget_to_layer_map.Pointer()->insert(std::make_pair(widget, layer)); 218 g_widget_to_layer_map.Pointer()->insert(std::make_pair(widget, layer));
215 else 219 else
216 g_widget_to_layer_map.Pointer()->erase(widget); 220 g_widget_to_layer_map.Pointer()->erase(widget);
217 } 221 }
218 222
219 } // namespace gfx 223 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698