| 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 11545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11556 case GL_GET_ERROR_QUERY_CHROMIUM: | 11556 case GL_GET_ERROR_QUERY_CHROMIUM: |
| 11557 break; | 11557 break; |
| 11558 case GL_COMMANDS_COMPLETED_CHROMIUM: | 11558 case GL_COMMANDS_COMPLETED_CHROMIUM: |
| 11559 if (!features().chromium_sync_query) { | 11559 if (!features().chromium_sync_query) { |
| 11560 LOCAL_SET_GL_ERROR( | 11560 LOCAL_SET_GL_ERROR( |
| 11561 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11561 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11562 "not enabled for commands completed queries"); | 11562 "not enabled for commands completed queries"); |
| 11563 return error::kNoError; | 11563 return error::kNoError; |
| 11564 } | 11564 } |
| 11565 break; | 11565 break; |
| 11566 case GL_SAMPLES_PASSED: | 11566 default: |
| 11567 case GL_ANY_SAMPLES_PASSED: | |
| 11568 case GL_ANY_SAMPLES_PASSED_CONSERVATIVE: | |
| 11569 if (!features().occlusion_query_boolean) { | 11567 if (!features().occlusion_query_boolean) { |
| 11570 LOCAL_SET_GL_ERROR( | 11568 LOCAL_SET_GL_ERROR( |
| 11571 GL_INVALID_OPERATION, "glBeginQueryEXT", | 11569 GL_INVALID_OPERATION, "glBeginQueryEXT", |
| 11572 "not enabled for occlusion queries"); | 11570 "not enabled for occlusion queries"); |
| 11573 return error::kNoError; | 11571 return error::kNoError; |
| 11574 } | 11572 } |
| 11575 break; | 11573 break; |
| 11576 case GL_TIME_ELAPSED: | |
| 11577 if (!query_manager_->GPUTimingAvailable()) { | |
| 11578 LOCAL_SET_GL_ERROR( | |
| 11579 GL_INVALID_OPERATION, "glBeginQueryEXT", | |
| 11580 "not enabled for timing queries"); | |
| 11581 return error::kNoError; | |
| 11582 } | |
| 11583 break; | |
| 11584 default: | |
| 11585 LOCAL_SET_GL_ERROR( | |
| 11586 GL_INVALID_OPERATION, "glBeginQueryEXT", | |
| 11587 "unknown query target"); | |
| 11588 return error::kNoError; | |
| 11589 } | 11574 } |
| 11590 | 11575 |
| 11591 if (state_.current_queries.find(target) != state_.current_queries.end()) { | 11576 if (state_.current_queries.find(target) != state_.current_queries.end()) { |
| 11592 LOCAL_SET_GL_ERROR( | 11577 LOCAL_SET_GL_ERROR( |
| 11593 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); | 11578 GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress"); |
| 11594 return error::kNoError; | 11579 return error::kNoError; |
| 11595 } | 11580 } |
| 11596 | 11581 |
| 11597 if (client_id == 0) { | 11582 if (client_id == 0) { |
| 11598 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); | 11583 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glBeginQueryEXT", "id is 0"); |
| (...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13694 } | 13679 } |
| 13695 } | 13680 } |
| 13696 | 13681 |
| 13697 // Include the auto-generated part of this file. We split this because it means | 13682 // Include the auto-generated part of this file. We split this because it means |
| 13698 // we can easily edit the non-auto generated parts right here in this file | 13683 // we can easily edit the non-auto generated parts right here in this file |
| 13699 // instead of having to edit some template or the code generator. | 13684 // instead of having to edit some template or the code generator. |
| 13700 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 13685 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 13701 | 13686 |
| 13702 } // namespace gles2 | 13687 } // namespace gles2 |
| 13703 } // namespace gpu | 13688 } // namespace gpu |
| OLD | NEW |