OLD | NEW |
---|---|
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/context_state.h" | 5 #include "gpu/command_buffer/service/context_state.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
488 | 488 |
489 void ContextState::RestoreState(const ContextState* prev_state) { | 489 void ContextState::RestoreState(const ContextState* prev_state) { |
490 RestoreAllTextureUnitBindings(prev_state); | 490 RestoreAllTextureUnitBindings(prev_state); |
491 RestoreVertexAttribs(); | 491 RestoreVertexAttribs(); |
492 RestoreBufferBindings(); | 492 RestoreBufferBindings(); |
493 RestoreRenderbufferBindings(); | 493 RestoreRenderbufferBindings(); |
494 RestoreProgramSettings(prev_state, true); | 494 RestoreProgramSettings(prev_state, true); |
495 RestoreIndexedUniformBufferBindings(prev_state); | 495 RestoreIndexedUniformBufferBindings(prev_state); |
496 RestoreGlobalState(prev_state); | 496 RestoreGlobalState(prev_state); |
497 | 497 |
498 if (prev_state && framebuffer_srgb_ != prev_state->framebuffer_srgb_) { | 498 if (!prev_state) { |
499 if (feature_info_->feature_flags().desktop_srgb_support) { | |
500 glDisable(GL_FRAMEBUFFER_SRGB); | |
Zhenyao Mo
2016/08/19 17:16:59
We need to set framebuffer_srgb_ to false here.
qiankun
2016/08/19 22:03:15
Done.
| |
501 } | |
502 } else if (framebuffer_srgb_ != prev_state->framebuffer_srgb_) { | |
499 // FRAMEBUFFER_SRGB will be restored lazily at render time. | 503 // FRAMEBUFFER_SRGB will be restored lazily at render time. |
500 framebuffer_srgb_ = prev_state->framebuffer_srgb_; | 504 framebuffer_srgb_ = prev_state->framebuffer_srgb_; |
501 } | 505 } |
502 } | 506 } |
503 | 507 |
504 ErrorState* ContextState::GetErrorState() { | 508 ErrorState* ContextState::GetErrorState() { |
505 return error_state_.get(); | 509 return error_state_.get(); |
506 } | 510 } |
507 | 511 |
508 void ContextState::EnableDisable(GLenum pname, bool enable) const { | 512 void ContextState::EnableDisable(GLenum pname, bool enable) const { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
702 UpdateUnpackParameters(); | 706 UpdateUnpackParameters(); |
703 } | 707 } |
704 | 708 |
705 // Include the auto-generated part of this file. We split this because it means | 709 // Include the auto-generated part of this file. We split this because it means |
706 // we can easily edit the non-auto generated parts right here in this file | 710 // we can easily edit the non-auto generated parts right here in this file |
707 // instead of having to edit some template or the code generator. | 711 // instead of having to edit some template or the code generator. |
708 #include "gpu/command_buffer/service/context_state_impl_autogen.h" | 712 #include "gpu/command_buffer/service/context_state_impl_autogen.h" |
709 | 713 |
710 } // namespace gles2 | 714 } // namespace gles2 |
711 } // namespace gpu | 715 } // namespace gpu |
OLD | NEW |