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

Unified 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: Fixed render host for android tracing Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/context_provider_command_buffer.cc
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc
index a4c3111c0cea56475463ae9eac507a986afb95b3..6c4882cd13e9cbbcc805ac06c17bcad7264b51e2 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -48,7 +48,9 @@ ContextProviderCommandBuffer::Create(
ContextProviderCommandBuffer::ContextProviderCommandBuffer(
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d,
const std::string& debug_name)
- : context3d_(context3d.Pass()),
+ : gpu_trace_top_level_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(
+ TRACE_DISABLED_BY_DEFAULT("gpu_toplevel"))),
+ context3d_(context3d.Pass()),
debug_name_(debug_name),
destroyed_(false) {
DCHECK(main_thread_checker_.CalledOnValidThread());
@@ -96,9 +98,13 @@ bool ContextProviderCommandBuffer::BindToCurrentThread() {
InitializeCapabilities();
- std::string unique_context_name =
- base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get());
- context3d_->pushGroupMarkerEXT(unique_context_name.c_str());
+ if (*gpu_trace_top_level_category_) {
vmiura 2014/12/09 00:18:10 As in render_widget_host_view_android.cc, move the
+ std::string unique_context_name =
+ base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get());
+ TRACE_GPU_EVENT_BEGIN0(context3d_,
+ TRACE_DISABLED_BY_DEFAULT("gpu_toplevel"),
+ unique_context_name.c_str());
+ }
lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(
@@ -199,6 +205,9 @@ void ContextProviderCommandBuffer::InitializeCapabilities() {
bool ContextProviderCommandBuffer::DestroyedOnMainThread() {
DCHECK(main_thread_checker_.CalledOnValidThread());
+ if (*gpu_trace_top_level_category_) {
+ TRACE_GPU_EVENT_END0(context3d_);
+ }
base::AutoLock lock(main_thread_lock_);
return destroyed_;

Powered by Google App Engine
This is Rietveld 408576698