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_); |
144 } else { | 150 } else { |
145 context_group_ = new gpu::gles2::ContextGroup( | 151 context_group_ = |
146 mailbox_manager, | 152 new gpu::gles2::ContextGroup(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_); |
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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 if (decoder_) | 965 if (decoder_) |
960 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 966 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
961 command_buffer_->SetParseError(gpu::error::kLostContext); | 967 command_buffer_->SetParseError(gpu::error::kLostContext); |
962 } | 968 } |
963 | 969 |
964 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 970 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
965 return GetMemoryManager()->GetClientMemoryUsage(this); | 971 return GetMemoryManager()->GetClientMemoryUsage(this); |
966 } | 972 } |
967 | 973 |
968 } // namespace content | 974 } // namespace content |
OLD | NEW |