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

Unified Diff: Source/devtools/front_end/CPUProfileFlameChart.js

Issue 214783002: CPUFlameChart: fix overview pane for retina displays. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/CPUProfileFlameChart.js
diff --git a/Source/devtools/front_end/CPUProfileFlameChart.js b/Source/devtools/front_end/CPUProfileFlameChart.js
index eac4cc5e9dbfa389b5f2e2431e2246b440a1f2c1..30a4958ed43358e6c203257baf17d6e00316c7c4 100644
--- a/Source/devtools/front_end/CPUProfileFlameChart.js
+++ b/Source/devtools/front_end/CPUProfileFlameChart.js
@@ -333,26 +333,25 @@ WebInspector.CPUProfileFlameChart.OverviewPane.calculateDrawData = function(data
*/
WebInspector.CPUProfileFlameChart.OverviewPane.drawOverviewCanvas = function(dataProvider, timelineData, context, width, height)
{
- var drawData = WebInspector.CPUProfileFlameChart.OverviewPane.calculateDrawData(dataProvider, timelineData, width);
- if (!drawData)
- return;
-
var ratio = window.devicePixelRatio;
var canvasWidth = width * ratio;
var canvasHeight = height * ratio;
+ var drawData = WebInspector.CPUProfileFlameChart.OverviewPane.calculateDrawData(dataProvider, timelineData, canvasWidth);
+ if (!drawData)
+ return;
+
var yScaleFactor = canvasHeight / (dataProvider.maxStackDepth() * 1.1);
context.lineWidth = 1;
context.translate(0.5, 0.5);
context.strokeStyle = "rgba(20,0,0,0.4)";
context.fillStyle = "rgba(214,225,254,0.8)";
context.moveTo(-1, canvasHeight - 1);
- if (drawData)
- context.lineTo(-1, Math.round(height - drawData[0] * yScaleFactor - 1));
+ context.lineTo(-1, Math.round(canvasHeight - drawData[0] * yScaleFactor - 1));
var value;
- for (var x = 0; x < width; ++x) {
+ for (var x = 0; x < canvasWidth; ++x) {
value = Math.round(canvasHeight - drawData[x] * yScaleFactor - 1);
- context.lineTo(x * ratio, value);
+ context.lineTo(x, value);
}
context.lineTo(canvasWidth + 1, value);
context.lineTo(canvasWidth + 1, canvasHeight - 1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698