summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-23 17:35:25 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-23 17:35:25 +0000
commitfdc98289333ccfd9cb192bfac9c39a8c580e278d (patch)
tree8f67b3084e8d19552bfa8b77cc01ce079b85beba /gpu/command_buffer/service
parent51f41da1d34453cd1ec96a625df8cbc94cf65865 (diff)
downloadchromium_src-fdc98289333ccfd9cb192bfac9c39a8c580e278d.zip
chromium_src-fdc98289333ccfd9cb192bfac9c39a8c580e278d.tar.gz
chromium_src-fdc98289333ccfd9cb192bfac9c39a8c580e278d.tar.bz2
Replace --trace-gl with TRACE_DISABLED_BY_DEFAULT("cb_command")
Now TRACE_DISABLED_BY_DEFAULT() provides a better way to disable heavy traces by default. It allows user to enable the category at runtime in chrome://tracing. Also changed TRACE_EVENT_BEGIN0/TRACE_EVENT_END0 to TRACE_EVENT0 which can reduce the number of events and tracing overhead by half during tracing. BUG=none Review URL: https://codereview.chromium.org/29963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service')
-rw-r--r--gpu/command_buffer/service/cmd_parser.cc13
-rw-r--r--gpu/command_buffer/service/cmd_parser.h1
-rw-r--r--gpu/command_buffer/service/gpu_switches.cc3
-rw-r--r--gpu/command_buffer/service/gpu_switches.h1
4 files changed, 3 insertions, 15 deletions
diff --git a/gpu/command_buffer/service/cmd_parser.cc b/gpu/command_buffer/service/cmd_parser.cc
index 0ca1e61..65abc71 100644
--- a/gpu/command_buffer/service/cmd_parser.cc
+++ b/gpu/command_buffer/service/cmd_parser.cc
@@ -7,9 +7,7 @@
#include "gpu/command_buffer/service/cmd_parser.h"
#include "base/logging.h"
-#include "base/command_line.h"
#include "base/debug/trace_event.h"
-#include "gpu/command_buffer/service/gpu_switches.h"
namespace gpu {
@@ -18,10 +16,7 @@ CommandParser::CommandParser(AsyncAPIInterface* handler)
put_(0),
buffer_(NULL),
entry_count_(0),
- handler_(handler),
- trace_gl_commands_(false) {
- trace_gl_commands_ =
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceGL);
+ handler_(handler) {
}
void CommandParser::SetBuffer(
@@ -65,8 +60,8 @@ error::Error CommandParser::ProcessCommand() {
return error::kOutOfBounds;
}
- if (trace_gl_commands_)
- TRACE_EVENT_BEGIN0("cb_command", handler_->GetCommandName(header.command));
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cb_command"),
+ handler_->GetCommandName(header.command));
error::Error result = handler_->DoCommand(
header.command, header.size - 1, buffer_ + get);
@@ -82,8 +77,6 @@ error::Error CommandParser::ProcessCommand() {
if (get == get_ && result != error::kDeferCommandUntilLater)
get_ = (get + header.size) % entry_count_;
- if (trace_gl_commands_)
- TRACE_EVENT_END0("cb_command", handler_->GetCommandName(header.command));
return result;
}
diff --git a/gpu/command_buffer/service/cmd_parser.h b/gpu/command_buffer/service/cmd_parser.h
index c808c4e..de2fe29 100644
--- a/gpu/command_buffer/service/cmd_parser.h
+++ b/gpu/command_buffer/service/cmd_parser.h
@@ -69,7 +69,6 @@ class GPU_EXPORT CommandParser {
CommandBufferEntry* buffer_;
int32 entry_count_;
AsyncAPIInterface* handler_;
- bool trace_gl_commands_;
};
// This class defines the interface for an asynchronous API handler, that
diff --git a/gpu/command_buffer/service/gpu_switches.cc b/gpu/command_buffer/service/gpu_switches.cc
index 221dd60..bff23c3 100644
--- a/gpu/command_buffer/service/gpu_switches.cc
+++ b/gpu/command_buffer/service/gpu_switches.cc
@@ -57,8 +57,6 @@ const char kGpuDriverBugWorkarounds[] = "gpu-driver-bug-workarounds";
// Sets the maximum size of the in-memory gpu program cache, in kb
const char kGpuProgramCacheSizeKb[] = "gpu-program-cache-size-kb";
-const char kTraceGL[] = "trace-gl";
-
// Disables the GPU shader on disk cache.
const char kDisableGpuShaderDiskCache[] = "disable-gpu-shader-disk-cache";
@@ -82,7 +80,6 @@ const char* kGpuSwitches[] = {
kForceSynchronousGLReadPixels,
kGpuDriverBugWorkarounds,
kGpuProgramCacheSizeKb,
- kTraceGL,
kDisableGpuShaderDiskCache,
kEnableShareGroupAsyncTextureUpload,
};
diff --git a/gpu/command_buffer/service/gpu_switches.h b/gpu/command_buffer/service/gpu_switches.h
index 7634c57..7916d690 100644
--- a/gpu/command_buffer/service/gpu_switches.h
+++ b/gpu/command_buffer/service/gpu_switches.h
@@ -26,7 +26,6 @@ GPU_EXPORT extern const char kForceGpuMemAvailableMb[];
GPU_EXPORT extern const char kForceSynchronousGLReadPixels[];
GPU_EXPORT extern const char kGpuDriverBugWorkarounds[];
GPU_EXPORT extern const char kGpuProgramCacheSizeKb[];
-GPU_EXPORT extern const char kTraceGL[];
GPU_EXPORT extern const char kDisableGpuShaderDiskCache[];
GPU_EXPORT extern const char kEnableShareGroupAsyncTextureUpload[];