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

Side by Side Diff: components/mus/gles2/command_buffer_driver.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: Rebase 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
« no previous file with comments | « no previous file | components/mus/gles2/gpu_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/mus/gles2/command_buffer_driver.h" 5 #include "components/mus/gles2/command_buffer_driver.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 gpu_state_->share_group(), surface_.get(), gfx::PreferIntegratedGpu); 122 gpu_state_->share_group(), surface_.get(), gfx::PreferIntegratedGpu);
123 if (!context_.get()) 123 if (!context_.get())
124 return false; 124 return false;
125 125
126 if (!context_->MakeCurrent(surface_.get())) 126 if (!context_->MakeCurrent(surface_.get()))
127 return false; 127 return false;
128 128
129 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but 129 // TODO(piman): ShaderTranslatorCache is currently per-ContextGroup but
130 // only needs to be per-thread. 130 // only needs to be per-thread.
131 const bool bind_generates_resource = attrib_helper.bind_generates_resource; 131 const bool bind_generates_resource = attrib_helper.bind_generates_resource;
132 scoped_refptr<gpu::gles2::FeatureInfo> feature_info =
133 new gpu::gles2::FeatureInfo(gpu_state_->gpu_driver_bug_workarounds());
132 scoped_refptr<gpu::gles2::ContextGroup> context_group = 134 scoped_refptr<gpu::gles2::ContextGroup> context_group =
133 new gpu::gles2::ContextGroup( 135 new gpu::gles2::ContextGroup(
134 gpu_state_->gpu_preferences(), gpu_state_->mailbox_manager(), 136 gpu_state_->gpu_preferences(), gpu_state_->mailbox_manager(),
135 new GpuMemoryTracker, 137 new GpuMemoryTracker,
136 new gpu::gles2::ShaderTranslatorCache(gpu_state_->gpu_preferences()), 138 new gpu::gles2::ShaderTranslatorCache(gpu_state_->gpu_preferences()),
137 new gpu::gles2::FramebufferCompletenessCache, nullptr, nullptr, 139 new gpu::gles2::FramebufferCompletenessCache, feature_info, nullptr,
138 nullptr, bind_generates_resource); 140 nullptr, bind_generates_resource);
139 141
140 command_buffer_.reset( 142 command_buffer_.reset(
141 new gpu::CommandBufferService(context_group->transfer_buffer_manager())); 143 new gpu::CommandBufferService(context_group->transfer_buffer_manager()));
142 bool result = command_buffer_->Initialize(); 144 bool result = command_buffer_->Initialize();
143 DCHECK(result); 145 DCHECK(result);
144 146
145 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get())); 147 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group.get()));
146 executor_.reset(new gpu::CommandExecutor(command_buffer_.get(), 148 executor_.reset(new gpu::CommandExecutor(command_buffer_.get(),
147 decoder_.get(), decoder_.get())); 149 decoder_.get(), decoder_.get()));
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 } 545 }
544 546
545 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) { 547 void CommandBufferDriver::OnGpuCompletedSwapBuffers(gfx::SwapResult result) {
546 DCHECK(CalledOnValidThread()); 548 DCHECK(CalledOnValidThread());
547 if (client_) { 549 if (client_) {
548 client_->OnGpuCompletedSwapBuffers(result); 550 client_->OnGpuCompletedSwapBuffers(result);
549 } 551 }
550 } 552 }
551 553
552 } // namespace mus 554 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | components/mus/gles2/gpu_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698