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

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

Issue 2347383002: X11: Use better visuals for OpenGL (Closed)
Patch Set: auto* Created 4 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
« no previous file with comments | « ui/gl/DEPS ('k') | ui/gl/gl_share_group.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.h" 5 #include "ui/gl/gl_context.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 canceled_ = true; 44 canceled_ = true;
45 } 45 }
46 46
47 GLContext::GLContext(GLShareGroup* share_group) 47 GLContext::GLContext(GLShareGroup* share_group)
48 : share_group_(share_group), 48 : share_group_(share_group),
49 current_virtual_context_(nullptr), 49 current_virtual_context_(nullptr),
50 state_dirtied_externally_(false), 50 state_dirtied_externally_(false),
51 swap_interval_(1), 51 swap_interval_(1),
52 force_swap_interval_zero_(false) { 52 force_swap_interval_zero_(false) {
53 if (!share_group_.get()) 53 if (!share_group_.get())
54 share_group_ = new GLShareGroup; 54 share_group_ = new gl::GLShareGroup();
55 55
56 share_group_->AddContext(this); 56 share_group_->AddContext(this);
57 } 57 }
58 58
59 GLContext::~GLContext() { 59 GLContext::~GLContext() {
60 share_group_->RemoveContext(this); 60 share_group_->RemoveContext(this);
61 if (GetCurrent() == this) { 61 if (GetCurrent() == this) {
62 SetCurrent(nullptr); 62 SetCurrent(nullptr);
63 } 63 }
64 } 64 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, 274 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context,
275 GLSurface* compatible_surface, 275 GLSurface* compatible_surface,
276 GpuPreference gpu_preference) { 276 GpuPreference gpu_preference) {
277 if (!context->Initialize(compatible_surface, gpu_preference)) 277 if (!context->Initialize(compatible_surface, gpu_preference))
278 return nullptr; 278 return nullptr;
279 return context; 279 return context;
280 } 280 }
281 281
282 } // namespace gl 282 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/DEPS ('k') | ui/gl/gl_share_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698