| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @param {function(string=)} showImageCallback | 33 * @param {function(string=)} showImageCallback |
| 34 * @extends {WebInspector.HBox} | 34 * @extends {WebInspector.HBox} |
| 35 */ | 35 */ |
| 36 WebInspector.PaintProfilerView = function(showImageCallback) | 36 WebInspector.PaintProfilerView = function(showImageCallback) |
| 37 { | 37 { |
| 38 WebInspector.HBox.call(this); | 38 WebInspector.HBox.call(this, true); |
| 39 this.element.classList.add("paint-profiler-overview", "hbox"); | 39 this.registerRequiredCSS("layer_viewer/paintProfiler.css"); |
| 40 this._canvasContainer = this.element.createChild("div", "paint-profiler-canv
as-container"); | 40 this.contentElement.classList.add("paint-profiler-overview"); |
| 41 this._progressBanner = this.element.createChild("div", "banner hidden"); | 41 this._canvasContainer = this.contentElement.createChild("div", "paint-profil
er-canvas-container"); |
| 42 this._progressBanner = this.contentElement.createChild("div", "banner hidden
"); |
| 42 this._progressBanner.textContent = WebInspector.UIString("Profiling\u2026"); | 43 this._progressBanner.textContent = WebInspector.UIString("Profiling\u2026"); |
| 43 this._pieChart = new WebInspector.PieChart(55, this._formatPieChartTime.bind
(this), true); | 44 this._pieChart = new WebInspector.PieChart(55, this._formatPieChartTime.bind
(this), true); |
| 44 this._pieChart.element.classList.add("paint-profiler-pie-chart"); | 45 this._pieChart.element.classList.add("paint-profiler-pie-chart"); |
| 45 this.element.appendChild(this._pieChart.element); | 46 this.contentElement.appendChild(this._pieChart.element); |
| 46 | 47 |
| 47 this._showImageCallback = showImageCallback; | 48 this._showImageCallback = showImageCallback; |
| 48 | 49 |
| 49 this._canvas = this._canvasContainer.createChild("canvas", "fill"); | 50 this._canvas = this._canvasContainer.createChild("canvas", "fill"); |
| 50 this._context = this._canvas.getContext("2d"); | 51 this._context = this._canvas.getContext("2d"); |
| 51 this._selectionWindow = new WebInspector.OverviewGrid.Window(this._canvasCon
tainer); | 52 this._selectionWindow = new WebInspector.OverviewGrid.Window(this._canvasCon
tainer); |
| 52 this._selectionWindow.addEventListener(WebInspector.OverviewGrid.Events.Wind
owChanged, this._onWindowChanged, this); | 53 this._selectionWindow.addEventListener(WebInspector.OverviewGrid.Events.Wind
owChanged, this._onWindowChanged, this); |
| 53 | 54 |
| 54 this._innerBarWidth = 4 * window.devicePixelRatio; | 55 this._innerBarWidth = 4 * window.devicePixelRatio; |
| 55 this._minBarHeight = window.devicePixelRatio; | 56 this._minBarHeight = window.devicePixelRatio; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 }; | 253 }; |
| 253 | 254 |
| 254 /** | 255 /** |
| 255 * @constructor | 256 * @constructor |
| 256 * @extends {WebInspector.VBox} | 257 * @extends {WebInspector.VBox} |
| 257 */ | 258 */ |
| 258 WebInspector.PaintProfilerCommandLogView = function() | 259 WebInspector.PaintProfilerCommandLogView = function() |
| 259 { | 260 { |
| 260 WebInspector.VBox.call(this); | 261 WebInspector.VBox.call(this); |
| 261 this.setMinimumSize(100, 25); | 262 this.setMinimumSize(100, 25); |
| 262 this.element.classList.add("profiler-log-view"); | 263 this.element.classList.add("overflow-auto"); |
| 263 | 264 |
| 264 this._treeOutline = new TreeOutlineInShadow(); | 265 this._treeOutline = new TreeOutlineInShadow(); |
| 265 this.element.appendChild(this._treeOutline.element); | 266 this.element.appendChild(this._treeOutline.element); |
| 266 | 267 |
| 267 this._reset(); | 268 this._reset(); |
| 268 } | 269 } |
| 269 | 270 |
| 270 WebInspector.PaintProfilerCommandLogView.prototype = { | 271 WebInspector.PaintProfilerCommandLogView.prototype = { |
| 271 /** | 272 /** |
| 272 * @param {?WebInspector.Target} target | 273 * @param {?WebInspector.Target} target |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 var method = logItem.method.toTitleCase(); | 520 var method = logItem.method.toTitleCase(); |
| 520 | 521 |
| 521 var logItemCategories = WebInspector.PaintProfilerView._initLogItemCategorie
s(); | 522 var logItemCategories = WebInspector.PaintProfilerView._initLogItemCategorie
s(); |
| 522 var result = logItemCategories[method]; | 523 var result = logItemCategories[method]; |
| 523 if (!result) { | 524 if (!result) { |
| 524 result = WebInspector.PaintProfilerView.categories()["misc"]; | 525 result = WebInspector.PaintProfilerView.categories()["misc"]; |
| 525 logItemCategories[method] = result; | 526 logItemCategories[method] = result; |
| 526 } | 527 } |
| 527 return result; | 528 return result; |
| 528 } | 529 } |
| OLD | NEW |