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

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

Issue 2670213005: Hook ANGLE_request_extension up to the passthrough cmd decoder. (Closed)
Patch Set: Fix extension check. 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 "gpu/command_buffer/service/feature_info.h" 7 #include "gpu/command_buffer/service/feature_info.h"
8 #include "gpu/command_buffer/service/gl_utils.h" 8 #include "gpu/command_buffer/service/gl_utils.h"
9 #include "ui/gl/gl_version_info.h" 9 #include "ui/gl/gl_version_info.h"
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 texture_object_map.clear(); 69 texture_object_map.clear();
70 } 70 }
71 71
72 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) 72 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group)
73 : commands_to_process_(0), 73 : commands_to_process_(0),
74 debug_marker_manager_(), 74 debug_marker_manager_(),
75 logger_(&debug_marker_manager_), 75 logger_(&debug_marker_manager_),
76 surface_(), 76 surface_(),
77 context_(), 77 context_(),
78 group_(group), 78 group_(group),
79 feature_info_(group->feature_info()) { 79 feature_info_(new FeatureInfo) {
80 DCHECK(group); 80 DCHECK(group);
81 } 81 }
82 82
83 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} 83 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {}
84 84
85 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( 85 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands(
86 unsigned int num_commands, 86 unsigned int num_commands,
87 const volatile void* buffer, 87 const volatile void* buffer,
88 int num_entries, 88 int num_entries,
89 int* entries_processed) { 89 int* entries_processed) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 context_ = context; 162 context_ = context;
163 surface_ = surface; 163 surface_ = surface;
164 164
165 if (!group_->Initialize(this, attrib_helper.context_type, 165 if (!group_->Initialize(this, attrib_helper.context_type,
166 disallowed_features)) { 166 disallowed_features)) {
167 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. 167 group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
168 Destroy(true); 168 Destroy(true);
169 return false; 169 return false;
170 } 170 }
171 171
172 // Each context initializes its own feature info because some extensions may
173 // be enabled dynamically
Zhenyao Mo 2017/02/06 22:31:38 I am wondering if this is necessary - WebGL has no
Geoff Lang 2017/02/07 19:01:15 I wanted to be sure that the feature info doesn't
174 DisallowedFeatures adjusted_disallowed_features =
175 AdjustDisallowedFeatures(attrib_helper.context_type, disallowed_features);
176 if (!feature_info_->Initialize(attrib_helper.context_type,
177 adjusted_disallowed_features)) {
178 Destroy(true);
179 return false;
180 }
181
172 // Check for required extensions 182 // Check for required extensions
173 if (!feature_info_->feature_flags().angle_robust_client_memory || 183 if (!feature_info_->feature_flags().angle_robust_client_memory ||
174 !feature_info_->feature_flags().chromium_bind_generates_resource) { 184 !feature_info_->feature_flags().chromium_bind_generates_resource ||
175 // TODO(geofflang): Verify that ANGLE_webgl_compatibility is enabled if this 185 feature_info_->feature_flags().angle_webgl_compatibility !=
176 // is a WebGL context (depends on crbug.com/671217). 186 IsWebGLContextType(attrib_helper.context_type) ||
187 !feature_info_->feature_flags().angle_request_extension) {
177 Destroy(true); 188 Destroy(true);
178 return false; 189 return false;
179 } 190 }
180 191
181 image_manager_.reset(new ImageManager()); 192 image_manager_.reset(new ImageManager());
182 193
183 bind_generates_resource_ = group_->bind_generates_resource(); 194 bind_generates_resource_ = group_->bind_generates_resource();
184 195
185 resources_ = group_->passthrough_resources(); 196 resources_ = group_->passthrough_resources();
186 197
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 }, /* NOLINT */ 860 }, /* NOLINT */
850 861
851 const GLES2DecoderPassthroughImpl::CommandInfo 862 const GLES2DecoderPassthroughImpl::CommandInfo
852 GLES2DecoderPassthroughImpl::command_info[] = { 863 GLES2DecoderPassthroughImpl::command_info[] = {
853 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; 864 GLES2_COMMAND_LIST(GLES2_CMD_OP)};
854 865
855 #undef GLES2_CMD_OP 866 #undef GLES2_CMD_OP
856 867
857 } // namespace gles2 868 } // namespace gles2
858 } // namespace gpu 869 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698