| 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 #if defined(OS_CHROMEOS) |
| 143 gpu::gles2::ContextCreationAttribHelper attrib_parser; |
| 144 attrib_parser.Parse(requested_attribs_); |
| 145 #endif |
| 146 |
| 142 if (share_group) { | 147 if (share_group) { |
| 143 context_group_ = share_group->context_group_; | 148 context_group_ = share_group->context_group_; |
| 149 #if defined(OS_CHROMEOS) |
| 150 DCHECK(context_group_->bind_generates_resource() == |
| 151 attrib_parser.bind_generates_resource_); |
| 152 #endif |
| 144 } else { | 153 } else { |
| 145 context_group_ = new gpu::gles2::ContextGroup( | 154 context_group_ = new gpu::gles2::ContextGroup( |
| 146 mailbox_manager, | 155 mailbox_manager, |
| 147 image_manager, | 156 image_manager, |
| 148 new GpuCommandBufferMemoryTracker(channel), | 157 new GpuCommandBufferMemoryTracker(channel), |
| 149 NULL, | 158 NULL, |
| 159 #if defined(OS_CHROMEOS) |
| 160 attrib_parser.bind_generates_resource_); |
| 161 #else |
| 150 true); | 162 true); |
| 163 #endif |
| 151 } | 164 } |
| 152 | 165 |
| 153 use_virtualized_gl_context_ |= | 166 use_virtualized_gl_context_ |= |
| 154 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; | 167 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; |
| 155 } | 168 } |
| 156 | 169 |
| 157 GpuCommandBufferStub::~GpuCommandBufferStub() { | 170 GpuCommandBufferStub::~GpuCommandBufferStub() { |
| 158 Destroy(); | 171 Destroy(); |
| 159 | 172 |
| 160 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 173 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 if (decoder_) | 999 if (decoder_) |
| 987 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 1000 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
| 988 command_buffer_->SetParseError(gpu::error::kLostContext); | 1001 command_buffer_->SetParseError(gpu::error::kLostContext); |
| 989 } | 1002 } |
| 990 | 1003 |
| 991 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 1004 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
| 992 return GetMemoryManager()->GetClientMemoryUsage(this); | 1005 return GetMemoryManager()->GetClientMemoryUsage(this); |
| 993 } | 1006 } |
| 994 | 1007 |
| 995 } // namespace content | 1008 } // namespace content |
| OLD | NEW |