Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: ui/gl/gl_gl_api_implementation.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_egl_api_implementation.h ('k') | ui/gl/gl_glx_api_implementation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 return false; 435 return false;
436 } 436 }
437 } 437 }
438 } 438 }
439 439
440 DCHECK_EQ(real_context_, GLContext::GetRealCurrent()); 440 DCHECK_EQ(real_context_, GLContext::GetRealCurrent());
441 DCHECK(real_context_->IsCurrent(NULL)); 441 DCHECK(real_context_->IsCurrent(NULL));
442 DCHECK(virtual_context->IsCurrent(surface)); 442 DCHECK(virtual_context->IsCurrent(surface));
443 443
444 if (switched_contexts || virtual_context != current_context_) { 444 if (switched_contexts || virtual_context != current_context_) {
445 // There should be no errors from the previous context leaking into the 445 #if DCHECK_IS_ON
446 // new context. 446 GLenum error = glGetErrorFn();
447 DCHECK_EQ(glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR)); 447 // Accepting a context loss error here enables using debug mode to work on
448 // context loss handling in virtual context mode.
449 // There should be no other errors from the previous context leaking into
450 // the new context.
451 DCHECK(error == GL_NO_ERROR || error == GL_CONTEXT_LOST_KHR);
452 #endif
448 453
449 // Set all state that is different from the real state 454 // Set all state that is different from the real state
450 GLApi* temp = GetCurrentGLApi(); 455 GLApi* temp = GetCurrentGLApi();
451 SetGLToRealGLApi(); 456 SetGLToRealGLApi();
452 if (virtual_context->GetGLStateRestorer()->IsInitialized()) { 457 if (virtual_context->GetGLStateRestorer()->IsInitialized()) {
453 virtual_context->GetGLStateRestorer()->RestoreState( 458 virtual_context->GetGLStateRestorer()->RestoreState(
454 (current_context_ && !switched_contexts) 459 (current_context_ && !switched_contexts)
455 ? current_context_->GetGLStateRestorer() 460 ? current_context_->GetGLStateRestorer()
456 : NULL); 461 : NULL);
457 } 462 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 ScopedSetGLToRealGLApi::ScopedSetGLToRealGLApi() 500 ScopedSetGLToRealGLApi::ScopedSetGLToRealGLApi()
496 : old_gl_api_(GetCurrentGLApi()) { 501 : old_gl_api_(GetCurrentGLApi()) {
497 SetGLToRealGLApi(); 502 SetGLToRealGLApi();
498 } 503 }
499 504
500 ScopedSetGLToRealGLApi::~ScopedSetGLToRealGLApi() { 505 ScopedSetGLToRealGLApi::~ScopedSetGLToRealGLApi() {
501 SetGLApi(old_gl_api_); 506 SetGLApi(old_gl_api_);
502 } 507 }
503 508
504 } // namespace gfx 509 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_egl_api_implementation.h ('k') | ui/gl/gl_glx_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698