OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_surface_egl.h" | 5 #include "ui/gl/gl_surface_egl.h" |
6 | 6 |
7 #if defined(OS_ANDROID) | 7 #if defined(OS_ANDROID) |
8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 EGL_GREEN_SIZE, 8, | 163 EGL_GREEN_SIZE, 8, |
164 EGL_RED_SIZE, 8, | 164 EGL_RED_SIZE, 8, |
165 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, | 165 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, |
166 EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, | 166 EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, |
167 EGL_NONE | 167 EGL_NONE |
168 }; | 168 }; |
169 | 169 |
170 #if defined(USE_OZONE) | 170 #if defined(USE_OZONE) |
171 const EGLint* config_attribs = | 171 const EGLint* config_attribs = |
172 ui::SurfaceFactoryOzone::GetInstance()->GetEGLSurfaceProperties( | 172 ui::SurfaceFactoryOzone::GetInstance()->GetEGLSurfaceProperties( |
173 kConfigAttribs); | 173 kConfigAttribs, nullptr); |
174 #else | 174 #else |
175 const EGLint* config_attribs = kConfigAttribs; | 175 const EGLint* config_attribs = kConfigAttribs; |
176 #endif | 176 #endif |
177 | 177 |
178 EGLint num_configs; | 178 EGLint num_configs; |
179 if (!eglChooseConfig(g_display, | 179 if (!eglChooseConfig(g_display, |
180 config_attribs, | 180 config_attribs, |
181 NULL, | 181 NULL, |
182 0, | 182 0, |
183 &num_configs)) { | 183 &num_configs)) { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, native_display, | 331 return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, native_display, |
332 kDisplayAttribsWarp); | 332 kDisplayAttribsWarp); |
333 } | 333 } |
334 | 334 |
335 return eglGetDisplay(native_display); | 335 return eglGetDisplay(native_display); |
336 } | 336 } |
337 #endif | 337 #endif |
338 | 338 |
339 NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(EGLNativeWindowType window) | 339 NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(EGLNativeWindowType window) |
340 : window_(window), | 340 : window_(window), |
| 341 config_(NULL), |
341 surface_(NULL), | 342 surface_(NULL), |
342 supports_post_sub_buffer_(false), | 343 supports_post_sub_buffer_(false), |
343 config_(NULL), | |
344 size_(1, 1) { | 344 size_(1, 1) { |
345 #if defined(OS_ANDROID) | 345 #if defined(OS_ANDROID) |
346 if (window) | 346 if (window) |
347 ANativeWindow_acquire(window); | 347 ANativeWindow_acquire(window); |
348 #endif | 348 #endif |
349 | 349 |
350 #if defined(OS_WIN) | 350 #if defined(OS_WIN) |
351 RECT windowRect; | 351 RECT windowRect; |
352 if (GetClientRect(window_, &windowRect)) | 352 if (GetClientRect(window_, &windowRect)) |
353 size_ = gfx::Rect(windowRect).size(); | 353 size_ = gfx::Rect(windowRect).size(); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 } | 760 } |
761 | 761 |
762 void* SurfacelessEGL::GetShareHandle() { | 762 void* SurfacelessEGL::GetShareHandle() { |
763 return NULL; | 763 return NULL; |
764 } | 764 } |
765 | 765 |
766 SurfacelessEGL::~SurfacelessEGL() { | 766 SurfacelessEGL::~SurfacelessEGL() { |
767 } | 767 } |
768 | 768 |
769 } // namespace gfx | 769 } // namespace gfx |
OLD | NEW |