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

Side by Side Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 2126183002: Revert of Fix initialization ordering in GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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) 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/tests/gl_manager.h" 5 #include "gpu/command_buffer/tests/gl_manager.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 share_group_manager(NULL), 180 share_group_manager(NULL),
181 share_mailbox_manager(NULL), 181 share_mailbox_manager(NULL),
182 virtual_manager(NULL), 182 virtual_manager(NULL),
183 bind_generates_resource(false), 183 bind_generates_resource(false),
184 lose_context_when_out_of_memory(false), 184 lose_context_when_out_of_memory(false),
185 context_lost_allowed(false), 185 context_lost_allowed(false),
186 context_type(gles2::CONTEXT_TYPE_OPENGLES2), 186 context_type(gles2::CONTEXT_TYPE_OPENGLES2),
187 force_shader_name_hashing(false), 187 force_shader_name_hashing(false),
188 multisampled(false), 188 multisampled(false),
189 backbuffer_alpha(true), 189 backbuffer_alpha(true),
190 image_factory(nullptr) {} 190 image_factory(nullptr),
191 enable_arb_texture_rectangle(false) {}
191 192
192 GLManager::GLManager() 193 GLManager::GLManager()
193 : sync_point_manager_(nullptr), 194 : sync_point_manager_(nullptr),
194 context_lost_allowed_(false), 195 context_lost_allowed_(false),
195 pause_commands_(false), 196 pause_commands_(false),
196 paused_order_num_(0), 197 paused_order_num_(0),
197 command_buffer_id_( 198 command_buffer_id_(
198 CommandBufferId::FromUnsafeValue(g_next_command_buffer_id++)), 199 CommandBufferId::FromUnsafeValue(g_next_command_buffer_id++)),
199 next_fence_sync_release_(1) { 200 next_fence_sync_release_(1) {
200 SetupBaseContext(); 201 SetupBaseContext();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 attribs.sample_buffers = options.multisampled ? 1 : 0; 291 attribs.sample_buffers = options.multisampled ? 1 : 0;
291 attribs.alpha_size = options.backbuffer_alpha ? 8 : 0; 292 attribs.alpha_size = options.backbuffer_alpha ? 8 : 0;
292 attribs.should_use_native_gmb_for_backbuffer = 293 attribs.should_use_native_gmb_for_backbuffer =
293 options.image_factory != nullptr; 294 options.image_factory != nullptr;
294 attribs.offscreen_framebuffer_size = options.size; 295 attribs.offscreen_framebuffer_size = options.size;
295 296
296 if (!context_group) { 297 if (!context_group) {
297 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 298 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
298 scoped_refptr<gles2::FeatureInfo> feature_info = 299 scoped_refptr<gles2::FeatureInfo> feature_info =
299 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround); 300 new gles2::FeatureInfo(command_line, gpu_driver_bug_workaround);
301 if (options.enable_arb_texture_rectangle) {
302 gles2::FeatureInfo::FeatureFlags& flags =
303 const_cast<gles2::FeatureInfo::FeatureFlags&>(
304 feature_info->feature_flags());
305 flags.arb_texture_rectangle = true;
306 }
300 context_group = new gles2::ContextGroup( 307 context_group = new gles2::ContextGroup(
301 gpu_preferences_, mailbox_manager_.get(), NULL, 308 gpu_preferences_, mailbox_manager_.get(), NULL,
302 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), 309 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_),
303 new gpu::gles2::FramebufferCompletenessCache, feature_info, 310 new gpu::gles2::FramebufferCompletenessCache, feature_info,
304 options.bind_generates_resource, options.image_factory); 311 options.bind_generates_resource, options.image_factory);
305 } 312 }
306 313
307 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group)); 314 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group));
308 if (options.force_shader_name_hashing) { 315 if (options.force_shader_name_hashing) {
309 decoder_->SetForceShaderNameHashingForTest(true); 316 decoder_->SetForceShaderNameHashingForTest(true);
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 653
647 // Something went wrong, just run the callback now. 654 // Something went wrong, just run the callback now.
648 callback.Run(); 655 callback.Run();
649 } 656 }
650 657
651 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { 658 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) {
652 return false; 659 return false;
653 } 660 }
654 661
655 } // namespace gpu 662 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.h ('k') | gpu/command_buffer/tests/gl_native_gmb_backbuffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698