OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/gl/gl_surface_egl.h" | 5 #include "ui/gfx/gl/gl_surface_egl.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "third_party/angle/include/EGL/egl.h" | 10 #include "third_party/angle/include/EGL/egl.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 if (!eglInitialize(g_display, NULL, NULL)) { | 52 if (!eglInitialize(g_display, NULL, NULL)) { |
53 LOG(ERROR) << "eglInitialize failed with error " << GetLastEGLErrorString(); | 53 LOG(ERROR) << "eglInitialize failed with error " << GetLastEGLErrorString(); |
54 return false; | 54 return false; |
55 } | 55 } |
56 | 56 |
57 // Choose an EGL configuration. | 57 // Choose an EGL configuration. |
58 static const EGLint kConfigAttribs[] = { | 58 static const EGLint kConfigAttribs[] = { |
59 EGL_BUFFER_SIZE, 32, | 59 EGL_BUFFER_SIZE, 32, |
60 EGL_ALPHA_SIZE, 8, | 60 EGL_ALPHA_SIZE, 8, |
61 EGL_BLUE_SIZE, 8, | 61 EGL_BLUE_SIZE, 8, |
| 62 EGL_GREEN_SIZE, 8, |
62 EGL_RED_SIZE, 8, | 63 EGL_RED_SIZE, 8, |
63 EGL_DEPTH_SIZE, 16, | 64 EGL_DEPTH_SIZE, 16, |
64 EGL_STENCIL_SIZE, 8, | 65 EGL_STENCIL_SIZE, 8, |
65 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, | 66 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, |
66 EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, | 67 EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, |
67 EGL_NONE | 68 EGL_NONE |
68 }; | 69 }; |
69 | 70 |
70 EGLint num_configs; | 71 EGLint num_configs; |
71 if (!eglChooseConfig(g_display, | 72 if (!eglChooseConfig(g_display, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 231 |
231 gfx::Size PbufferGLSurfaceEGL::GetSize() { | 232 gfx::Size PbufferGLSurfaceEGL::GetSize() { |
232 return size_; | 233 return size_; |
233 } | 234 } |
234 | 235 |
235 EGLSurface PbufferGLSurfaceEGL::GetHandle() { | 236 EGLSurface PbufferGLSurfaceEGL::GetHandle() { |
236 return surface_; | 237 return surface_; |
237 } | 238 } |
238 | 239 |
239 } // namespace gfx | 240 } // namespace gfx |
OLD | NEW |