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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineFlameChart.js

Issue 1144963002: Timeline: visually distinguish idle frames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 { 573 {
574 var frame = this._entryIndexToFrame[entryIndex]; 574 var frame = this._entryIndexToFrame[entryIndex];
575 if (frame) { 575 if (frame) {
576 var /** @const */ vPadding = 1; 576 var /** @const */ vPadding = 1;
577 var /** @const */ hPadding = 2; 577 var /** @const */ hPadding = 2;
578 barX += hPadding; 578 barX += hPadding;
579 barWidth -= 2 * hPadding; 579 barWidth -= 2 * hPadding;
580 barY += vPadding; 580 barY += vPadding;
581 barHeight -= 2 * vPadding + 1; 581 barHeight -= 2 * vPadding + 1;
582 582
583 context.fillStyle = "#ccc"; 583 context.fillStyle = frame.idle ? "#eee" : "#ccc";
584 context.fillRect(barX, barY, barWidth, barHeight); 584 context.fillRect(barX, barY, barWidth, barHeight);
585 585
586 // Draw frame perforation. 586 // Draw frame perforation.
587 context.fillStyle = "white"; 587 context.fillStyle = "white";
588 for (var i = 1; i < barWidth; i += 4) { 588 for (var i = 1; i < barWidth; i += 4) {
589 context.fillRect(barX + i, barY + 1, 2, 2); 589 context.fillRect(barX + i, barY + 1, 2, 2);
590 context.fillRect(barX + i, barY + barHeight - 3, 2, 2); 590 context.fillRect(barX + i, barY + barHeight - 3, 2, 2);
591 } 591 }
592 592
593 var frameDurationText = Number.preciseMillisToString(frame.duration, 1); 593 var frameDurationText = Number.preciseMillisToString(frame.duration, 1);
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 /** 1582 /**
1583 * @constructor 1583 * @constructor
1584 * @param {!WebInspector.TimelineSelection} selection 1584 * @param {!WebInspector.TimelineSelection} selection
1585 * @param {number} entryIndex 1585 * @param {number} entryIndex
1586 */ 1586 */
1587 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) 1587 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex)
1588 { 1588 {
1589 this.timelineSelection = selection; 1589 this.timelineSelection = selection;
1590 this.entryIndex = entryIndex; 1590 this.entryIndex = entryIndex;
1591 } 1591 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/tracing/frame-model-expected.txt ('k') | Source/devtools/front_end/timeline/TimelineFrameModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698