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

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

Issue 16894002: Unset GL Api when releasing a context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
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_osmesa.h" 5 #include "ui/gl/gl_context_osmesa.h"
6 6
7 #include <GL/osmesa.h> 7 #include <GL/osmesa.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gfx/size.h" 10 #include "ui/gfx/size.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 OSMesaPixelStore(OSMESA_Y_UP, 0); 69 OSMesaPixelStore(OSMESA_Y_UP, 0);
70 70
71 SetCurrent(surface); 71 SetCurrent(surface);
72 if (!InitializeExtensionBindings()) { 72 if (!InitializeExtensionBindings()) {
73 ReleaseCurrent(surface); 73 ReleaseCurrent(surface);
74 return false; 74 return false;
75 } 75 }
76 76
77 if (!surface->OnMakeCurrent(this)) { 77 if (!surface->OnMakeCurrent(this)) {
78 LOG(ERROR) << "Could not make current."; 78 LOG(ERROR) << "Could not make current.";
79 ReleaseCurrent(surface);
79 return false; 80 return false;
80 } 81 }
81 82
82 return true; 83 return true;
83 } 84 }
84 85
85 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { 86 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) {
86 if (!IsCurrent(surface)) 87 if (!IsCurrent(surface))
87 return; 88 return;
88 89
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 124
124 void GLContextOSMesa::SetSwapInterval(int interval) { 125 void GLContextOSMesa::SetSwapInterval(int interval) {
125 DCHECK(IsCurrent(NULL)); 126 DCHECK(IsCurrent(NULL));
126 } 127 }
127 128
128 GLContextOSMesa::~GLContextOSMesa() { 129 GLContextOSMesa::~GLContextOSMesa() {
129 Destroy(); 130 Destroy();
130 } 131 }
131 132
132 } // namespace gfx 133 } // namespace gfx
OLDNEW
« ui/gl/gl_bindings.h ('K') | « ui/gl/gl_context_egl.cc ('k') | ui/gl/gl_context_wgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698