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

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

Issue 2497503004: Revert of 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
« no previous file with comments | « ui/gl/gl_context_glx.h ('k') | ui/gl/gl_context_osmesa.h » ('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_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(GLSurface* compatible_surface, 162 bool GLContextGLX::Initialize(
163 const GLContextAttribs& attribs) { 163 GLSurface* compatible_surface, GpuPreference gpu_preference) {
164 // webgl_compatibility_context and disabling bind_generates_resource are not
165 // supported.
166 DCHECK(!attribs.webgl_compatibility_context &&
167 attribs.bind_generates_resource);
168
169 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay()); 164 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay());
170 165
171 GLXContext share_handle = static_cast<GLXContext>( 166 GLXContext share_handle = static_cast<GLXContext>(
172 share_group() ? share_group()->GetHandle() : nullptr); 167 share_group() ? share_group()->GetHandle() : nullptr);
173 168
174 if (GLSurfaceGLX::IsCreateContextSupported()) { 169 if (GLSurfaceGLX::IsCreateContextSupported()) {
175 DVLOG(1) << "GLX_ARB_create_context supported."; 170 DVLOG(1) << "GLX_ARB_create_context supported.";
176 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 171 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
177 switches::kCreateDefaultGLContext)) { 172 switches::kCreateDefaultGLContext)) {
178 context_ = CreateContextAttribs( 173 context_ = CreateContextAttribs(
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 319
325 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { 320 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() {
326 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); 321 return GLSurfaceGLX::IsCreateContextRobustnessSupported();
327 } 322 }
328 323
329 GLContextGLX::~GLContextGLX() { 324 GLContextGLX::~GLContextGLX() {
330 Destroy(); 325 Destroy();
331 } 326 }
332 327
333 } // namespace gl 328 } // namespace gl
OLDNEW
« no previous file with comments | « 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