| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 : driver_(NULL) { | 336 : driver_(NULL) { |
| 337 } | 337 } |
| 338 | 338 |
| 339 GLApiBase::~GLApiBase() { | 339 GLApiBase::~GLApiBase() { |
| 340 } | 340 } |
| 341 | 341 |
| 342 void GLApiBase::InitializeBase(DriverGL* driver) { | 342 void GLApiBase::InitializeBase(DriverGL* driver) { |
| 343 driver_ = driver; | 343 driver_ = driver; |
| 344 } | 344 } |
| 345 | 345 |
| 346 void GLApiBase::SignalFlush() { |
| 347 DCHECK(GLContext::GetCurrent()); |
| 348 GLContext::GetCurrent()->OnFlush(); |
| 349 } |
| 350 |
| 346 RealGLApi::RealGLApi() { | 351 RealGLApi::RealGLApi() { |
| 347 } | 352 } |
| 348 | 353 |
| 349 RealGLApi::~RealGLApi() { | 354 RealGLApi::~RealGLApi() { |
| 350 } | 355 } |
| 351 | 356 |
| 352 void RealGLApi::Initialize(DriverGL* driver) { | 357 void RealGLApi::Initialize(DriverGL* driver) { |
| 353 InitializeBase(driver); | 358 InitializeBase(driver); |
| 354 } | 359 } |
| 355 | 360 |
| 361 void RealGLApi::glFlushFn() { |
| 362 GLApiBase::glFlushFn(); |
| 363 GLApiBase::SignalFlush(); |
| 364 } |
| 365 |
| 366 void RealGLApi::glFinishFn() { |
| 367 GLApiBase::glFinishFn(); |
| 368 GLApiBase::SignalFlush(); |
| 369 } |
| 370 |
| 356 TraceGLApi::~TraceGLApi() { | 371 TraceGLApi::~TraceGLApi() { |
| 357 } | 372 } |
| 358 | 373 |
| 359 VirtualGLApi::VirtualGLApi() | 374 VirtualGLApi::VirtualGLApi() |
| 360 : real_context_(NULL), | 375 : real_context_(NULL), |
| 361 current_context_(NULL) { | 376 current_context_(NULL) { |
| 362 } | 377 } |
| 363 | 378 |
| 364 VirtualGLApi::~VirtualGLApi() { | 379 VirtualGLApi::~VirtualGLApi() { |
| 365 } | 380 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 453 |
| 439 const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) { | 454 const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) { |
| 440 switch (name) { | 455 switch (name) { |
| 441 case GL_EXTENSIONS: | 456 case GL_EXTENSIONS: |
| 442 return reinterpret_cast<const GLubyte*>(extensions_.c_str()); | 457 return reinterpret_cast<const GLubyte*>(extensions_.c_str()); |
| 443 default: | 458 default: |
| 444 return driver_->fn.glGetStringFn(name); | 459 return driver_->fn.glGetStringFn(name); |
| 445 } | 460 } |
| 446 } | 461 } |
| 447 | 462 |
| 463 void VirtualGLApi::glFlushFn() { |
| 464 GLApiBase::glFlushFn(); |
| 465 GLApiBase::SignalFlush(); |
| 466 } |
| 467 |
| 468 void VirtualGLApi::glFinishFn() { |
| 469 GLApiBase::glFinishFn(); |
| 470 GLApiBase::SignalFlush(); |
| 471 } |
| 472 |
| 448 } // namespace gfx | 473 } // namespace gfx |
| OLD | NEW |