| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 manager->GetClientId(object->service_id(), &client_id); | 132 manager->GetClientId(object->service_id(), &client_id); |
| 133 } | 133 } |
| 134 return client_id; | 134 return client_id; |
| 135 } | 135 } |
| 136 | 136 |
| 137 template <typename OBJECT_TYPE> | 137 template <typename OBJECT_TYPE> |
| 138 GLuint GetServiceId(const OBJECT_TYPE* object) { | 138 GLuint GetServiceId(const OBJECT_TYPE* object) { |
| 139 return object ? object->service_id() : 0; | 139 return object ? object->service_id() : 0; |
| 140 } | 140 } |
| 141 | 141 |
| 142 bool CheckUniqueAndNonNullIds(GLsizei n, const GLuint* client_ids) { | |
| 143 if (n <= 0) | |
| 144 return true; | |
| 145 std::unordered_set<uint32_t> unique_ids(client_ids, client_ids + n); | |
| 146 return (unique_ids.size() == static_cast<size_t>(n)) && | |
| 147 (unique_ids.find(0) == unique_ids.end()); | |
| 148 } | |
| 149 | |
| 150 struct Vec4f { | 142 struct Vec4f { |
| 151 explicit Vec4f(const Vec4& data) { | 143 explicit Vec4f(const Vec4& data) { |
| 152 data.GetValues(v); | 144 data.GetValues(v); |
| 153 } | 145 } |
| 154 | 146 |
| 155 GLfloat v[4]; | 147 GLfloat v[4]; |
| 156 }; | 148 }; |
| 157 | 149 |
| 158 struct TexSubCoord3D { | 150 struct TexSubCoord3D { |
| 159 TexSubCoord3D(int _xoffset, int _yoffset, int _zoffset, | 151 TexSubCoord3D(int _xoffset, int _yoffset, int _zoffset, |
| (...skipping 17813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17973 } | 17965 } |
| 17974 | 17966 |
| 17975 // Include the auto-generated part of this file. We split this because it means | 17967 // Include the auto-generated part of this file. We split this because it means |
| 17976 // we can easily edit the non-auto generated parts right here in this file | 17968 // we can easily edit the non-auto generated parts right here in this file |
| 17977 // instead of having to edit some template or the code generator. | 17969 // instead of having to edit some template or the code generator. |
| 17978 #include "base/macros.h" | 17970 #include "base/macros.h" |
| 17979 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 17971 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 17980 | 17972 |
| 17981 } // namespace gles2 | 17973 } // namespace gles2 |
| 17982 } // namespace gpu | 17974 } // namespace gpu |
| OLD | NEW |