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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 bool GLSurface::Initialize() { | 78 bool GLSurface::Initialize() { |
79 return true; | 79 return true; |
80 } | 80 } |
81 | 81 |
82 bool GLSurface::Resize(const gfx::Size& size) { | 82 bool GLSurface::Resize(const gfx::Size& size) { |
83 NOTIMPLEMENTED(); | 83 NOTIMPLEMENTED(); |
84 return false; | 84 return false; |
85 } | 85 } |
86 | 86 |
87 bool GLSurface::Recreate() { | |
88 NOTIMPLEMENTED(); | |
89 return false; | |
90 } | |
91 | |
92 bool GLSurface::DeferDraws() { | 87 bool GLSurface::DeferDraws() { |
93 return false; | 88 return false; |
94 } | 89 } |
95 | 90 |
96 std::string GLSurface::GetExtensions() { | 91 std::string GLSurface::GetExtensions() { |
97 return std::string(); | 92 return std::string(); |
98 } | 93 } |
99 | 94 |
100 bool GLSurface::HasExtension(const char* name) { | 95 bool GLSurface::HasExtension(const char* name) { |
101 std::string extensions = GetExtensions(); | 96 std::string extensions = GetExtensions(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 138 |
144 unsigned GLSurface::GetFormat() { | 139 unsigned GLSurface::GetFormat() { |
145 NOTIMPLEMENTED(); | 140 NOTIMPLEMENTED(); |
146 return 0; | 141 return 0; |
147 } | 142 } |
148 | 143 |
149 VSyncProvider* GLSurface::GetVSyncProvider() { | 144 VSyncProvider* GLSurface::GetVSyncProvider() { |
150 return NULL; | 145 return NULL; |
151 } | 146 } |
152 | 147 |
153 bool GLSurface::RecreateOnMakeCurrent() { | |
154 return false; | |
155 } | |
156 | |
157 void GLSurface::SetRecreateOnMakeCurrent(bool recreate) { | |
158 } | |
159 | |
160 GLSurface* GLSurface::GetCurrent() { | 148 GLSurface* GLSurface::GetCurrent() { |
161 return current_surface_.Pointer()->Get(); | 149 return current_surface_.Pointer()->Get(); |
162 } | 150 } |
163 | 151 |
164 GLSurface::~GLSurface() { | 152 GLSurface::~GLSurface() { |
165 if (GetCurrent() == this) | 153 if (GetCurrent() == this) |
166 SetCurrent(NULL); | 154 SetCurrent(NULL); |
167 } | 155 } |
168 | 156 |
169 void GLSurface::SetCurrent(GLSurface* surface) { | 157 void GLSurface::SetCurrent(GLSurface* surface) { |
(...skipping 20 matching lines...) Expand all Loading... |
190 } | 178 } |
191 | 179 |
192 void GLSurfaceAdapter::Destroy() { | 180 void GLSurfaceAdapter::Destroy() { |
193 surface_->Destroy(); | 181 surface_->Destroy(); |
194 } | 182 } |
195 | 183 |
196 bool GLSurfaceAdapter::Resize(const gfx::Size& size) { | 184 bool GLSurfaceAdapter::Resize(const gfx::Size& size) { |
197 return surface_->Resize(size); | 185 return surface_->Resize(size); |
198 } | 186 } |
199 | 187 |
200 bool GLSurfaceAdapter::Recreate() { | |
201 return surface_->Recreate(); | |
202 } | |
203 | |
204 bool GLSurfaceAdapter::DeferDraws() { | 188 bool GLSurfaceAdapter::DeferDraws() { |
205 return surface_->DeferDraws(); | 189 return surface_->DeferDraws(); |
206 } | 190 } |
207 | 191 |
208 bool GLSurfaceAdapter::IsOffscreen() { | 192 bool GLSurfaceAdapter::IsOffscreen() { |
209 return surface_->IsOffscreen(); | 193 return surface_->IsOffscreen(); |
210 } | 194 } |
211 | 195 |
212 bool GLSurfaceAdapter::SwapBuffers() { | 196 bool GLSurfaceAdapter::SwapBuffers() { |
213 return surface_->SwapBuffers(); | 197 return surface_->SwapBuffers(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 242 } |
259 | 243 |
260 unsigned GLSurfaceAdapter::GetFormat() { | 244 unsigned GLSurfaceAdapter::GetFormat() { |
261 return surface_->GetFormat(); | 245 return surface_->GetFormat(); |
262 } | 246 } |
263 | 247 |
264 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { | 248 VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() { |
265 return surface_->GetVSyncProvider(); | 249 return surface_->GetVSyncProvider(); |
266 } | 250 } |
267 | 251 |
268 bool GLSurfaceAdapter::RecreateOnMakeCurrent() { | |
269 return surface_->RecreateOnMakeCurrent(); | |
270 } | |
271 | |
272 void GLSurfaceAdapter::SetRecreateOnMakeCurrent(bool recreate) { | |
273 surface_->SetRecreateOnMakeCurrent(recreate); | |
274 } | |
275 | |
276 GLSurfaceAdapter::~GLSurfaceAdapter() {} | 252 GLSurfaceAdapter::~GLSurfaceAdapter() {} |
277 | 253 |
278 } // namespace gfx | 254 } // namespace gfx |
OLD | NEW |