| 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
| 10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
| (...skipping 4813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4824 // if id does not have an object | 4824 // if id does not have an object |
| 4825 QueryTracker::Query* query = query_tracker_->GetQuery(id); | 4825 QueryTracker::Query* query = query_tracker_->GetQuery(id); |
| 4826 if (!query) { | 4826 if (!query) { |
| 4827 query = query_tracker_->CreateQuery(id, target); | 4827 query = query_tracker_->CreateQuery(id, target); |
| 4828 if (!query) { | 4828 if (!query) { |
| 4829 SetGLError(GL_OUT_OF_MEMORY, | 4829 SetGLError(GL_OUT_OF_MEMORY, |
| 4830 "glBeginQueryEXT", | 4830 "glBeginQueryEXT", |
| 4831 "transfer buffer allocation failed"); | 4831 "transfer buffer allocation failed"); |
| 4832 return; | 4832 return; |
| 4833 } | 4833 } |
| 4834 } else if (query->target() != target) { | 4834 } else if (!query->UpdateTarget(target)) { |
| 4835 SetGLError( | 4835 SetGLError( |
| 4836 GL_INVALID_OPERATION, "glBeginQueryEXT", "target does not match"); | 4836 GL_INVALID_OPERATION, "glBeginQueryEXT", "target does not match"); |
| 4837 return; | 4837 return; |
| 4838 } | 4838 } |
| 4839 | 4839 |
| 4840 current_queries_[target] = query; | 4840 current_queries_[target] = query; |
| 4841 | 4841 |
| 4842 query->Begin(this); | 4842 query->Begin(this); |
| 4843 CheckGLError(); | 4843 CheckGLError(); |
| 4844 } | 4844 } |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5799 CheckGLError(); | 5799 CheckGLError(); |
| 5800 } | 5800 } |
| 5801 | 5801 |
| 5802 // Include the auto-generated part of this file. We split this because it means | 5802 // Include the auto-generated part of this file. We split this because it means |
| 5803 // we can easily edit the non-auto generated parts right here in this file | 5803 // we can easily edit the non-auto generated parts right here in this file |
| 5804 // instead of having to edit some template or the code generator. | 5804 // instead of having to edit some template or the code generator. |
| 5805 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 5805 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 5806 | 5806 |
| 5807 } // namespace gles2 | 5807 } // namespace gles2 |
| 5808 } // namespace gpu | 5808 } // namespace gpu |
| OLD | NEW |