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/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 6429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6440 function_name, max_vertex_accessed, &simulated_fixed_attribs, | 6440 function_name, max_vertex_accessed, &simulated_fixed_attribs, |
6441 primcount)) { | 6441 primcount)) { |
6442 bool textures_set = !PrepareTexturesForRender(); | 6442 bool textures_set = !PrepareTexturesForRender(); |
6443 ApplyDirtyState(); | 6443 ApplyDirtyState(); |
6444 ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get()); | 6444 ScopedRenderTo do_render(framebuffer_state_.bound_draw_framebuffer.get()); |
6445 if (!instanced) { | 6445 if (!instanced) { |
6446 glDrawArrays(mode, first, count); | 6446 glDrawArrays(mode, first, count); |
6447 } else { | 6447 } else { |
6448 glDrawArraysInstancedANGLE(mode, first, count, primcount); | 6448 glDrawArraysInstancedANGLE(mode, first, count, primcount); |
6449 } | 6449 } |
6450 ProcessPendingQueries(); | |
6451 if (textures_set) { | 6450 if (textures_set) { |
6452 RestoreStateForTextures(); | 6451 RestoreStateForTextures(); |
6453 } | 6452 } |
6454 if (simulated_fixed_attribs) { | 6453 if (simulated_fixed_attribs) { |
6455 RestoreStateForSimulatedFixedAttribs(); | 6454 RestoreStateForSimulatedFixedAttribs(); |
6456 } | 6455 } |
6457 } | 6456 } |
6458 if (simulated_attrib_0) { | 6457 if (simulated_attrib_0) { |
6459 // We don't have to restore attrib 0 generic data at the end of this | 6458 // We don't have to restore attrib 0 generic data at the end of this |
6460 // function even if it is simulated. This is because we will simulate | 6459 // function even if it is simulated. This is because we will simulate |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6580 glDrawElements(mode, count, type, indices); | 6579 glDrawElements(mode, count, type, indices); |
6581 } else { | 6580 } else { |
6582 glDrawElementsInstancedANGLE(mode, count, type, indices, primcount); | 6581 glDrawElementsInstancedANGLE(mode, count, type, indices, primcount); |
6583 } | 6582 } |
6584 | 6583 |
6585 if (used_client_side_array) { | 6584 if (used_client_side_array) { |
6586 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, | 6585 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, |
6587 element_array_buffer->service_id()); | 6586 element_array_buffer->service_id()); |
6588 } | 6587 } |
6589 | 6588 |
6590 ProcessPendingQueries(); | |
6591 if (textures_set) { | 6589 if (textures_set) { |
6592 RestoreStateForTextures(); | 6590 RestoreStateForTextures(); |
6593 } | 6591 } |
6594 if (simulated_fixed_attribs) { | 6592 if (simulated_fixed_attribs) { |
6595 RestoreStateForSimulatedFixedAttribs(); | 6593 RestoreStateForSimulatedFixedAttribs(); |
6596 } | 6594 } |
6597 } | 6595 } |
6598 if (simulated_attrib_0) { | 6596 if (simulated_attrib_0) { |
6599 // We don't have to restore attrib 0 generic data at the end of this | 6597 // We don't have to restore attrib 0 generic data at the end of this |
6600 // function even if it is simulated. This is because we will simulate | 6598 // function even if it is simulated. This is because we will simulate |
(...skipping 4206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10807 } | 10805 } |
10808 } | 10806 } |
10809 | 10807 |
10810 // Include the auto-generated part of this file. We split this because it means | 10808 // Include the auto-generated part of this file. We split this because it means |
10811 // we can easily edit the non-auto generated parts right here in this file | 10809 // we can easily edit the non-auto generated parts right here in this file |
10812 // instead of having to edit some template or the code generator. | 10810 // instead of having to edit some template or the code generator. |
10813 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10811 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10814 | 10812 |
10815 } // namespace gles2 | 10813 } // namespace gles2 |
10816 } // namespace gpu | 10814 } // namespace gpu |
OLD | NEW |