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

Side by Side Diff: gpu/command_buffer/service/gl_context_virtual.cc

Issue 1880923002: GLContext: Remove WasDirtiedExternally methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 | « gpu/command_buffer/service/gl_context_virtual.h ('k') | ui/gl/gl_context.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 "gpu/command_buffer/service/gl_context_virtual.h" 5 #include "gpu/command_buffer/service/gl_context_virtual.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" 8 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
10 #include "ui/gl/gl_gl_api_implementation.h" 10 #include "ui/gl/gl_gl_api_implementation.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 bool GLContextVirtual::WasAllocatedUsingRobustnessExtension() { 101 bool GLContextVirtual::WasAllocatedUsingRobustnessExtension() {
102 return shared_context_->WasAllocatedUsingRobustnessExtension(); 102 return shared_context_->WasAllocatedUsingRobustnessExtension();
103 } 103 }
104 104
105 void GLContextVirtual::SetUnbindFboOnMakeCurrent() { 105 void GLContextVirtual::SetUnbindFboOnMakeCurrent() {
106 shared_context_->SetUnbindFboOnMakeCurrent(); 106 shared_context_->SetUnbindFboOnMakeCurrent();
107 } 107 }
108 108
109 base::Closure GLContextVirtual::GetStateWasDirtiedExternallyCallback() {
110 return shared_context_->GetStateWasDirtiedExternallyCallback();
111 }
112
113 void GLContextVirtual::RestoreStateIfDirtiedExternally() {
114 // The dirty bit should only be cleared after the state has been restored,
115 // which should be done only when the context is current.
116 DCHECK(IsCurrent(NULL));
117 if (!shared_context_->GetStateWasDirtiedExternally())
118 return;
119 gfx::ScopedSetGLToRealGLApi scoped_set_gl_api;
120 GetGLStateRestorer()->RestoreState(NULL);
121 shared_context_->SetStateWasDirtiedExternally(false);
122 }
123
124 GLContextVirtual::~GLContextVirtual() { 109 GLContextVirtual::~GLContextVirtual() {
125 Destroy(); 110 Destroy();
126 } 111 }
127 112
128 } // namespace gpu 113 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.h ('k') | ui/gl/gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698