OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/gl_utils.h" | 5 #include "gpu/command_buffer/service/gl_utils.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "gpu/command_buffer/common/capabilities.h" | 8 #include "gpu/command_buffer/common/capabilities.h" |
9 #include "gpu/command_buffer/service/feature_info.h" | 9 #include "gpu/command_buffer/service/feature_info.h" |
10 #include "ui/gl/gl_version_info.h" | 10 #include "ui/gl/gl_version_info.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 caps->major_version = 3; | 169 caps->major_version = 3; |
170 caps->minor_version = 0; | 170 caps->minor_version = 0; |
171 } | 171 } |
172 if (feature_info->feature_flags().multisampled_render_to_texture || | 172 if (feature_info->feature_flags().multisampled_render_to_texture || |
173 feature_info->feature_flags().chromium_framebuffer_multisample || | 173 feature_info->feature_flags().chromium_framebuffer_multisample || |
174 feature_info->IsES3Enabled()) { | 174 feature_info->IsES3Enabled()) { |
175 glGetIntegerv(GL_MAX_SAMPLES, &caps->max_samples); | 175 glGetIntegerv(GL_MAX_SAMPLES, &caps->max_samples); |
176 } | 176 } |
177 } | 177 } |
178 | 178 |
| 179 bool CheckUniqueAndNonNullIds(GLsizei n, const GLuint* client_ids) { |
| 180 if (n <= 0) |
| 181 return true; |
| 182 std::unordered_set<uint32_t> unique_ids(client_ids, client_ids + n); |
| 183 return (unique_ids.size() == static_cast<size_t>(n)) && |
| 184 (unique_ids.find(0) == unique_ids.end()); |
| 185 } |
| 186 |
179 } // namespace gles2 | 187 } // namespace gles2 |
180 } // namespace gpu | 188 } // namespace gpu |
OLD | NEW |