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

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

Issue 10822029: Use EXT_robustness where available on GLES2 platforms to detect and respond to resets of the graphi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review feedback. Rebuilt and re-tested. Created 8 years, 4 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
« no previous file with comments | « ui/gl/gl_surface.h ('k') | ui/gl/gl_surface_egl.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_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 GLSurface::~GLSurface() { 154 GLSurface::~GLSurface() {
155 if (GetCurrent() == this) 155 if (GetCurrent() == this)
156 SetCurrent(NULL); 156 SetCurrent(NULL);
157 } 157 }
158 158
159 void GLSurface::SetCurrent(GLSurface* surface) { 159 void GLSurface::SetCurrent(GLSurface* surface) {
160 current_surface_.Pointer()->Set(surface); 160 current_surface_.Pointer()->Set(surface);
161 } 161 }
162 162
163 bool GLSurface::ExtensionsContain(const char* c_extensions, const char* name) {
164 DCHECK(name);
165 if (!c_extensions)
166 return false;
167 std::string extensions(c_extensions);
168 extensions += " ";
169
170 std::string delimited_name(name);
171 delimited_name += " ";
172
173 return extensions.find(delimited_name) != std::string::npos;
174 }
175
163 GLSurfaceAdapter::GLSurfaceAdapter(GLSurface* surface) : surface_(surface) {} 176 GLSurfaceAdapter::GLSurfaceAdapter(GLSurface* surface) : surface_(surface) {}
164 177
165 bool GLSurfaceAdapter::Initialize() { 178 bool GLSurfaceAdapter::Initialize() {
166 return surface_->Initialize(); 179 return surface_->Initialize();
167 } 180 }
168 181
169 void GLSurfaceAdapter::Destroy() { 182 void GLSurfaceAdapter::Destroy() {
170 surface_->Destroy(); 183 surface_->Destroy();
171 } 184 }
172 185
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return surface_->GetConfig(); 247 return surface_->GetConfig();
235 } 248 }
236 249
237 unsigned GLSurfaceAdapter::GetFormat() { 250 unsigned GLSurfaceAdapter::GetFormat() {
238 return surface_->GetFormat(); 251 return surface_->GetFormat();
239 } 252 }
240 253
241 GLSurfaceAdapter::~GLSurfaceAdapter() {} 254 GLSurfaceAdapter::~GLSurfaceAdapter() {}
242 255
243 } // namespace gfx 256 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_surface.h ('k') | ui/gl/gl_surface_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698