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

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

Issue 1871613002: Compute GpuDriverBugWorkarounds only one time in the GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 attrib_helper.blue_size = 8; 282 attrib_helper.blue_size = 8;
283 attrib_helper.alpha_size = 8; 283 attrib_helper.alpha_size = 8;
284 attrib_helper.depth_size = 16; 284 attrib_helper.depth_size = 16;
285 attrib_helper.stencil_size = 8; 285 attrib_helper.stencil_size = 8;
286 attrib_helper.context_type = options.context_type; 286 attrib_helper.context_type = options.context_type;
287 287
288 attrib_helper.Serialize(&attribs); 288 attrib_helper.Serialize(&attribs);
289 289
290 DCHECK(!command_line || !context_group); 290 DCHECK(!command_line || !context_group);
291 if (!context_group) { 291 if (!context_group) {
292 gpu::GpuDriverBugWorkarounds::Initialize(command_line,
293 gpu_driver_bug_workarounds_);
292 scoped_refptr<gles2::FeatureInfo> feature_info; 294 scoped_refptr<gles2::FeatureInfo> feature_info;
293 if (command_line) 295 if (command_line) {
294 feature_info = new gles2::FeatureInfo(*command_line); 296 gpu::GpuDriverBugWorkarounds::Initialize(command_line,
297 gpu_driver_bug_workarounds_);
298 feature_info = new gles2::FeatureInfo(*command_line,
299 gpu_driver_bug_workarounds_);
300 }
295 context_group = new gles2::ContextGroup( 301 context_group = new gles2::ContextGroup(
296 gpu_preferences_, mailbox_manager_.get(), NULL, 302 gpu_preferences_, gpu_driver_bug_workarounds_, mailbox_manager_.get(),
297 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), 303 NULL, new gpu::gles2::ShaderTranslatorCache(gpu_preferences_),
298 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL, 304 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL,
299 options.bind_generates_resource); 305 options.bind_generates_resource);
300 } 306 }
301 307
302 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group)); 308 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group));
303 if (options.force_shader_name_hashing) { 309 if (options.force_shader_name_hashing) {
304 decoder_->SetForceShaderNameHashingForTest(true); 310 decoder_->SetForceShaderNameHashingForTest(true);
305 } 311 }
306 command_buffer_.reset(new CommandBufferService( 312 command_buffer_.reset(new CommandBufferService(
307 decoder_->GetContextGroup()->transfer_buffer_manager())); 313 decoder_->GetContextGroup()->transfer_buffer_manager()));
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 sync_point_order_data_ = nullptr; 462 sync_point_order_data_ = nullptr;
457 } 463 }
458 if (decoder_.get()) { 464 if (decoder_.get()) {
459 bool have_context = decoder_->GetGLContext() && 465 bool have_context = decoder_->GetGLContext() &&
460 decoder_->GetGLContext()->MakeCurrent(surface_.get()); 466 decoder_->GetGLContext()->MakeCurrent(surface_.get());
461 decoder_->Destroy(have_context); 467 decoder_->Destroy(have_context);
462 decoder_.reset(); 468 decoder_.reset();
463 } 469 }
464 } 470 }
465 471
466 const gpu::gles2::FeatureInfo::Workarounds& GLManager::workarounds() const { 472 const gpu::GpuDriverBugWorkarounds& GLManager::workarounds() const {
467 return decoder_->GetContextGroup()->feature_info()->workarounds(); 473 return decoder_->GetContextGroup()->feature_info()->workarounds();
468 } 474 }
469 475
470 void GLManager::PumpCommands() { 476 void GLManager::PumpCommands() {
471 if (!decoder_->MakeCurrent()) { 477 if (!decoder_->MakeCurrent()) {
472 command_buffer_->SetContextLostReason(decoder_->GetContextLostReason()); 478 command_buffer_->SetContextLostReason(decoder_->GetContextLostReason());
473 command_buffer_->SetParseError(::gpu::error::kLostContext); 479 command_buffer_->SetParseError(::gpu::error::kLostContext);
474 return; 480 return;
475 } 481 }
476 uint32_t order_num = 0; 482 uint32_t order_num = 0;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 640
635 // Something went wrong, just run the callback now. 641 // Something went wrong, just run the callback now.
636 callback.Run(); 642 callback.Run();
637 } 643 }
638 644
639 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { 645 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) {
640 return false; 646 return false;
641 } 647 }
642 648
643 } // namespace gpu 649 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698