Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1523)

Side by Side Diff: gpu/command_buffer/service/gl_utils.cc

Issue 2558933003: Cache GL's viewport on the GPU command buffer client side. (Closed)
Patch Set: fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 &caps->max_fragment_uniform_vectors); 167 &caps->max_fragment_uniform_vectors);
168 glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &caps->max_renderbuffer_size); 168 glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &caps->max_renderbuffer_size);
169 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &caps->max_texture_image_units); 169 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &caps->max_texture_image_units);
170 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &caps->max_texture_size); 170 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &caps->max_texture_size);
171 glGetIntegerv(GL_MAX_VARYING_VECTORS, &caps->max_varying_vectors); 171 glGetIntegerv(GL_MAX_VARYING_VECTORS, &caps->max_varying_vectors);
172 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &caps->max_vertex_attribs); 172 glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &caps->max_vertex_attribs);
173 glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, 173 glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS,
174 &caps->max_vertex_texture_image_units); 174 &caps->max_vertex_texture_image_units);
175 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, 175 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS,
176 &caps->max_vertex_uniform_vectors); 176 &caps->max_vertex_uniform_vectors);
177 {
178 GLint dims[2] = {0, 0};
179 glGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims);
180 caps->max_viewport_width = dims[0];
181 caps->max_viewport_height = dims[1];
182 }
177 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, 183 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS,
178 &caps->num_compressed_texture_formats); 184 &caps->num_compressed_texture_formats);
179 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &caps->num_shader_binary_formats); 185 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &caps->num_shader_binary_formats);
180 186
181 if (feature_info->IsWebGL2OrES3Context()) { 187 if (feature_info->IsWebGL2OrES3Context()) {
182 glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &caps->max_3d_texture_size); 188 glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &caps->max_3d_texture_size);
183 glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &caps->max_array_texture_layers); 189 glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &caps->max_array_texture_layers);
184 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &caps->max_color_attachments); 190 glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &caps->max_color_attachments);
185 glGetInteger64v(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, 191 glGetInteger64v(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,
186 &caps->max_combined_fragment_uniform_components); 192 &caps->max_combined_fragment_uniform_components);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW, 0, 304 glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DEBUG_SEVERITY_LOW, 0,
299 nullptr, GL_FALSE); 305 nullptr, GL_FALSE);
300 glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, 306 glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE,
301 GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE); 307 GL_DEBUG_SEVERITY_NOTIFICATION, 0, nullptr, GL_FALSE);
302 308
303 glDebugMessageCallback(&LogGLDebugMessage, nullptr); 309 glDebugMessageCallback(&LogGLDebugMessage, nullptr);
304 } 310 }
305 311
306 } // namespace gles2 312 } // namespace gles2
307 } // namespace gpu 313 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/capabilities.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698