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

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

Issue 2762833003: gpu: Use decoder state restoration for scoped_binders (Closed)
Patch Set: Fixed MediaColorTest failures on macOS Created 3 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
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 #include "gpu/command_buffer/service/query_manager.h" 8 #include "gpu/command_buffer/service/query_manager.h"
9 9
10 namespace gpu { 10 namespace gpu {
(...skipping 18 matching lines...) Expand all
29 29
30 decoder_->RestoreState( 30 decoder_->RestoreState(
31 restorer_impl ? restorer_impl->GetContextState() : NULL); 31 restorer_impl ? restorer_impl->GetContextState() : NULL);
32 } 32 }
33 33
34 void GLStateRestorerImpl::RestoreAllTextureUnitBindings() { 34 void GLStateRestorerImpl::RestoreAllTextureUnitBindings() {
35 DCHECK(decoder_.get()); 35 DCHECK(decoder_.get());
36 decoder_->RestoreAllTextureUnitBindings(NULL); 36 decoder_->RestoreAllTextureUnitBindings(NULL);
37 } 37 }
38 38
39 void GLStateRestorerImpl::RestoreActiveTexture() {
40 DCHECK(decoder_.get());
41 decoder_->RestoreActiveTexture();
42 }
43
39 void GLStateRestorerImpl::RestoreActiveTextureUnitBinding(unsigned int target) { 44 void GLStateRestorerImpl::RestoreActiveTextureUnitBinding(unsigned int target) {
40 DCHECK(decoder_.get()); 45 DCHECK(decoder_.get());
41 decoder_->RestoreActiveTextureUnitBinding(target); 46 decoder_->RestoreActiveTextureUnitBinding(target);
42 } 47 }
43 48
44 void GLStateRestorerImpl::RestoreAllExternalTextureBindingsIfNeeded() { 49 void GLStateRestorerImpl::RestoreAllExternalTextureBindingsIfNeeded() {
45 DCHECK(decoder_.get()); 50 DCHECK(decoder_.get());
46 decoder_->RestoreAllExternalTextureBindingsIfNeeded(); 51 decoder_->RestoreAllExternalTextureBindingsIfNeeded();
47 } 52 }
48 53
49 void GLStateRestorerImpl::RestoreFramebufferBindings() { 54 void GLStateRestorerImpl::RestoreFramebufferBindings() {
50 DCHECK(decoder_.get()); 55 DCHECK(decoder_.get());
51 decoder_->RestoreFramebufferBindings(); 56 decoder_->RestoreFramebufferBindings();
52 } 57 }
53 58
59 void GLStateRestorerImpl::RestoreProgramBindings() {
60 DCHECK(decoder_.get());
61 decoder_->RestoreProgramBindings();
62 }
63
64 void GLStateRestorerImpl::RestoreBufferBinding(unsigned int target) {
65 DCHECK(decoder_.get());
66 decoder_->RestoreBufferBinding(target);
67 }
68
69 void GLStateRestorerImpl::RestoreVertexAttribArray(unsigned int index) {
70 DCHECK(decoder_.get());
71 decoder_->RestoreVertexAttribArray(index);
72 }
73
54 void GLStateRestorerImpl::PauseQueries() { 74 void GLStateRestorerImpl::PauseQueries() {
55 DCHECK(decoder_.get()); 75 DCHECK(decoder_.get());
56 decoder_->GetQueryManager()->PauseQueries(); 76 decoder_->GetQueryManager()->PauseQueries();
57 } 77 }
58 78
59 void GLStateRestorerImpl::ResumeQueries() { 79 void GLStateRestorerImpl::ResumeQueries() {
60 DCHECK(decoder_.get()); 80 DCHECK(decoder_.get());
61 decoder_->GetQueryManager()->ResumeQueries(); 81 decoder_->GetQueryManager()->ResumeQueries();
62 } 82 }
63 83
64 const gles2::ContextState* GLStateRestorerImpl::GetContextState() const { 84 const gles2::ContextState* GLStateRestorerImpl::GetContextState() const {
65 DCHECK(decoder_.get()); 85 DCHECK(decoder_.get());
66 return decoder_->GetContextState(); 86 return decoder_->GetContextState();
67 } 87 }
68 88
69 } // namespace gpu 89 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698