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

Side by Side Diff: content/common/gpu/client/context_provider_command_buffer.cc

Issue 780653007: Added GL_CHROMIUM_trace_marker feature as well as gpu_toplevel markers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 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) 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (lost_context_callback_proxy_) 91 if (lost_context_callback_proxy_)
92 return true; 92 return true;
93 93
94 if (!context3d_->InitializeOnCurrentThread()) 94 if (!context3d_->InitializeOnCurrentThread())
95 return false; 95 return false;
96 96
97 InitializeCapabilities(); 97 InitializeCapabilities();
98 98
99 std::string unique_context_name = 99 std::string unique_context_name =
100 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); 100 base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get());
101 context3d_->pushGroupMarkerEXT(unique_context_name.c_str()); 101 context3d_->traceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str());
102 102
103 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); 103 lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
104 context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback( 104 context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(
105 base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged, 105 base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged,
106 base::Unretained(this))); 106 base::Unretained(this)));
107 return true; 107 return true;
108 } 108 }
109 109
110 gpu::gles2::GLES2Interface* ContextProviderCommandBuffer::ContextGL() { 110 gpu::gles2::GLES2Interface* ContextProviderCommandBuffer::ContextGL() {
111 DCHECK(context3d_); 111 DCHECK(context3d_);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback( 215 void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback(
216 const MemoryPolicyChangedCallback& memory_policy_changed_callback) { 216 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {
217 DCHECK(context_thread_checker_.CalledOnValidThread()); 217 DCHECK(context_thread_checker_.CalledOnValidThread());
218 DCHECK(memory_policy_changed_callback_.is_null() || 218 DCHECK(memory_policy_changed_callback_.is_null() ||
219 memory_policy_changed_callback.is_null()); 219 memory_policy_changed_callback.is_null());
220 memory_policy_changed_callback_ = memory_policy_changed_callback; 220 memory_policy_changed_callback_ = memory_policy_changed_callback;
221 } 221 }
222 222
223 } // namespace content 223 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698