[go: nahoru, domu]

Add flow event for raster task execution.

Connect place which schedules raster tasks with actually running them.

This (together with other flow events) allows tracing the entire chain
of events which generated a given frame.

R=vmpstr@chromium.org
BUG=1142207

Change-Id: Ice546283e00b7ef58fb79930e65df4ff994ff2c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494815
Auto-Submit: Alexander Timin <altimin@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Sreeja Kamishetty <sreejakshetty@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1155003}
diff --git a/cc/raster/task.h b/cc/raster/task.h
index a5f0144..f650e8d3 100644
--- a/cc/raster/task.h
+++ b/cc/raster/task.h
@@ -81,6 +81,11 @@
   void set_frame_number(int64_t frame_number) { frame_number_ = frame_number; }
   int64_t frame_number() { return frame_number_; }
 
+  // Unique trace flow id for the given task, used to connect the places where
+  // the task was posted from and the task itself.
+  uint64_t trace_task_id() { return trace_task_id_; }
+  void set_trace_task_id(uint64_t id) { trace_task_id_ = id; }
+
   // Subclasses should implement this method. RunOnWorkerThread may be called
   // on any thread, and subclasses are responsible for locking and thread
   // safety.
@@ -95,6 +100,7 @@
  private:
   TaskState state_;
   int64_t frame_number_ = -1;
+  int64_t trace_task_id_ = 0;
 };
 
 // A task dependency graph describes the order in which to execute a set
@@ -109,7 +115,7 @@
   struct CC_EXPORT Node {
     typedef std::vector<Node> Vector;
 
-    Node(scoped_refptr<Task> task,
+    Node(scoped_refptr<Task> new_task,
          uint16_t category,
          uint16_t priority,
          uint32_t dependencies);