| 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 <cmath> | 10 #include <cmath> |
| (...skipping 11573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11584 case GL_GET_ERROR_QUERY_CHROMIUM: | 11584 case GL_GET_ERROR_QUERY_CHROMIUM: |
| 11585 break; | 11585 break; |
| 11586 case GL_COMMANDS_COMPLETED_CHROMIUM: | 11586 case GL_COMMANDS_COMPLETED_CHROMIUM: |
| 11587 if (!features().chromium_sync_query) { | 11587 if (!features().chromium_sync_query) { |
| 11588 LOCAL_SET_GL_ERROR( | 11588 LOCAL_SET_GL_ERROR( |
| 11589 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11589 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11590 "not enabled for commands completed queries"); | 11590 "not enabled for commands completed queries"); |
| 11591 return error::kNoError; | 11591 return error::kNoError; |
| 11592 } | 11592 } |
| 11593 break; | 11593 break; |
| 11594 default: | 11594 case GL_SAMPLES_PASSED: |
| 11595 case GL_ANY_SAMPLES_PASSED: |
| 11596 case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: |
| 11595 if (!features().occlusion_query_boolean) { | 11597 if (!features().occlusion_query_boolean) { |
| 11596 LOCAL_SET_GL_ERROR( | 11598 LOCAL_SET_GL_ERROR( |
| 11597 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11599 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11598 "not enabled for occlusion queries"); | 11600 "not enabled for occlusion queries"); |
| 11599 return error::kNoError; | 11601 return error::kNoError; |
| 11600 } | 11602 } |
| 11601 break; | 11603 break; |
| 11604 case GL_TIME_ELAPSED: |
| 11605 if (!query_manager_->GPUTimingAvailable()) { |
| 11606 LOCAL_SET_GL_ERROR( |
| 11607 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11608 "not enabled for timing queries"); |
| 11609 return error::kNoError; |
| 11610 } |
| 11611 break; |
| 11612 default: |
| 11613 LOCAL_SET_GL_ERROR( |
| 11614 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11615 "unknown query target"); |
| 11616 return error::kNoError; |
| 11602 } | 11617 } |
| 11603 | 11618 |
| 11604 if (state_.current_queries.find(target) != state_.current_queries.end()) { | 11619 if (state_.current_queries.find(target) != state_.current_queries.end()) { |
| 11605 LOCAL_SET_GL_ERROR( | 11620 LOCAL_SET_GL_ERROR( |
| 11606 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); | 11621 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); |
| 11607 return error::kNoError; | 11622 return error::kNoError; |
| 11608 } | 11623 } |
| 11609 | 11624 |
| 11610 if (client_id == 0) { | 11625 if (client_id == 0) { |
| 11611 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); | 11626 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); |
| (...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13703 } | 13718 } |
| 13704 } | 13719 } |
| 13705 | 13720 |
| 13706 // Include the auto-generated part of this file. We split this because it means | 13721 // Include the auto-generated part of this file. We split this because it means |
| 13707 // we can easily edit the non-auto generated parts right here in this file | 13722 // we can easily edit the non-auto generated parts right here in this file |
| 13708 // instead of having to edit some template or the code generator. | 13723 // instead of having to edit some template or the code generator. |
| 13709 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13724 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 13710 | 13725 |
| 13711 } // namespace gles2 | 13726 } // namespace gles2 |
| 13712 } // namespace gpu | 13727 } // namespace gpu |
| OLD | NEW |