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

Side by Side Diff: gpu/command_buffer/service/context_state.cc

Issue 1822643002: [Command buffer] Enable primitive restart for WebGL 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bug Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/buffer_manager_unittest.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698