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

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

Issue 213743003: Pass GL context bind_generates_resources flag to GPU Service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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 "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/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 last_flush_count_(0), 133 last_flush_count_(0),
134 last_memory_allocation_valid_(false), 134 last_memory_allocation_valid_(false),
135 watchdog_(watchdog), 135 watchdog_(watchdog),
136 sync_point_wait_count_(0), 136 sync_point_wait_count_(0),
137 delayed_work_scheduled_(false), 137 delayed_work_scheduled_(false),
138 previous_messages_processed_(0), 138 previous_messages_processed_(0),
139 active_url_(active_url), 139 active_url_(active_url),
140 total_gpu_memory_(0) { 140 total_gpu_memory_(0) {
141 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); 141 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec());
142 FastSetActiveURL(active_url_, active_url_hash_); 142 FastSetActiveURL(active_url_, active_url_hash_);
143
144 gpu::gles2::ContextCreationAttribHelper attrib_parser;
145 attrib_parser.Parse(requested_attribs_);
146
143 if (share_group) { 147 if (share_group) {
144 context_group_ = share_group->context_group_; 148 context_group_ = share_group->context_group_;
149 DCHECK(context_group_->bind_generates_resource() ==
150 attrib_parser.bind_generates_resource_);
145 } else { 151 } else {
146 context_group_ = new gpu::gles2::ContextGroup( 152 context_group_ = new gpu::gles2::ContextGroup(
147 mailbox_manager, 153 mailbox_manager,
148 image_manager, 154 image_manager,
149 new GpuCommandBufferMemoryTracker(channel), 155 new GpuCommandBufferMemoryTracker(channel),
150 channel_->gpu_channel_manager()->shader_translator_cache(), 156 channel_->gpu_channel_manager()->shader_translator_cache(),
151 NULL, 157 NULL,
152 true); 158 attrib_parser.bind_generates_resource_);
153 } 159 }
154 160
155 use_virtualized_gl_context_ |= 161 use_virtualized_gl_context_ |=
156 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; 162 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts;
157 } 163 }
158 164
159 GpuCommandBufferStub::~GpuCommandBufferStub() { 165 GpuCommandBufferStub::~GpuCommandBufferStub() {
160 Destroy(); 166 Destroy();
161 167
162 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); 168 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 if (decoder_) 993 if (decoder_)
988 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 994 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
989 command_buffer_->SetParseError(gpu::error::kLostContext); 995 command_buffer_->SetParseError(gpu::error::kLostContext);
990 } 996 }
991 997
992 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 998 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
993 return GetMemoryManager()->GetClientMemoryUsage(this); 999 return GetMemoryManager()->GetClientMemoryUsage(this);
994 } 1000 }
995 1001
996 } // namespace content 1002 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698