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

Unified Diff: ui/gl/angle_platform_impl.cc

Issue 1064163002: Add ANGLE platform tracing methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/angle_platform_impl.h ('k') | ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/angle_platform_impl.cc
diff --git a/ui/gl/angle_platform_impl.cc b/ui/gl/angle_platform_impl.cc
index 2ce12b823afb36bb1a3f3cb46f7e3e4c7699822f..47f6cef6f5f1ee41b5376bfc5853d9fd38f3a7bb 100644
--- a/ui/gl/angle_platform_impl.cc
+++ b/ui/gl/angle_platform_impl.cc
@@ -6,6 +6,7 @@
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
+#include "base/trace_event/trace_event.h"
namespace gfx {
@@ -15,6 +16,49 @@ ANGLEPlatformImpl::ANGLEPlatformImpl() {
ANGLEPlatformImpl::~ANGLEPlatformImpl() {
}
+double ANGLEPlatformImpl::monotonicallyIncreasingTime() {
+ return base::TimeTicks::Now().ToInternalValue() /
+ static_cast<double>(base::Time::kMicrosecondsPerSecond);
+}
+
+const unsigned char* ANGLEPlatformImpl::getTraceCategoryEnabledFlag(
+ const char* category_group) {
+ return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group);
+}
+
+angle::Platform::TraceEventHandle ANGLEPlatformImpl::addTraceEvent(
+ char phase,
+ const unsigned char* category_group_enabled,
+ const char* name,
+ unsigned long long id,
+ double timestamp,
+ int num_args,
+ const char** arg_names,
+ const unsigned char* arg_types,
+ const unsigned long long* arg_values,
+ unsigned char flags) {
+ base::TimeTicks timestamp_tt = base::TimeTicks::FromInternalValue(
+ static_cast<int64>(timestamp * base::Time::kMicrosecondsPerSecond));
+ base::trace_event::TraceEventHandle handle =
+ TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP(
+ phase, category_group_enabled, name, id,
+ base::PlatformThread::CurrentId(), timestamp_tt, num_args, arg_names,
+ arg_types, arg_values, nullptr, flags);
+ angle::Platform::TraceEventHandle result;
+ memcpy(&result, &handle, sizeof(result));
+ return result;
+}
+
+void ANGLEPlatformImpl::updateTraceEventDuration(
+ const unsigned char* category_group_enabled,
+ const char* name,
+ TraceEventHandle handle) {
+ base::trace_event::TraceEventHandle trace_event_handle;
+ memcpy(&trace_event_handle, &handle, sizeof(handle));
+ TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled, name,
+ trace_event_handle);
+}
+
void ANGLEPlatformImpl::histogramCustomCounts(const char* name,
int sample,
int min,
« no previous file with comments | « ui/gl/angle_platform_impl.h ('k') | ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698