diff options
Diffstat (limited to 'chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc')
-rw-r--r-- | chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc b/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc index 7b3c5ed3841..5fbd425f695 100644 --- a/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc +++ b/chromium/gpu/command_buffer/service/gl_state_restorer_impl.cc @@ -21,14 +21,22 @@ bool GLStateRestorerImpl::IsInitialized() { return decoder_->initialized(); } -void GLStateRestorerImpl::RestoreState() { +void GLStateRestorerImpl::RestoreState(const gfx::GLStateRestorer* prev_state) { DCHECK(decoder_.get()); - decoder_->RestoreState(); + const GLStateRestorerImpl* restorer_impl = + static_cast<const GLStateRestorerImpl*>(prev_state); + decoder_->RestoreState( + restorer_impl ? restorer_impl->GetContextState() : NULL); } void GLStateRestorerImpl::RestoreAllTextureUnitBindings() { DCHECK(decoder_.get()); - decoder_->RestoreAllTextureUnitBindings(); + decoder_->RestoreAllTextureUnitBindings(NULL); +} + +void GLStateRestorerImpl::RestoreActiveTextureUnitBinding(unsigned int target) { + DCHECK(decoder_.get()); + decoder_->RestoreActiveTextureUnitBinding(target); } void GLStateRestorerImpl::RestoreFramebufferBindings() { @@ -36,4 +44,9 @@ void GLStateRestorerImpl::RestoreFramebufferBindings() { decoder_->RestoreFramebufferBindings(); } +const gles2::ContextState* GLStateRestorerImpl::GetContextState() const { + DCHECK(decoder_.get()); + return decoder_->GetContextState(); +} + } // namespace gpu |