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

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

Issue 2689203002: Check for some extensions before calling potentially NULL GL entry points. (Closed)
Patch Set: Revert discard_framebuffer functional change Created 3 years, 10 months 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/gles2_cmd_decoder_passthrough.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h"
6 6
7 #include "base/strings/string_split.h"
7 #include "gpu/command_buffer/service/feature_info.h" 8 #include "gpu/command_buffer/service/feature_info.h"
8 #include "gpu/command_buffer/service/gl_utils.h" 9 #include "gpu/command_buffer/service/gl_utils.h"
9 #include "ui/gl/gl_version_info.h" 10 #include "ui/gl/gl_version_info.h"
10 11
11 namespace gpu { 12 namespace gpu {
12 namespace gles2 { 13 namespace gles2 {
13 14
14 namespace { 15 namespace {
15 template <typename ClientType, typename ServiceType, typename DeleteFunction> 16 template <typename ClientType, typename ServiceType, typename DeleteFunction>
16 void DeleteServiceObjects(ClientServiceMap<ClientType, ServiceType>* id_map, 17 void DeleteServiceObjects(ClientServiceMap<ClientType, ServiceType>* id_map,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 167
167 if (!group_->Initialize(this, attrib_helper.context_type, 168 if (!group_->Initialize(this, attrib_helper.context_type,
168 disallowed_features)) { 169 disallowed_features)) {
169 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. 170 group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
170 Destroy(true); 171 Destroy(true);
171 return false; 172 return false;
172 } 173 }
173 174
174 // Check for required extensions 175 // Check for required extensions
175 if (!feature_info_->feature_flags().angle_robust_client_memory || 176 if (!feature_info_->feature_flags().angle_robust_client_memory ||
176 !feature_info_->feature_flags().chromium_bind_generates_resource) { 177 !feature_info_->feature_flags().chromium_bind_generates_resource ||
178 !feature_info_->feature_flags().chromium_copy_texture ||
179 !feature_info_->feature_flags().chromium_copy_compressed_texture) {
177 // TODO(geofflang): Verify that ANGLE_webgl_compatibility is enabled if this 180 // TODO(geofflang): Verify that ANGLE_webgl_compatibility is enabled if this
178 // is a WebGL context (depends on crbug.com/671217). 181 // is a WebGL context (depends on crbug.com/671217).
179 Destroy(true); 182 Destroy(true);
180 return false; 183 return false;
181 } 184 }
182 185
183 image_manager_.reset(new ImageManager()); 186 image_manager_.reset(new ImageManager());
184 187
185 bind_generates_resource_ = group_->bind_generates_resource(); 188 bind_generates_resource_ = group_->bind_generates_resource();
186 189
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 }, /* NOLINT */ 858 }, /* NOLINT */
856 859
857 const GLES2DecoderPassthroughImpl::CommandInfo 860 const GLES2DecoderPassthroughImpl::CommandInfo
858 GLES2DecoderPassthroughImpl::command_info[] = { 861 GLES2DecoderPassthroughImpl::command_info[] = {
859 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; 862 GLES2_COMMAND_LIST(GLES2_CMD_OP)};
860 863
861 #undef GLES2_CMD_OP 864 #undef GLES2_CMD_OP
862 865
863 } // namespace gles2 866 } // namespace gles2
864 } // namespace gpu 867 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698