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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 RestoreProgramBindings(); | 428 RestoreProgramBindings(); |
429 RestoreGlobalState(prev_state); | 429 RestoreGlobalState(prev_state); |
430 } | 430 } |
431 | 431 |
432 ErrorState* ContextState::GetErrorState() { | 432 ErrorState* ContextState::GetErrorState() { |
433 return error_state_.get(); | 433 return error_state_.get(); |
434 } | 434 } |
435 | 435 |
436 void ContextState::EnableDisable(GLenum pname, bool enable) const { | 436 void ContextState::EnableDisable(GLenum pname, bool enable) const { |
437 if (pname == GL_PRIMITIVE_RESTART_FIXED_INDEX) { | 437 if (pname == GL_PRIMITIVE_RESTART_FIXED_INDEX) { |
438 if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) | 438 if (feature_info_->feature_flags().emulate_primitive_restart_fixed_index) |
Zhenyao Mo
2016/03/29 16:30:15
nit: {} for the body when there are multiple lines
Ken Russell (switch to Gerrit)
2016/03/30 01:04:59
Agree.
yunchao
2016/03/30 08:25:22
Done.
| |
439 pname = GL_PRIMITIVE_RESTART; | 439 // GLES2DecoderImpl::DoDrawElements can handle this situation |
440 return; | |
440 } | 441 } |
441 if (enable) { | 442 if (enable) { |
442 glEnable(pname); | 443 glEnable(pname); |
443 } else { | 444 } else { |
444 glDisable(pname); | 445 glDisable(pname); |
445 } | 446 } |
446 } | 447 } |
447 | 448 |
448 void ContextState::UpdatePackParameters() const { | 449 void ContextState::UpdatePackParameters() const { |
449 if (!feature_info_->IsES3Capable()) | 450 if (!feature_info_->IsES3Capable()) |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
622 UpdateUnpackParameters(); | 623 UpdateUnpackParameters(); |
623 } | 624 } |
624 | 625 |
625 // Include the auto-generated part of this file. We split this because it means | 626 // Include the auto-generated part of this file. We split this because it means |
626 // we can easily edit the non-auto generated parts right here in this file | 627 // we can easily edit the non-auto generated parts right here in this file |
627 // instead of having to edit some template or the code generator. | 628 // instead of having to edit some template or the code generator. |
628 #include "gpu/command_buffer/service/context_state_impl_autogen.h" | 629 #include "gpu/command_buffer/service/context_state_impl_autogen.h" |
629 | 630 |
630 } // namespace gles2 | 631 } // namespace gles2 |
631 } // namespace gpu | 632 } // namespace gpu |
OLD | NEW |