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

Side by Side Diff: ui/gl/gl_surface_egl.cc

Issue 702713003: Add casts for EGLNativeDisplayType to XDisplay to use X functions with OZONE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ::Display Created 6 years, 1 month 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
« no previous file with comments | « ui/gl/gl_bindings.h ('k') | ui/gl/gl_surface_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings.h ('k') | ui/gl/gl_surface_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698