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

Unified Diff: gpu/command_buffer/service/gl_state_restorer_impl.cc

Issue 118203002: During virtual context switches only restore texture units that have changed from the previous cont… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change mock GetContextState to return const ContextState* instead of non-const Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gl_state_restorer_impl.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gl_state_restorer_impl.cc
diff --git a/gpu/command_buffer/service/gl_state_restorer_impl.cc b/gpu/command_buffer/service/gl_state_restorer_impl.cc
index 7b3c5ed384148318cde872d3a1c343ccb488feab..710eb2a42330c7c948b1014ec717576758fc3c2e 100644
--- a/gpu/command_buffer/service/gl_state_restorer_impl.cc
+++ b/gpu/command_buffer/service/gl_state_restorer_impl.cc
@@ -21,14 +21,17 @@ 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::RestoreFramebufferBindings() {
@@ -36,4 +39,9 @@ void GLStateRestorerImpl::RestoreFramebufferBindings() {
decoder_->RestoreFramebufferBindings();
}
+const gles2::ContextState* GLStateRestorerImpl::GetContextState() const {
+ DCHECK(decoder_.get());
+ return decoder_->GetContextState();
+}
+
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/gl_state_restorer_impl.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698