| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 bool GLSurface::SupportsPostSubBuffer() { | 186 bool GLSurface::SupportsPostSubBuffer() { |
| 187 return false; | 187 return false; |
| 188 } | 188 } |
| 189 | 189 |
| 190 unsigned int GLSurface::GetBackingFrameBufferObject() { | 190 unsigned int GLSurface::GetBackingFrameBufferObject() { |
| 191 return 0; | 191 return 0; |
| 192 } | 192 } |
| 193 | 193 |
| 194 bool GLSurface::SwapBuffersAsync(const SwapCompletionCallback& callback) { |
| 195 DCHECK(!IsSurfaceless()); |
| 196 bool success = SwapBuffers(); |
| 197 callback.Run(); |
| 198 return success; |
| 199 } |
| 200 |
| 194 bool GLSurface::PostSubBuffer(int x, int y, int width, int height) { | 201 bool GLSurface::PostSubBuffer(int x, int y, int width, int height) { |
| 195 return false; | 202 return false; |
| 196 } | 203 } |
| 197 | 204 |
| 205 bool GLSurface::PostSubBufferAsync(int x, |
| 206 int y, |
| 207 int width, |
| 208 int height, |
| 209 const SwapCompletionCallback& callback) { |
| 210 bool success = PostSubBuffer(x, y, width, height); |
| 211 callback.Run(); |
| 212 return success; |
| 213 } |
| 214 |
| 198 bool GLSurface::OnMakeCurrent(GLContext* context) { | 215 bool GLSurface::OnMakeCurrent(GLContext* context) { |
| 199 return true; | 216 return true; |
| 200 } | 217 } |
| 201 | 218 |
| 202 void GLSurface::NotifyWasBound() { | 219 void GLSurface::NotifyWasBound() { |
| 203 } | 220 } |
| 204 | 221 |
| 205 bool GLSurface::SetBackbufferAllocation(bool allocated) { | 222 bool GLSurface::SetBackbufferAllocation(bool allocated) { |
| 206 return true; | 223 return true; |
| 207 } | 224 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 312 } |
| 296 | 313 |
| 297 bool GLSurfaceAdapter::IsOffscreen() { | 314 bool GLSurfaceAdapter::IsOffscreen() { |
| 298 return surface_->IsOffscreen(); | 315 return surface_->IsOffscreen(); |
| 299 } | 316 } |
| 300 | 317 |
| 301 bool GLSurfaceAdapter::SwapBuffers() { | 318 bool GLSurfaceAdapter::SwapBuffers() { |
| 302 return surface_->SwapBuffers(); | 319 return surface_->SwapBuffers(); |
| 303 } | 320 } |
| 304 | 321 |
| 322 bool GLSurfaceAdapter::SwapBuffersAsync( |
| 323 const SwapCompletionCallback& callback) { |
| 324 return surface_->SwapBuffersAsync(callback); |
| 325 } |
| 326 |
| 305 bool GLSurfaceAdapter::PostSubBuffer(int x, int y, int width, int height) { | 327 bool GLSurfaceAdapter::PostSubBuffer(int x, int y, int width, int height) { |
| 306 return surface_->PostSubBuffer(x, y, width, height); | 328 return surface_->PostSubBuffer(x, y, width, height); |
| 307 } | 329 } |
| 308 | 330 |
| 331 bool GLSurfaceAdapter::PostSubBufferAsync( |
| 332 int x, int y, int width, int height, |
| 333 const SwapCompletionCallback& callback) { |
| 334 return surface_->PostSubBufferAsync(x, y, width, height, callback); |
| 335 } |
| 336 |
| 309 bool GLSurfaceAdapter::SupportsPostSubBuffer() { | 337 bool GLSurfaceAdapter::SupportsPostSubBuffer() { |
| 310 return surface_->SupportsPostSubBuffer(); | 338 return surface_->SupportsPostSubBuffer(); |
| 311 } | 339 } |
| 312 | 340 |
| 313 gfx::Size GLSurfaceAdapter::GetSize() { | 341 gfx::Size GLSurfaceAdapter::GetSize() { |
| 314 return surface_->GetSize(); | 342 return surface_->GetSize(); |
| 315 } | 343 } |
| 316 | 344 |
| 317 void* GLSurfaceAdapter::GetHandle() { | 345 void* GLSurfaceAdapter::GetHandle() { |
| 318 return surface_->GetHandle(); | 346 return surface_->GetHandle(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 z_order, transform, image, bounds_rect, crop_rect); | 391 z_order, transform, image, bounds_rect, crop_rect); |
| 364 } | 392 } |
| 365 | 393 |
| 366 bool GLSurfaceAdapter::IsSurfaceless() const { | 394 bool GLSurfaceAdapter::IsSurfaceless() const { |
| 367 return surface_->IsSurfaceless(); | 395 return surface_->IsSurfaceless(); |
| 368 } | 396 } |
| 369 | 397 |
| 370 GLSurfaceAdapter::~GLSurfaceAdapter() {} | 398 GLSurfaceAdapter::~GLSurfaceAdapter() {} |
| 371 | 399 |
| 372 } // namespace gfx | 400 } // namespace gfx |
| OLD | NEW |