| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 | 370 |
| 371 EGLConfig NativeViewGLSurfaceEGL::GetConfig() { | 371 EGLConfig NativeViewGLSurfaceEGL::GetConfig() { |
| 372 #if !defined(USE_X11) | 372 #if !defined(USE_X11) |
| 373 return g_config; | 373 return g_config; |
| 374 #else | 374 #else |
| 375 if (!config_) { | 375 if (!config_) { |
| 376 // Get a config compatible with the window | 376 // Get a config compatible with the window |
| 377 DCHECK(window_); | 377 DCHECK(window_); |
| 378 XWindowAttributes win_attribs; | 378 XWindowAttributes win_attribs; |
| 379 if (!XGetWindowAttributes(GetNativeDisplay(), window_, &win_attribs)) { | 379 if (!XGetWindowAttributes(EGLNativeDisplayToXDisplay(GetNativeDisplay()), |
| 380 window_, &win_attribs)) { |
| 380 return NULL; | 381 return NULL; |
| 381 } | 382 } |
| 382 | 383 |
| 383 // Try matching the window depth with an alpha channel, | 384 // Try matching the window depth with an alpha channel, |
| 384 // because we're worried the destination alpha width could | 385 // because we're worried the destination alpha width could |
| 385 // constrain blending precision. | 386 // constrain blending precision. |
| 386 const int kBufferSizeOffset = 1; | 387 const int kBufferSizeOffset = 1; |
| 387 const int kAlphaSizeOffset = 3; | 388 const int kAlphaSizeOffset = 3; |
| 388 EGLint config_attribs[] = { | 389 EGLint config_attribs[] = { |
| 389 EGL_BUFFER_SIZE, ~0, | 390 EGL_BUFFER_SIZE, ~0, |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 } | 739 } |
| 739 | 740 |
| 740 void* SurfacelessEGL::GetShareHandle() { | 741 void* SurfacelessEGL::GetShareHandle() { |
| 741 return NULL; | 742 return NULL; |
| 742 } | 743 } |
| 743 | 744 |
| 744 SurfacelessEGL::~SurfacelessEGL() { | 745 SurfacelessEGL::~SurfacelessEGL() { |
| 745 } | 746 } |
| 746 | 747 |
| 747 } // namespace gfx | 748 } // namespace gfx |
| OLD | NEW |