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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 455783002: GPU context creation code duplication cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix even more build dependencies Created 6 years, 4 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 total_gpu_memory_(0) { 179 total_gpu_memory_(0) {
180 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); 180 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec());
181 FastSetActiveURL(active_url_, active_url_hash_); 181 FastSetActiveURL(active_url_, active_url_hash_);
182 182
183 gpu::gles2::ContextCreationAttribHelper attrib_parser; 183 gpu::gles2::ContextCreationAttribHelper attrib_parser;
184 attrib_parser.Parse(requested_attribs_); 184 attrib_parser.Parse(requested_attribs_);
185 185
186 if (share_group) { 186 if (share_group) {
187 context_group_ = share_group->context_group_; 187 context_group_ = share_group->context_group_;
188 DCHECK(context_group_->bind_generates_resource() == 188 DCHECK(context_group_->bind_generates_resource() ==
189 attrib_parser.bind_generates_resource_); 189 attrib_parser.bind_generates_resource);
190 } else { 190 } else {
191 context_group_ = new gpu::gles2::ContextGroup( 191 context_group_ = new gpu::gles2::ContextGroup(
192 mailbox_manager, 192 mailbox_manager,
193 new GpuCommandBufferMemoryTracker(channel), 193 new GpuCommandBufferMemoryTracker(channel),
194 channel_->gpu_channel_manager()->shader_translator_cache(), 194 channel_->gpu_channel_manager()->shader_translator_cache(),
195 NULL, 195 NULL,
196 attrib_parser.bind_generates_resource_); 196 attrib_parser.bind_generates_resource);
197 } 197 }
198 198
199 use_virtualized_gl_context_ |= 199 use_virtualized_gl_context_ |=
200 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; 200 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts;
201 } 201 }
202 202
203 GpuCommandBufferStub::~GpuCommandBufferStub() { 203 GpuCommandBufferStub::~GpuCommandBufferStub() {
204 Destroy(); 204 Destroy();
205 205
206 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); 206 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 if (decoder_) 1101 if (decoder_)
1102 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 1102 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
1103 command_buffer_->SetParseError(gpu::error::kLostContext); 1103 command_buffer_->SetParseError(gpu::error::kLostContext);
1104 } 1104 }
1105 1105
1106 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 1106 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
1107 return GetMemoryManager()->GetClientMemoryUsage(this); 1107 return GetMemoryManager()->GetClientMemoryUsage(this);
1108 } 1108 }
1109 1109
1110 } // namespace content 1110 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc ('k') | gpu/command_buffer/client/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698