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

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

Issue 15841002: gpu: Fix corrupted state due to virtual MakeCurrent race. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reland patch. Created 7 years, 6 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_state_restorer_impl.h ('k') | ui/gl/gl_gl_api_implementation.cc » ('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_state_restorer_impl.h" 5 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
6 6
7 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 7 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
8 8
9 namespace gpu { 9 namespace gpu {
10 10
11 GLStateRestorerImpl::GLStateRestorerImpl( 11 GLStateRestorerImpl::GLStateRestorerImpl(
12 base::WeakPtr<gles2::GLES2Decoder> decoder) 12 base::WeakPtr<gles2::GLES2Decoder> decoder)
13 : decoder_(decoder) { 13 : decoder_(decoder) {
14 } 14 }
15 15
16 GLStateRestorerImpl::~GLStateRestorerImpl() { 16 GLStateRestorerImpl::~GLStateRestorerImpl() {
17 } 17 }
18 18
19 bool GLStateRestorerImpl::IsInitialized() {
20 DCHECK(decoder_.get());
21 return decoder_->initialized();
22 }
23
19 void GLStateRestorerImpl::RestoreState() { 24 void GLStateRestorerImpl::RestoreState() {
20 DCHECK(decoder_.get()); 25 DCHECK(decoder_.get());
21 decoder_->RestoreState(); 26 decoder_->RestoreState();
22 } 27 }
23 28
24 void GLStateRestorerImpl::RestoreAllTextureUnitBindings() { 29 void GLStateRestorerImpl::RestoreAllTextureUnitBindings() {
25 DCHECK(decoder_.get()); 30 DCHECK(decoder_.get());
26 decoder_->RestoreAllTextureUnitBindings(); 31 decoder_->RestoreAllTextureUnitBindings();
27 } 32 }
28 33
29 void GLStateRestorerImpl::RestoreFramebufferBindings() { 34 void GLStateRestorerImpl::RestoreFramebufferBindings() {
30 DCHECK(decoder_.get()); 35 DCHECK(decoder_.get());
31 decoder_->RestoreFramebufferBindings(); 36 decoder_->RestoreFramebufferBindings();
32 } 37 }
33 38
34 } // namespace gpu 39 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_state_restorer_impl.h ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698