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

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

Issue 1168993002: Update the native_viewport interface to allow specification of the surface configuration, currently… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Requested fixes and a few other minor corrections Created 5 years, 6 months 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
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 extern "C" { 5 extern "C" {
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 } 7 }
8 8
9 #include "ui/gl/gl_surface_glx.h" 9 #include "ui/gl/gl_surface_glx.h"
10 10
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 310
311 SGIVideoSyncThread* SGIVideoSyncThread::g_video_sync_thread = NULL; 311 SGIVideoSyncThread* SGIVideoSyncThread::g_video_sync_thread = NULL;
312 312
313 // In order to take advantage of GLX_SGI_video_sync, we need a display 313 // In order to take advantage of GLX_SGI_video_sync, we need a display
314 // for use on a separate thread. We must allocate this before the sandbox 314 // for use on a separate thread. We must allocate this before the sandbox
315 // goes up (rather than on-demand when we start the thread). 315 // goes up (rather than on-demand when we start the thread).
316 Display* SGIVideoSyncProviderThreadShim::display_ = NULL; 316 Display* SGIVideoSyncProviderThreadShim::display_ = NULL;
317 317
318 } // namespace 318 } // namespace
319 319
320 GLSurfaceGLX::GLSurfaceGLX() {} 320 GLSurfaceGLX::GLSurfaceGLX(
321 const gfx::SurfaceConfiguration requested_configuration)
322 : GLSurface(requested_configuration) {
323 }
321 324
322 bool GLSurfaceGLX::InitializeOneOff() { 325 bool GLSurfaceGLX::InitializeOneOff() {
323 static bool initialized = false; 326 static bool initialized = false;
324 if (initialized) 327 if (initialized)
325 return true; 328 return true;
326 329
327 // http://crbug.com/245466 330 // http://crbug.com/245466
328 setenv("force_s3tc_enable", "true", 1); 331 setenv("force_s3tc_enable", "true", 1);
329 332
330 // SGIVideoSyncProviderShim (if instantiated) will issue X commands on 333 // SGIVideoSyncProviderShim (if instantiated) will issue X commands on
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 // attempting to use GLX_ARB_create_context_robustness, in which 525 // attempting to use GLX_ARB_create_context_robustness, in which
523 // case we need a GLXFBConfig for the window in order to create a 526 // case we need a GLXFBConfig for the window in order to create a
524 // context for it. 527 // context for it.
525 // 528 //
526 // TODO(kbr): this is not a reliable code path. On platforms which 529 // TODO(kbr): this is not a reliable code path. On platforms which
527 // support it, we should use glXChooseFBConfig in the browser 530 // support it, we should use glXChooseFBConfig in the browser
528 // process to choose the FBConfig and from there the X Visual to 531 // process to choose the FBConfig and from there the X Visual to
529 // use when creating the window in the first place. Then we can 532 // use when creating the window in the first place. Then we can
530 // pass that FBConfig down rather than attempting to reconstitute 533 // pass that FBConfig down rather than attempting to reconstitute
531 // it. 534 // it.
535 //
536 // TODO(iansf): Perhaps instead of kbr's suggestion above, we can
537 // now use GLSurface::GetSurfaceConfiguration to use the returned
538 // gfx::SurfaceConfiguration with glXChooseFBConfig in a manner
539 // similar to that used in NativeViewGLSurfaceEGL::GetConfig.
532 540
533 XWindowAttributes attributes; 541 XWindowAttributes attributes;
534 if (!XGetWindowAttributes( 542 if (!XGetWindowAttributes(
535 g_display, 543 g_display,
536 window_, 544 window_,
537 &attributes)) { 545 &attributes)) {
538 LOG(ERROR) << "XGetWindowAttributes failed for window " << 546 LOG(ERROR) << "XGetWindowAttributes failed for window " <<
539 window_ << "."; 547 window_ << ".";
540 return NULL; 548 return NULL;
541 } 549 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 682
675 void* PbufferGLSurfaceGLX::GetConfig() { 683 void* PbufferGLSurfaceGLX::GetConfig() {
676 return config_; 684 return config_;
677 } 685 }
678 686
679 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { 687 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() {
680 Destroy(); 688 Destroy();
681 } 689 }
682 690
683 } // namespace gfx 691 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698