OLD | NEW |
---|---|
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 last_flush_count_(0), | 132 last_flush_count_(0), |
133 last_memory_allocation_valid_(false), | 133 last_memory_allocation_valid_(false), |
134 watchdog_(watchdog), | 134 watchdog_(watchdog), |
135 sync_point_wait_count_(0), | 135 sync_point_wait_count_(0), |
136 delayed_work_scheduled_(false), | 136 delayed_work_scheduled_(false), |
137 previous_messages_processed_(0), | 137 previous_messages_processed_(0), |
138 active_url_(active_url), | 138 active_url_(active_url), |
139 total_gpu_memory_(0) { | 139 total_gpu_memory_(0) { |
140 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); | 140 active_url_hash_ = base::Hash(active_url.possibly_invalid_spec()); |
141 FastSetActiveURL(active_url_, active_url_hash_); | 141 FastSetActiveURL(active_url_, active_url_hash_); |
142 | |
143 gpu::gles2::ContextCreationAttribHelper attrib_parser; | |
144 attrib_parser.Parse(requested_attribs_); | |
145 | |
142 if (share_group) { | 146 if (share_group) { |
143 context_group_ = share_group->context_group_; | 147 context_group_ = share_group->context_group_; |
148 DCHECK(context_group_->bind_generates_resource() == | |
149 attrib_parser.bind_generates_resource_); | |
Ken Russell (switch to Gerrit)
2014/04/01 21:29:38
How much testing has this change undergone? Have y
vmiura
2014/04/01 22:32:06
I have manually tested these cases, and observed b
| |
144 } else { | 150 } else { |
145 context_group_ = new gpu::gles2::ContextGroup( | 151 context_group_ = new gpu::gles2::ContextGroup( |
146 mailbox_manager, | 152 mailbox_manager, |
147 image_manager, | 153 image_manager, |
148 new GpuCommandBufferMemoryTracker(channel), | 154 new GpuCommandBufferMemoryTracker(channel), |
149 NULL, | 155 NULL, |
150 true); | 156 attrib_parser.bind_generates_resource_); // need to pass this in... |
Ken Russell (switch to Gerrit)
2014/04/01 21:29:38
I don't think the comment adds any value.
Upon fu
vmiura
2014/04/02 22:12:31
Removed comment.
| |
151 } | 157 } |
152 | 158 |
153 use_virtualized_gl_context_ |= | 159 use_virtualized_gl_context_ |= |
154 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; | 160 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; |
155 } | 161 } |
156 | 162 |
157 GpuCommandBufferStub::~GpuCommandBufferStub() { | 163 GpuCommandBufferStub::~GpuCommandBufferStub() { |
158 Destroy(); | 164 Destroy(); |
159 | 165 |
160 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 166 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
986 if (decoder_) | 992 if (decoder_) |
987 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 993 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
988 command_buffer_->SetParseError(gpu::error::kLostContext); | 994 command_buffer_->SetParseError(gpu::error::kLostContext); |
989 } | 995 } |
990 | 996 |
991 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 997 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
992 return GetMemoryManager()->GetClientMemoryUsage(this); | 998 return GetMemoryManager()->GetClientMemoryUsage(this); |
993 } | 999 } |
994 | 1000 |
995 } // namespace content | 1001 } // namespace content |
OLD | NEW |