summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyen <dyen@chromium.org>2015-01-07 14:56:35 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-07 22:57:36 +0000
commit52554adb44477b802d66105d8e345f1bead3810c (patch)
tree39e98e9bbe9620ec11866f0becbad2ee5059b966
parent75755fafa44d82854d5beece5149ff6de22d0d2d (diff)
downloadchromium_src-52554adb44477b802d66105d8e345f1bead3810c.zip
chromium_src-52554adb44477b802d66105d8e345f1bead3810c.tar.gz
chromium_src-52554adb44477b802d66105d8e345f1bead3810c.tar.bz2
Added GL_CHROMIUM_trace_marker feature as well as gpu_toplevel markers.
Added a GL_CHROMIUM_trace_marker extension which allows us to execute GPU traces with an associated category and trace name. This feature has been documented here and is also used for "gpu_toplevel" traces so we can display traces for top level graphics contexts. blink side: https://codereview.chromium.org/797273003/ R=vmiura@chromium.org BUG=None TEST=trybots Review URL: https://codereview.chromium.org/780653007 Cr-Commit-Position: refs/heads/master@{#310399}
-rw-r--r--content/browser/renderer_host/render_widget_host_view_android.cc3
-rw-r--r--content/common/gpu/client/context_provider_command_buffer.cc2
-rw-r--r--gpu/GLES2/extensions/CHROMIUM/CHROMIUM_trace_marker.txt63
-rw-r--r--gpu/blink/webgraphicscontext3d_impl.cc5
-rw-r--r--gpu/blink/webgraphicscontext3d_impl.h3
-rw-r--r--gpu/command_buffer/service/feature_info.cc1
-rw-r--r--gpu/command_buffer/service/feature_info_unittest.cc1
-rw-r--r--webkit/common/gpu/context_provider_in_process.cc3
8 files changed, 78 insertions, 3 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 3c6d3e0..eb6c6ad 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -191,7 +191,8 @@ GLHelperHolder::CreateContext3D() {
url, gpu_channel_host.get(), attrs, lose_context_when_out_of_memory,
limits, nullptr));
if (context->InitializeOnCurrentThread()) {
- context->pushGroupMarkerEXT(
+ context->traceBeginCHROMIUM(
+ "gpu_toplevel",
base::StringPrintf("CmdBufferImageTransportFactory-%p",
context.get()).c_str());
} else {
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc
index a4c3111..c836a99 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -98,7 +98,7 @@ bool ContextProviderCommandBuffer::BindToCurrentThread() {
std::string unique_context_name =
base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get());
- context3d_->pushGroupMarkerEXT(unique_context_name.c_str());
+ context3d_->traceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str());
lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_trace_marker.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_trace_marker.txt
new file mode 100644
index 0000000..7dfb78e
--- /dev/null
+++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_trace_marker.txt
@@ -0,0 +1,63 @@
+Name
+
+ CHROMIUM_trace_marker
+
+Name Strings
+
+ GL_CHROMIUM_trace_marker
+
+Version
+
+ Last Modifed Date: December 17, 2014
+
+Dependencies
+
+ OpenGL ES 2.0 is required.
+
+Overview
+
+ This extension lets you mark chromium style GPU traces. Each trace can
+ specify both a category name and a trace name which will be associated
+ with the trace.
+
+ Each trace's beginning is marked by TraceBeginCHROMIUM and the end can
+ optionally be marked by TraceEndCHROMIUM. If the trace's end is not marked,
+ the trace will automatically end when the graphics context is destroyed.
+
+ Multiple traces can happen simultaneously, however traces act as a stack
+ and must be fully contained within one another. Therefore, you cannot
+ have overlapping traces.
+
+ Once a trace has been recorded, it is up to the application to decide
+ how the traces should be displayed.
+
+New Tokens
+
+ None
+
+New Procedures and Functions
+
+ void TraceBeginCHROMIUM(const char* category_name, const char* trace_name)
+
+ Marks the beginning of when a GPU trace should begin. Once the trace begins
+ it lasts until the graphics context is destroyed or when TraceEndCHROMIUM
+ is called.
+
+
+ void TraceEndCHROMIUM()
+
+ Marks the last trace to end, this will signal the application to stop
+ tracing the previous trace.
+
+Errors
+
+ None.
+
+New State
+
+ None.
+
+Revision History
+
+ 12/17/2014 Documented the extension
+
diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc
index 26a366c..2681abc 100644
--- a/gpu/blink/webgraphicscontext3d_impl.cc
+++ b/gpu/blink/webgraphicscontext3d_impl.cc
@@ -885,6 +885,11 @@ DELEGATE_TO_GL_3(uniformValuebufferCHROMIUM,
WGC3Dint,
WGC3Denum,
WGC3Denum);
+DELEGATE_TO_GL_2(traceBeginCHROMIUM,
+ TraceBeginCHROMIUM,
+ const WGC3Dchar*,
+ const WGC3Dchar*);
+DELEGATE_TO_GL(traceEndCHROMIUM, TraceEndCHROMIUM);
void WebGraphicsContext3DImpl::insertEventMarkerEXT(
const WGC3Dchar* marker) {
diff --git a/gpu/blink/webgraphicscontext3d_impl.h b/gpu/blink/webgraphicscontext3d_impl.h
index 41a6d89..11a3dc5 100644
--- a/gpu/blink/webgraphicscontext3d_impl.h
+++ b/gpu/blink/webgraphicscontext3d_impl.h
@@ -493,6 +493,9 @@ class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
virtual void uniformValuebufferCHROMIUM(WGC3Dint location,
WGC3Denum target,
WGC3Denum subscription);
+ virtual void traceBeginCHROMIUM(const WGC3Dchar* category_name,
+ const WGC3Dchar* trace_name);
+ virtual void traceEndCHROMIUM();
virtual void insertEventMarkerEXT(const WGC3Dchar* marker);
virtual void pushGroupMarkerEXT(const WGC3Dchar* marker);
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index a225478..5706086 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -289,6 +289,7 @@ void FeatureInfo::InitializeFeatures() {
AddExtensionString("GL_CHROMIUM_resource_safe");
AddExtensionString("GL_CHROMIUM_strict_attribs");
AddExtensionString("GL_CHROMIUM_texture_mailbox");
+ AddExtensionString("GL_CHROMIUM_trace_marker");
AddExtensionString("GL_EXT_debug_marker");
if (feature_flags_.enable_subscribe_uniform) {
diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc
index f5440e0..e81dad1 100644
--- a/gpu/command_buffer/service/feature_info_unittest.cc
+++ b/gpu/command_buffer/service/feature_info_unittest.cc
@@ -235,6 +235,7 @@ TEST_F(FeatureInfoTest, InitializeNoExtensions) {
EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_strict_attribs"));
EXPECT_THAT(info_->extensions(),
HasSubstr("GL_ANGLE_translated_shader_source"));
+ EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_trace_marker"));
// Check a couple of random extensions that should not be there.
EXPECT_THAT(info_->extensions(), Not(HasSubstr("GL_OES_texture_npot")));
diff --git a/webkit/common/gpu/context_provider_in_process.cc b/webkit/common/gpu/context_provider_in_process.cc
index b02d961..9eb6e41 100644
--- a/webkit/common/gpu/context_provider_in_process.cc
+++ b/webkit/common/gpu/context_provider_in_process.cc
@@ -102,7 +102,8 @@ bool ContextProviderInProcess::BindToCurrentThread() {
std::string unique_context_name =
base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get());
- context3d_->pushGroupMarkerEXT(unique_context_name.c_str());
+ context3d_->traceBeginCHROMIUM("gpu_toplevel",
+ unique_context_name.c_str());
lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
return true;