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

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

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: Created 4 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
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_context_glx.h" 5 #include "ui/gl/gl_context_glx.h"
6 6
7 extern "C" { 7 extern "C" {
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 } 9 }
10 #include <memory> 10 #include <memory>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 GLContextGLX::GLContextGLX(GLShareGroup* share_group) 152 GLContextGLX::GLContextGLX(GLShareGroup* share_group)
153 : GLContextReal(share_group), 153 : GLContextReal(share_group),
154 context_(nullptr), 154 context_(nullptr),
155 display_(nullptr) { 155 display_(nullptr) {
156 } 156 }
157 157
158 XDisplay* GLContextGLX::display() { 158 XDisplay* GLContextGLX::display() {
159 return display_; 159 return display_;
160 } 160 }
161 161
162 bool GLContextGLX::Initialize( 162 bool GLContextGLX::Initialize(GLSurface* compatible_surface,
163 GLSurface* compatible_surface, GpuPreference gpu_preference) { 163 const GLContextAttribs& attribs) {
164 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay()); 164 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay());
165 165
166 GLXContext share_handle = static_cast<GLXContext>( 166 GLXContext share_handle = static_cast<GLXContext>(
167 share_group() ? share_group()->GetHandle() : nullptr); 167 share_group() ? share_group()->GetHandle() : nullptr);
168 168
169 if (GLSurfaceGLX::IsCreateContextSupported()) { 169 if (GLSurfaceGLX::IsCreateContextSupported()) {
170 DVLOG(1) << "GLX_ARB_create_context supported."; 170 DVLOG(1) << "GLX_ARB_create_context supported.";
171 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 171 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
172 switches::kCreateDefaultGLContext)) { 172 switches::kCreateDefaultGLContext)) {
173 context_ = CreateContextAttribs( 173 context_ = CreateContextAttribs(
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { 320 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() {
321 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); 321 return GLSurfaceGLX::IsCreateContextRobustnessSupported();
322 } 322 }
323 323
324 GLContextGLX::~GLContextGLX() { 324 GLContextGLX::~GLContextGLX() {
325 Destroy(); 325 Destroy();
326 } 326 }
327 327
328 } // namespace gl 328 } // namespace gl
OLDNEW
« ui/gl/gl_context_cgl.cc ('K') | « ui/gl/gl_context_glx.h ('k') | ui/gl/gl_context_osmesa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698