| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 return false; | 471 return false; |
| 472 } | 472 } |
| 473 } | 473 } |
| 474 } | 474 } |
| 475 | 475 |
| 476 DCHECK_EQ(real_context_, GLContext::GetRealCurrent()); | 476 DCHECK_EQ(real_context_, GLContext::GetRealCurrent()); |
| 477 DCHECK(real_context_->IsCurrent(NULL)); | 477 DCHECK(real_context_->IsCurrent(NULL)); |
| 478 DCHECK(virtual_context->IsCurrent(surface)); | 478 DCHECK(virtual_context->IsCurrent(surface)); |
| 479 | 479 |
| 480 if (switched_contexts || virtual_context != current_context_) { | 480 if (switched_contexts || virtual_context != current_context_) { |
| 481 #if DCHECK_IS_ON | 481 #if DCHECK_IS_ON() |
| 482 GLenum error = glGetErrorFn(); | 482 GLenum error = glGetErrorFn(); |
| 483 // Accepting a context loss error here enables using debug mode to work on | 483 // Accepting a context loss error here enables using debug mode to work on |
| 484 // context loss handling in virtual context mode. | 484 // context loss handling in virtual context mode. |
| 485 // There should be no other errors from the previous context leaking into | 485 // There should be no other errors from the previous context leaking into |
| 486 // the new context. | 486 // the new context. |
| 487 DCHECK(error == GL_NO_ERROR || error == GL_CONTEXT_LOST_KHR); | 487 DCHECK(error == GL_NO_ERROR || error == GL_CONTEXT_LOST_KHR); |
| 488 #endif | 488 #endif |
| 489 | 489 |
| 490 // Set all state that is different from the real state | 490 // Set all state that is different from the real state |
| 491 GLApi* temp = GetCurrentGLApi(); | 491 GLApi* temp = GetCurrentGLApi(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 ScopedSetGLToRealGLApi::ScopedSetGLToRealGLApi() | 536 ScopedSetGLToRealGLApi::ScopedSetGLToRealGLApi() |
| 537 : old_gl_api_(GetCurrentGLApi()) { | 537 : old_gl_api_(GetCurrentGLApi()) { |
| 538 SetGLToRealGLApi(); | 538 SetGLToRealGLApi(); |
| 539 } | 539 } |
| 540 | 540 |
| 541 ScopedSetGLToRealGLApi::~ScopedSetGLToRealGLApi() { | 541 ScopedSetGLToRealGLApi::~ScopedSetGLToRealGLApi() { |
| 542 SetGLApi(old_gl_api_); | 542 SetGLApi(old_gl_api_); |
| 543 } | 543 } |
| 544 | 544 |
| 545 } // namespace gfx | 545 } // namespace gfx |
| OLD | NEW |