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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.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/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 231ea24c4e6ed6ef728fca56c98f0bf42eda0cf5..58f5698424b293a2df717f45ff940fbd89185285 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -546,13 +546,14 @@ class GLES2DecoderImpl : public GLES2Decoder,
virtual gfx::GLContext* GetGLContext() OVERRIDE { return context_.get(); }
virtual ContextGroup* GetContextGroup() OVERRIDE { return group_.get(); }
virtual Capabilities GetCapabilities() OVERRIDE;
- virtual void RestoreState() const OVERRIDE;
+ virtual void RestoreState(const ContextState* prev_state) const OVERRIDE;
virtual void RestoreActiveTexture() const OVERRIDE {
state_.RestoreActiveTexture();
}
- virtual void RestoreAllTextureUnitBindings() const OVERRIDE {
- state_.RestoreAllTextureUnitBindings();
+ virtual void RestoreAllTextureUnitBindings(
+ const ContextState* prev_state) const OVERRIDE {
+ state_.RestoreAllTextureUnitBindings(prev_state);
}
virtual void RestoreAttribute(unsigned index) const OVERRIDE {
state_.RestoreAttribute(index);
@@ -570,7 +571,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
state_.RestoreRenderbufferBindings();
}
virtual void RestoreTextureUnitBindings(unsigned unit) const OVERRIDE {
- state_.RestoreTextureUnitBindings(unit);
+ state_.RestoreTextureUnitBindings(unit, NULL);
}
virtual void RestoreFramebufferBindings() const OVERRIDE;
virtual void RestoreTextureState(unsigned service_id) const OVERRIDE;
@@ -592,6 +593,7 @@ class GLES2DecoderImpl : public GLES2Decoder,
virtual Logger* GetLogger() OVERRIDE;
virtual ErrorState* GetErrorState() OVERRIDE;
+ virtual const ContextState* GetContextState() OVERRIDE { return &state_; }
virtual void SetShaderCacheCallback(
const ShaderCacheCallback& callback) OVERRIDE;
@@ -3756,14 +3758,14 @@ GLuint GLES2DecoderImpl::GetBackbufferServiceId() const {
: (surface_.get() ? surface_->GetBackingFrameBufferObject() : 0);
}
-void GLES2DecoderImpl::RestoreState() const {
+void GLES2DecoderImpl::RestoreState(const ContextState* prev_state) const {
TRACE_EVENT1("gpu", "GLES2DecoderImpl::RestoreState",
"context", logger_.GetLogPrefix());
// Restore the Framebuffer first because of bugs in Intel drivers.
// Intel drivers incorrectly clip the viewport settings to
// the size of the current framebuffer object.
RestoreFramebufferBindings();
- state_.RestoreState();
+ state_.RestoreState(prev_state);
}
void GLES2DecoderImpl::RestoreFramebufferBindings() const {
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698