OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/gpu/client/context_provider_command_buffer.h" | 5 #include "content/common/gpu/client/context_provider_command_buffer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 | 93 |
94 if (lost_context_callback_proxy_) | 94 if (lost_context_callback_proxy_) |
95 return true; | 95 return true; |
96 | 96 |
97 context3d_->SetContextType(context_type_); | 97 context3d_->SetContextType(context_type_); |
98 if (!context3d_->InitializeOnCurrentThread()) | 98 if (!context3d_->InitializeOnCurrentThread()) |
99 return false; | 99 return false; |
100 | 100 |
101 InitializeCapabilities(); | 101 InitializeCapabilities(); |
102 | 102 |
103 std::string unique_context_name = | 103 const std::string unique_context_name = |
104 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); | 104 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); |
105 context3d_->pushGroupMarkerEXT(unique_context_name.c_str()); | |
vmiura
2015/05/12 21:47:42
Same here.
| |
105 context3d_->traceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str()); | 106 context3d_->traceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str()); |
106 | 107 |
107 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); | 108 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); |
108 context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( | 109 context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( |
109 base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged, | 110 base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged, |
110 base::Unretained(this))); | 111 base::Unretained(this))); |
111 return true; | 112 return true; |
112 } | 113 } |
113 | 114 |
114 void ContextProviderCommandBuffer::DetachFromThread() { | 115 void ContextProviderCommandBuffer::DetachFromThread() { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 | 244 |
244 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( | 245 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( |
245 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { | 246 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { |
246 DCHECK(context_thread_checker_.CalledOnValidThread()); | 247 DCHECK(context_thread_checker_.CalledOnValidThread()); |
247 DCHECK(memory_policy_changed_callback_.is_null() || | 248 DCHECK(memory_policy_changed_callback_.is_null() || |
248 memory_policy_changed_callback.is_null()); | 249 memory_policy_changed_callback.is_null()); |
249 memory_policy_changed_callback_ = memory_policy_changed_callback; | 250 memory_policy_changed_callback_ = memory_policy_changed_callback; |
250 } | 251 } |
251 | 252 |
252 } // namespace content | 253 } // namespace content |
OLD | NEW |