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

Side by Side Diff: ui/gfx/gl/gl_context_glx.cc

Issue 8233027: Support dynamic switching between integrated and discrete GPUs on Mac OS X. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_context_glx.h ('k') | ui/gfx/gl/gl_context_linux.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) 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 extern "C" { 5 extern "C" {
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 } 7 }
8 8
9 #include "ui/gfx/gl/gl_context_glx.h" 9 #include "ui/gfx/gl/gl_context_glx.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 GLContextGLX::GLContextGLX(GLShareGroup* share_group) 47 GLContextGLX::GLContextGLX(GLShareGroup* share_group)
48 : GLContext(share_group), 48 : GLContext(share_group),
49 context_(NULL) { 49 context_(NULL) {
50 } 50 }
51 51
52 GLContextGLX::~GLContextGLX() { 52 GLContextGLX::~GLContextGLX() {
53 Destroy(); 53 Destroy();
54 } 54 }
55 55
56 bool GLContextGLX::Initialize(GLSurface* compatible_surface) { 56 bool GLContextGLX::Initialize(
57 GLSurface* compatible_surface, GpuPreference gpu_preference) {
57 GLSurfaceGLX* surface_glx = static_cast<GLSurfaceGLX*>(compatible_surface); 58 GLSurfaceGLX* surface_glx = static_cast<GLSurfaceGLX*>(compatible_surface);
58 59
59 GLXContext share_handle = static_cast<GLXContext>( 60 GLXContext share_handle = static_cast<GLXContext>(
60 share_group() ? share_group()->GetHandle() : NULL); 61 share_group() ? share_group()->GetHandle() : NULL);
61 62
62 if (GLSurfaceGLX::IsCreateContextRobustnessSupported()) { 63 if (GLSurfaceGLX::IsCreateContextRobustnessSupported()) {
63 DLOG(INFO) << "GLX_ARB_create_context_robustness supported."; 64 DLOG(INFO) << "GLX_ARB_create_context_robustness supported.";
64 65
65 std::vector<int> attribs; 66 std::vector<int> attribs;
66 attribs.push_back(GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB); 67 attribs.push_back(GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 248 }
248 249
249 return GLContext::GetExtensions(); 250 return GLContext::GetExtensions();
250 } 251 }
251 252
252 bool GLContextGLX::WasAllocatedUsingARBRobustness() { 253 bool GLContextGLX::WasAllocatedUsingARBRobustness() {
253 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); 254 return GLSurfaceGLX::IsCreateContextRobustnessSupported();
254 } 255 }
255 256
256 } // namespace gfx 257 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context_glx.h ('k') | ui/gfx/gl/gl_context_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698