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

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

Issue 14069008: GPU: Reduce MakeCurrent calls to fix Orange San Diego (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged work-around. Created 7 years, 7 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 | « gpu/command_buffer/service/gl_context_virtual.cc ('k') | no next file » | 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_egl.h" 5 #include "ui/gl/gl_context_egl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 127
128 void GLContextEGL::SetUnbindFboOnMakeCurrent() { 128 void GLContextEGL::SetUnbindFboOnMakeCurrent() {
129 unbind_fbo_on_makecurrent_ = true; 129 unbind_fbo_on_makecurrent_ = true;
130 } 130 }
131 131
132 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { 132 void GLContextEGL::ReleaseCurrent(GLSurface* surface) {
133 if (!IsCurrent(surface)) 133 if (!IsCurrent(surface))
134 return; 134 return;
135 135
136 if (unbind_fbo_on_makecurrent_)
137 glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
138
136 SetCurrent(NULL, NULL); 139 SetCurrent(NULL, NULL);
137 eglMakeCurrent(display_, 140 eglMakeCurrent(display_,
138 EGL_NO_SURFACE, 141 EGL_NO_SURFACE,
139 EGL_NO_SURFACE, 142 EGL_NO_SURFACE,
140 EGL_NO_CONTEXT); 143 EGL_NO_CONTEXT);
141 } 144 }
142 145
143 bool GLContextEGL::IsCurrent(GLSurface* surface) { 146 bool GLContextEGL::IsCurrent(GLSurface* surface) {
144 DCHECK(context_); 147 DCHECK(context_);
145 148
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 195
193 #if !defined(OS_ANDROID) 196 #if !defined(OS_ANDROID)
194 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { 197 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) {
195 DCHECK(bytes); 198 DCHECK(bytes);
196 *bytes = 0; 199 *bytes = 0;
197 return false; 200 return false;
198 } 201 }
199 #endif 202 #endif
200 203
201 } // namespace gfx 204 } // namespace gfx
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698