| 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_gl_api_implementation.h" | 5 #include "ui/gl/gl_gl_api_implementation.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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 : driver_(NULL) { | 348 : driver_(NULL) { |
| 349 } | 349 } |
| 350 | 350 |
| 351 GLApiBase::~GLApiBase() { | 351 GLApiBase::~GLApiBase() { |
| 352 } | 352 } |
| 353 | 353 |
| 354 void GLApiBase::InitializeBase(DriverGL* driver) { | 354 void GLApiBase::InitializeBase(DriverGL* driver) { |
| 355 driver_ = driver; | 355 driver_ = driver; |
| 356 } | 356 } |
| 357 | 357 |
| 358 void GLApiBase::SignalFlush() { |
| 359 DCHECK(GLContext::GetCurrent()); |
| 360 GLContext::GetCurrent()->OnFlush(); |
| 361 } |
| 362 |
| 358 RealGLApi::RealGLApi() { | 363 RealGLApi::RealGLApi() { |
| 359 } | 364 } |
| 360 | 365 |
| 361 RealGLApi::~RealGLApi() { | 366 RealGLApi::~RealGLApi() { |
| 362 } | 367 } |
| 363 | 368 |
| 364 void RealGLApi::Initialize(DriverGL* driver) { | 369 void RealGLApi::Initialize(DriverGL* driver) { |
| 365 InitializeBase(driver); | 370 InitializeBase(driver); |
| 366 } | 371 } |
| 367 | 372 |
| 373 void RealGLApi::glFlushFn() { |
| 374 GLApiBase::glFlushFn(); |
| 375 GLApiBase::SignalFlush(); |
| 376 } |
| 377 |
| 378 void RealGLApi::glFinishFn() { |
| 379 GLApiBase::glFinishFn(); |
| 380 GLApiBase::SignalFlush(); |
| 381 } |
| 382 |
| 368 TraceGLApi::~TraceGLApi() { | 383 TraceGLApi::~TraceGLApi() { |
| 369 } | 384 } |
| 370 | 385 |
| 371 NoContextGLApi::NoContextGLApi() { | 386 NoContextGLApi::NoContextGLApi() { |
| 372 } | 387 } |
| 373 | 388 |
| 374 NoContextGLApi::~NoContextGLApi() { | 389 NoContextGLApi::~NoContextGLApi() { |
| 375 } | 390 } |
| 376 | 391 |
| 377 VirtualGLApi::VirtualGLApi() | 392 VirtualGLApi::VirtualGLApi() |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 471 |
| 457 const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) { | 472 const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) { |
| 458 switch (name) { | 473 switch (name) { |
| 459 case GL_EXTENSIONS: | 474 case GL_EXTENSIONS: |
| 460 return reinterpret_cast<const GLubyte*>(extensions_.c_str()); | 475 return reinterpret_cast<const GLubyte*>(extensions_.c_str()); |
| 461 default: | 476 default: |
| 462 return driver_->fn.glGetStringFn(name); | 477 return driver_->fn.glGetStringFn(name); |
| 463 } | 478 } |
| 464 } | 479 } |
| 465 | 480 |
| 481 void VirtualGLApi::glFlushFn() { |
| 482 GLApiBase::glFlushFn(); |
| 483 GLApiBase::SignalFlush(); |
| 484 } |
| 485 |
| 486 void VirtualGLApi::glFinishFn() { |
| 487 GLApiBase::glFinishFn(); |
| 488 GLApiBase::SignalFlush(); |
| 489 } |
| 490 |
| 466 } // namespace gfx | 491 } // namespace gfx |
| OLD | NEW |