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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 attrib->type(), | 366 attrib->type(), |
367 attrib->normalized(), | 367 attrib->normalized(), |
368 attrib->gl_stride(), | 368 attrib->gl_stride(), |
369 ptr); | 369 ptr); |
370 | 370 |
371 // Restore attrib divisor if supported. | 371 // Restore attrib divisor if supported. |
372 if (feature_info_->feature_flags().angle_instanced_arrays) | 372 if (feature_info_->feature_flags().angle_instanced_arrays) |
373 glVertexAttribDivisorANGLE(attrib_index, attrib->divisor()); | 373 glVertexAttribDivisorANGLE(attrib_index, attrib->divisor()); |
374 | 374 |
375 // Never touch vertex attribute 0's state (in particular, never | 375 // Never touch vertex attribute 0's state (in particular, never |
376 // disable it) when running on desktop GL because it will never be | 376 // disable it) when running on desktop GL with compatibility profile |
377 // re-enabled. | 377 // because it will never be re-enabled. |
378 if (attrib_index != 0 || | 378 if (attrib_index != 0 || |
379 gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) { | 379 feature_info_->gl_version_info().BehavesLikeGLES()) { |
380 if (attrib->enabled()) { | 380 if (attrib->enabled()) { |
381 glEnableVertexAttribArray(attrib_index); | 381 glEnableVertexAttribArray(attrib_index); |
382 } else { | 382 } else { |
383 glDisableVertexAttribArray(attrib_index); | 383 glDisableVertexAttribArray(attrib_index); |
384 } | 384 } |
385 } | 385 } |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 void ContextState::RestoreVertexAttribs() const { | 389 void ContextState::RestoreVertexAttribs() const { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 UpdateUnpackParameters(); | 626 UpdateUnpackParameters(); |
627 } | 627 } |
628 | 628 |
629 // Include the auto-generated part of this file. We split this because it means | 629 // Include the auto-generated part of this file. We split this because it means |
630 // we can easily edit the non-auto generated parts right here in this file | 630 // we can easily edit the non-auto generated parts right here in this file |
631 // instead of having to edit some template or the code generator. | 631 // instead of having to edit some template or the code generator. |
632 #include "gpu/command_buffer/service/context_state_impl_autogen.h" | 632 #include "gpu/command_buffer/service/context_state_impl_autogen.h" |
633 | 633 |
634 } // namespace gles2 | 634 } // namespace gles2 |
635 } // namespace gpu | 635 } // namespace gpu |
OLD | NEW |