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

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

Issue 2629633003: Refactor GL bindings so there is no global GLApi or DriverGL. (Closed)
Patch Set: rebase Created 3 years, 10 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/gl_context_glx.cc ('k') | ui/gl/gl_context_stub.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_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/geometry/size.h" 10 #include "ui/gfx/geometry/size.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 size.width(), 75 size.width(),
76 size.height())) { 76 size.height())) {
77 LOG(ERROR) << "OSMesaMakeCurrent failed."; 77 LOG(ERROR) << "OSMesaMakeCurrent failed.";
78 Destroy(); 78 Destroy();
79 return false; 79 return false;
80 } 80 }
81 // Track that we're no longer in a released state to workaround a mesa issue. 81 // Track that we're no longer in a released state to workaround a mesa issue.
82 is_released_ = false; 82 is_released_ = false;
83 83
84 // Set this as soon as the context is current, since we might call into GL. 84 // Set this as soon as the context is current, since we might call into GL.
85 SetRealGLApi(); 85 BindGLApi();
86 86
87 // Row 0 is at the top. 87 // Row 0 is at the top.
88 OSMesaPixelStore(OSMESA_Y_UP, 0); 88 OSMesaPixelStore(OSMESA_Y_UP, 0);
89 89
90 SetCurrent(surface); 90 SetCurrent(surface);
91 InitializeDynamicBindings(); 91 InitializeDynamicBindings();
92 92
93 if (!surface->OnMakeCurrent(this)) { 93 if (!surface->OnMakeCurrent(this)) {
94 LOG(ERROR) << "Could not make current."; 94 LOG(ERROR) << "Could not make current.";
95 return false; 95 return false;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 void GLContextOSMesa::OnSetSwapInterval(int interval) { 148 void GLContextOSMesa::OnSetSwapInterval(int interval) {
149 DCHECK(IsCurrent(nullptr)); 149 DCHECK(IsCurrent(nullptr));
150 } 150 }
151 151
152 GLContextOSMesa::~GLContextOSMesa() { 152 GLContextOSMesa::~GLContextOSMesa() {
153 Destroy(); 153 Destroy();
154 } 154 }
155 155
156 } // namespace gl 156 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_context_glx.cc ('k') | ui/gl/gl_context_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698