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

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

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: address piman's comments 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 // webgl_compatibility_context and disabling bind_generates_resource are not
165 // supported.
166 DCHECK(!attribs.webgl_compatibility_context &&
167 attribs.bind_generates_resource);
168
164 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay()); 169 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay());
165 170
166 GLXContext share_handle = static_cast<GLXContext>( 171 GLXContext share_handle = static_cast<GLXContext>(
167 share_group() ? share_group()->GetHandle() : nullptr); 172 share_group() ? share_group()->GetHandle() : nullptr);
168 173
169 if (GLSurfaceGLX::IsCreateContextSupported()) { 174 if (GLSurfaceGLX::IsCreateContextSupported()) {
170 DVLOG(1) << "GLX_ARB_create_context supported."; 175 DVLOG(1) << "GLX_ARB_create_context supported.";
171 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 176 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
172 switches::kCreateDefaultGLContext)) { 177 switches::kCreateDefaultGLContext)) {
173 context_ = CreateContextAttribs( 178 context_ = CreateContextAttribs(
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 324
320 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { 325 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() {
321 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); 326 return GLSurfaceGLX::IsCreateContextRobustnessSupported();
322 } 327 }
323 328
324 GLContextGLX::~GLContextGLX() { 329 GLContextGLX::~GLContextGLX() {
325 Destroy(); 330 Destroy();
326 } 331 }
327 332
328 } // namespace gl 333 } // namespace gl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698