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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js

Issue 1636853002: Timeline: simplify handling of event category colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 */ 331 */
332 function onEventEnd(e) 332 function onEventEnd(e)
333 { 333 {
334 quantizer.appendInterval(e.endTime, categoryIndexStack.pop()); 334 quantizer.appendInterval(e.endTime, categoryIndexStack.pop());
335 } 335 }
336 336
337 WebInspector.TimelineModel.forEachEvent(events, onEventStart, onEven tEnd); 337 WebInspector.TimelineModel.forEachEvent(events, onEventStart, onEven tEnd);
338 quantizer.appendInterval(timeOffset + timeSpan + quantTime, idleInde x); // Kick drawing the last bucket. 338 quantizer.appendInterval(timeOffset + timeSpan + quantTime, idleInde x); // Kick drawing the last bucket.
339 for (var i = categoryOrder.length - 1; i > 0; --i) { 339 for (var i = categoryOrder.length - 1; i > 0; --i) {
340 paths[i].lineTo(width, height); 340 paths[i].lineTo(width, height);
341 ctx.fillStyle = categories[categoryOrder[i]].fillColorStop1; 341 ctx.fillStyle = categories[categoryOrder[i]].color;
342 ctx.fill(paths[i]); 342 ctx.fill(paths[i]);
343 } 343 }
344 } 344 }
345 345
346 /** 346 /**
347 * @param {!CanvasRenderingContext2D} ctx 347 * @param {!CanvasRenderingContext2D} ctx
348 */ 348 */
349 function applyPattern(ctx) 349 function applyPattern(ctx)
350 { 350 {
351 var step = 4 * window.devicePixelRatio; 351 var step = 4 * window.devicePixelRatio;
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 counters[group] = this._quantDuration; 829 counters[group] = this._quantDuration;
830 this._callback(counters); 830 this._callback(counters);
831 interval -= this._quantDuration; 831 interval -= this._quantDuration;
832 } 832 }
833 this._counters = []; 833 this._counters = [];
834 this._counters[group] = interval; 834 this._counters[group] = interval;
835 this._lastTime = time; 835 this._lastTime = time;
836 this._remainder = this._quantDuration - interval; 836 this._remainder = this._quantDuration - interval;
837 } 837 }
838 } 838 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698