OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
reveman
2014/11/04 21:14:44
This filed doesn't exist in ToT. Why did you have
| |
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 extern "C" { | 5 extern "C" { |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 } | 7 } |
8 | 8 |
9 #include "ui/gl/gl_image_glx.h" | 9 #include "ui/gl/gl_image_glx.h" |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "ui/gl/gl_bindings.h" | 13 #include "ui/gl/gl_bindings.h" |
14 #include "ui/gl/gl_surface_glx.h" | 14 #include "ui/gl/gl_surface_glx.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // scoped_ptr functor for XFree(). Use as follows: | 20 // scoped_ptr functor for XFree(). Use as follows: |
21 // scoped_ptr<XVisualInfo, ScopedPtrXFree> foo(...); | 21 // scoped_ptr<XVisualInfo, ScopedPtrXFree> foo(...); |
22 // where "XVisualInfo" is any X type that is freed with XFree. | 22 // where "XVisualInfo" is any X type that is freed with XFree. |
23 struct ScopedPtrXFree { | 23 struct ScopedPtrXFree { |
24 void operator()(void* x) const { ::XFree(x); } | 24 void operator()(void* x) const { ::XFree(x); } |
25 }; | 25 }; |
26 | 26 |
27 bool ValidFormat(unsigned internalformat) { | 27 bool ValidFormat(unsigned internalformat) { |
28 switch (internalformat) { | 28 switch (internalformat) { |
29 case GL_RGB: | |
30 return true; | |
29 case GL_RGBA: | 31 case GL_RGBA: |
30 return true; | 32 return true; |
31 default: | 33 default: |
32 return false; | 34 return false; |
33 } | 35 } |
34 } | 36 } |
35 | 37 |
36 int TextureFormat(unsigned internalformat) { | 38 int TextureFormat(unsigned internalformat) { |
37 switch (internalformat) { | 39 switch (internalformat) { |
40 case GL_RGB: | |
41 return GLX_BIND_TO_TEXTURE_RGB_EXT; | |
marcheu
2014/11/04 19:25:38
GLX_TEXTURE_FORMAT_RGB_EXT
llandwerlin-old
2014/11/05 10:17:35
Thanks, fixed.
| |
38 case GL_RGBA: | 42 case GL_RGBA: |
39 return GLX_TEXTURE_FORMAT_RGBA_EXT; | 43 return GLX_TEXTURE_FORMAT_RGBA_EXT; |
40 default: | 44 default: |
41 NOTREACHED(); | 45 NOTREACHED(); |
42 return 0; | 46 return 0; |
43 } | 47 } |
44 } | 48 } |
45 | 49 |
46 int BindToTextureFormat(unsigned internalformat) { | 50 int BindToTextureFormat(unsigned internalformat) { |
47 switch (internalformat) { | 51 switch (internalformat) { |
52 case GL_RGB: | |
53 return GLX_BIND_TO_TEXTURE_RGB_EXT; | |
48 case GL_RGBA: | 54 case GL_RGBA: |
49 return GLX_BIND_TO_TEXTURE_RGBA_EXT; | 55 return GLX_BIND_TO_TEXTURE_RGBA_EXT; |
50 default: | 56 default: |
51 NOTREACHED(); | 57 NOTREACHED(); |
52 return 0; | 58 return 0; |
53 } | 59 } |
54 } | 60 } |
55 | 61 |
56 unsigned PixmapDepth(unsigned internalformat) { | 62 unsigned PixmapDepth(unsigned internalformat) { |
57 switch (internalformat) { | 63 switch (internalformat) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 | 202 |
197 bool GLImageGLX::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 203 bool GLImageGLX::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
198 int z_order, | 204 int z_order, |
199 OverlayTransform transform, | 205 OverlayTransform transform, |
200 const Rect& bounds_rect, | 206 const Rect& bounds_rect, |
201 const RectF& crop_rect) { | 207 const RectF& crop_rect) { |
202 return false; | 208 return false; |
203 } | 209 } |
204 | 210 |
205 } // namespace gfx | 211 } // namespace gfx |
OLD | NEW |