OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |