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 724d537d7a7039de659aeba7ab542f7532ed7765..f14dc095b02655e6786ab744534b6f6c1a18629d 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -545,13 +545,13 @@ 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(); |
+ state_.RestoreAllTextureUnitBindings(NULL); |
} |
virtual void RestoreAttribute(unsigned index) const OVERRIDE { |
state_.RestoreAttribute(index); |
@@ -591,6 +591,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; |
@@ -3648,6 +3649,8 @@ void GLES2DecoderImpl::DoActiveTexture(GLenum texture_unit) { |
return; |
} |
state_.active_texture_unit = texture_index; |
+ state_.max_active_texture_unit_ = |
+ std::max(texture_index, state_.max_active_texture_unit_); |
glActiveTexture(texture_unit); |
} |
@@ -3761,14 +3764,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 { |