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

Side by Side Diff: Source/devtools/front_end/TimelineModel.js

Issue 46663010: DevTools: Show GPU utilization bar on timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineStopped, this._onStopped, this); 44 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineStopped, this._onStopped, this);
45 } 45 }
46 46
47 WebInspector.TimelineModel.TransferChunkLengthBytes = 5000000; 47 WebInspector.TimelineModel.TransferChunkLengthBytes = 5000000;
48 48
49 WebInspector.TimelineModel.RecordType = { 49 WebInspector.TimelineModel.RecordType = {
50 Root: "Root", 50 Root: "Root",
51 Program: "Program", 51 Program: "Program",
52 EventDispatch: "EventDispatch", 52 EventDispatch: "EventDispatch",
53 53
54 GpuTask: "GpuTask",
55
54 BeginFrame: "BeginFrame", 56 BeginFrame: "BeginFrame",
55 ScheduleStyleRecalculation: "ScheduleStyleRecalculation", 57 ScheduleStyleRecalculation: "ScheduleStyleRecalculation",
56 RecalculateStyles: "RecalculateStyles", 58 RecalculateStyles: "RecalculateStyles",
57 InvalidateLayout: "InvalidateLayout", 59 InvalidateLayout: "InvalidateLayout",
58 Layout: "Layout", 60 Layout: "Layout",
59 AutosizeText: "AutosizeText", 61 AutosizeText: "AutosizeText",
60 PaintSetup: "PaintSetup", 62 PaintSetup: "PaintSetup",
61 Paint: "Paint", 63 Paint: "Paint",
62 Rasterize: "Rasterize", 64 Rasterize: "Rasterize",
63 ScrollLayer: "ScrollLayer", 65 ScrollLayer: "ScrollLayer",
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 RecordingStopped: "RecordingStopped" 110 RecordingStopped: "RecordingStopped"
109 } 111 }
110 112
111 WebInspector.TimelineModel.startTimeInSeconds = function(record) 113 WebInspector.TimelineModel.startTimeInSeconds = function(record)
112 { 114 {
113 return record.startTime / 1000; 115 return record.startTime / 1000;
114 } 116 }
115 117
116 WebInspector.TimelineModel.endTimeInSeconds = function(record) 118 WebInspector.TimelineModel.endTimeInSeconds = function(record)
117 { 119 {
118 return (typeof record.endTime === "undefined" ? record.startTime : record.en dTime) / 1000; 120 return (record.endTime || record.startTime) / 1000;
119 } 121 }
120 122
121 WebInspector.TimelineModel.durationInSeconds = function(record) 123 WebInspector.TimelineModel.durationInSeconds = function(record)
122 { 124 {
123 return WebInspector.TimelineModel.endTimeInSeconds(record) - WebInspector.Ti melineModel.startTimeInSeconds(record); 125 return WebInspector.TimelineModel.endTimeInSeconds(record) - WebInspector.Ti melineModel.startTimeInSeconds(record);
124 } 126 }
125 127
126 /** 128 /**
127 * @param {Object} total 129 * @param {Object} total
128 * @param {Object} rawRecord 130 * @param {Object} rawRecord
(...skipping 23 matching lines...) Expand all
152 154
153 WebInspector.TimelineModel.prototype = { 155 WebInspector.TimelineModel.prototype = {
154 /** 156 /**
155 * @param {boolean=} includeDomCounters 157 * @param {boolean=} includeDomCounters
156 */ 158 */
157 startRecording: function(includeDomCounters) 159 startRecording: function(includeDomCounters)
158 { 160 {
159 this._clientInitiatedRecording = true; 161 this._clientInitiatedRecording = true;
160 this.reset(); 162 this.reset();
161 var maxStackFrames = WebInspector.settings.timelineLimitStackFramesFlag. get() ? WebInspector.settings.timelineStackFramesToCapture.get() : 30; 163 var maxStackFrames = WebInspector.settings.timelineLimitStackFramesFlag. get() ? WebInspector.settings.timelineStackFramesToCapture.get() : 30;
162 WebInspector.timelineManager.start(maxStackFrames, includeDomCounters, t his._fireRecordingStarted.bind(this)); 164 var includeGpuEvents = WebInspector.experimentsSettings.gpuTimeline.isEn abled();
165 WebInspector.timelineManager.start(maxStackFrames, includeDomCounters, i ncludeGpuEvents, this._fireRecordingStarted.bind(this));
163 }, 166 },
164 167
165 stopRecording: function() 168 stopRecording: function()
166 { 169 {
167 if (!this._clientInitiatedRecording) { 170 if (!this._clientInitiatedRecording) {
168 // Console started this one and we are just sniffing it. Initiate re cording so that we 171 // Console started this one and we are just sniffing it. Initiate re cording so that we
169 // could stop it. 172 // could stop it.
170 function stopTimeline() 173 function stopTimeline()
171 { 174 {
172 WebInspector.timelineManager.stop(this._fireRecordingStopped.bin d(this)); 175 WebInspector.timelineManager.stop(this._fireRecordingStopped.bin d(this));
173 } 176 }
174 177
175 WebInspector.timelineManager.start(undefined, undefined, stopTimelin e.bind(this)); 178 WebInspector.timelineManager.start(undefined, undefined, undefined, stopTimeline.bind(this));
176 return; 179 return;
177 } 180 }
178 this._clientInitiatedRecording = false; 181 this._clientInitiatedRecording = false;
179 WebInspector.timelineManager.stop(this._fireRecordingStopped.bind(this)) ; 182 WebInspector.timelineManager.stop(this._fireRecordingStopped.bind(this)) ;
180 }, 183 },
181 184
182 get records() 185 get records()
183 { 186 {
184 return this._records; 187 return this._records;
185 }, 188 },
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 break; 506 break;
504 length += itemLength; 507 length += itemLength;
505 data.push(item); 508 data.push(item);
506 ++this._recordIndex; 509 ++this._recordIndex;
507 } 510 }
508 if (this._recordIndex === this._records.length) 511 if (this._recordIndex === this._records.length)
509 data.push(data.pop() + "]"); 512 data.push(data.pop() + "]");
510 stream.write(data.join(separator), this._writeNextChunk.bind(this)); 513 stream.write(data.join(separator), this._writeNextChunk.bind(this));
511 } 514 }
512 } 515 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698