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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 this._selectionWindow.addEventListener(WebInspector.OverviewGrid.Events.Wind
owChanged, this._onWindowChanged, this); | 53 this._selectionWindow.addEventListener(WebInspector.OverviewGrid.Events.Wind
owChanged, this._onWindowChanged, this); |
54 | 54 |
55 this._innerBarWidth = 4 * window.devicePixelRatio; | 55 this._innerBarWidth = 4 * window.devicePixelRatio; |
56 this._minBarHeight = window.devicePixelRatio; | 56 this._minBarHeight = window.devicePixelRatio; |
57 this._barPaddingWidth = 2 * window.devicePixelRatio; | 57 this._barPaddingWidth = 2 * window.devicePixelRatio; |
58 this._outerBarWidth = this._innerBarWidth + this._barPaddingWidth; | 58 this._outerBarWidth = this._innerBarWidth + this._barPaddingWidth; |
59 this._pendingScale = 1; | 59 this._pendingScale = 1; |
60 this._scale = this._pendingScale; | 60 this._scale = this._pendingScale; |
61 | 61 |
62 this._reset(); | 62 this._reset(); |
63 } | 63 }; |
64 | 64 |
65 /** @enum {symbol} */ | 65 /** @enum {symbol} */ |
66 WebInspector.PaintProfilerView.Events = { | 66 WebInspector.PaintProfilerView.Events = { |
67 WindowChanged: Symbol("WindowChanged") | 67 WindowChanged: Symbol("WindowChanged") |
68 }; | 68 }; |
69 | 69 |
70 WebInspector.PaintProfilerView.prototype = { | 70 WebInspector.PaintProfilerView.prototype = { |
71 onResize: function() | 71 onResize: function() |
72 { | 72 { |
73 this._update(); | 73 this._update(); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 WebInspector.PaintProfilerCommandLogView = function() | 281 WebInspector.PaintProfilerCommandLogView = function() |
282 { | 282 { |
283 WebInspector.ThrottledWidget.call(this); | 283 WebInspector.ThrottledWidget.call(this); |
284 this.setMinimumSize(100, 25); | 284 this.setMinimumSize(100, 25); |
285 this.element.classList.add("overflow-auto"); | 285 this.element.classList.add("overflow-auto"); |
286 | 286 |
287 this._treeOutline = new TreeOutlineInShadow(); | 287 this._treeOutline = new TreeOutlineInShadow(); |
288 this.element.appendChild(this._treeOutline.element); | 288 this.element.appendChild(this._treeOutline.element); |
289 | 289 |
290 this._log = []; | 290 this._log = []; |
291 } | 291 }; |
292 | 292 |
293 WebInspector.PaintProfilerCommandLogView.prototype = { | 293 WebInspector.PaintProfilerCommandLogView.prototype = { |
294 /** | 294 /** |
295 * @param {?WebInspector.Target} target | 295 * @param {?WebInspector.Target} target |
296 * @param {!Array.<!WebInspector.PaintProfilerLogItem>} log | 296 * @param {!Array.<!WebInspector.PaintProfilerLogItem>} log |
297 */ | 297 */ |
298 setCommandLog: function(target, log) | 298 setCommandLog: function(target, log) |
299 { | 299 { |
300 this._target = target; | 300 this._target = target; |
301 this._log = log; | 301 this._log = log; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 * @param {!WebInspector.PaintProfilerCommandLogView} ownerView | 364 * @param {!WebInspector.PaintProfilerCommandLogView} ownerView |
365 * @param {!WebInspector.PaintProfilerLogItem} logItem | 365 * @param {!WebInspector.PaintProfilerLogItem} logItem |
366 * @extends {TreeElement} | 366 * @extends {TreeElement} |
367 */ | 367 */ |
368 WebInspector.LogTreeElement = function(ownerView, logItem) | 368 WebInspector.LogTreeElement = function(ownerView, logItem) |
369 { | 369 { |
370 TreeElement.call(this, "", !!logItem.params); | 370 TreeElement.call(this, "", !!logItem.params); |
371 this._logItem = logItem; | 371 this._logItem = logItem; |
372 this._ownerView = ownerView; | 372 this._ownerView = ownerView; |
373 this._filled = false; | 373 this._filled = false; |
374 } | 374 }; |
375 | 375 |
376 WebInspector.LogTreeElement.prototype = { | 376 WebInspector.LogTreeElement.prototype = { |
377 onattach: function() | 377 onattach: function() |
378 { | 378 { |
379 this._update(); | 379 this._update(); |
380 }, | 380 }, |
381 | 381 |
382 onpopulate: function() | 382 onpopulate: function() |
383 { | 383 { |
384 for (var param in this._logItem.params) | 384 for (var param in this._logItem.params) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 separatorElement.textContent = ": "; | 467 separatorElement.textContent = ": "; |
468 if (this._property.value === null || typeof this._property.value !== "ob
ject") { | 468 if (this._property.value === null || typeof this._property.value !== "ob
ject") { |
469 var valueElement = title.createChild("span", "value"); | 469 var valueElement = title.createChild("span", "value"); |
470 valueElement.textContent = JSON.stringify(this._property.value); | 470 valueElement.textContent = JSON.stringify(this._property.value); |
471 valueElement.classList.add("cm-js-" + (this._property.value === null
? "null" : typeof this._property.value)); | 471 valueElement.classList.add("cm-js-" + (this._property.value === null
? "null" : typeof this._property.value)); |
472 } | 472 } |
473 this.title = title; | 473 this.title = title; |
474 }, | 474 }, |
475 | 475 |
476 __proto__: TreeElement.prototype | 476 __proto__: TreeElement.prototype |
477 } | 477 }; |
478 | 478 |
479 /** | 479 /** |
480 * @return {!Object.<string, !WebInspector.PaintProfilerCategory>} | 480 * @return {!Object.<string, !WebInspector.PaintProfilerCategory>} |
481 */ | 481 */ |
482 WebInspector.PaintProfilerView.categories = function() | 482 WebInspector.PaintProfilerView.categories = function() |
483 { | 483 { |
484 if (WebInspector.PaintProfilerView._categories) | 484 if (WebInspector.PaintProfilerView._categories) |
485 return WebInspector.PaintProfilerView._categories; | 485 return WebInspector.PaintProfilerView._categories; |
486 WebInspector.PaintProfilerView._categories = { | 486 WebInspector.PaintProfilerView._categories = { |
487 shapes: new WebInspector.PaintProfilerCategory("shapes", WebInspector.UI
String("Shapes"), "rgb(255, 161, 129)"), | 487 shapes: new WebInspector.PaintProfilerCategory("shapes", WebInspector.UI
String("Shapes"), "rgb(255, 161, 129)"), |
488 bitmap: new WebInspector.PaintProfilerCategory("bitmap", WebInspector.UI
String("Bitmap"), "rgb(136, 196, 255)"), | 488 bitmap: new WebInspector.PaintProfilerCategory("bitmap", WebInspector.UI
String("Bitmap"), "rgb(136, 196, 255)"), |
489 text: new WebInspector.PaintProfilerCategory("text", WebInspector.UIStri
ng("Text"), "rgb(180, 255, 137)"), | 489 text: new WebInspector.PaintProfilerCategory("text", WebInspector.UIStri
ng("Text"), "rgb(180, 255, 137)"), |
490 misc: new WebInspector.PaintProfilerCategory("misc", WebInspector.UIStri
ng("Misc"), "rgb(206, 160, 255)") | 490 misc: new WebInspector.PaintProfilerCategory("misc", WebInspector.UIStri
ng("Misc"), "rgb(206, 160, 255)") |
491 }; | 491 }; |
492 return WebInspector.PaintProfilerView._categories; | 492 return WebInspector.PaintProfilerView._categories; |
493 }; | 493 }; |
494 | 494 |
495 /** | 495 /** |
496 * @constructor | 496 * @constructor |
497 * @param {string} name | 497 * @param {string} name |
498 * @param {string} title | 498 * @param {string} title |
499 * @param {string} color | 499 * @param {string} color |
500 */ | 500 */ |
501 WebInspector.PaintProfilerCategory = function(name, title, color) | 501 WebInspector.PaintProfilerCategory = function(name, title, color) |
502 { | 502 { |
503 this.name = name; | 503 this.name = name; |
504 this.title = title; | 504 this.title = title; |
505 this.color = color; | 505 this.color = color; |
506 } | 506 }; |
507 | 507 |
508 /** | 508 /** |
509 * @return {!Object.<string, !WebInspector.PaintProfilerCategory>} | 509 * @return {!Object.<string, !WebInspector.PaintProfilerCategory>} |
510 */ | 510 */ |
511 WebInspector.PaintProfilerView._initLogItemCategories = function() | 511 WebInspector.PaintProfilerView._initLogItemCategories = function() |
512 { | 512 { |
513 if (WebInspector.PaintProfilerView._logItemCategoriesMap) | 513 if (WebInspector.PaintProfilerView._logItemCategoriesMap) |
514 return WebInspector.PaintProfilerView._logItemCategoriesMap; | 514 return WebInspector.PaintProfilerView._logItemCategoriesMap; |
515 | 515 |
516 var categories = WebInspector.PaintProfilerView.categories(); | 516 var categories = WebInspector.PaintProfilerView.categories(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 logItemCategories["DrawBitmapNine"] = categories["bitmap"]; | 548 logItemCategories["DrawBitmapNine"] = categories["bitmap"]; |
549 logItemCategories["DrawSprite"] = categories["bitmap"]; | 549 logItemCategories["DrawSprite"] = categories["bitmap"]; |
550 logItemCategories["DrawPicture"] = categories["bitmap"]; | 550 logItemCategories["DrawPicture"] = categories["bitmap"]; |
551 logItemCategories["DrawText"] = categories["text"]; | 551 logItemCategories["DrawText"] = categories["text"]; |
552 logItemCategories["DrawPosText"] = categories["text"]; | 552 logItemCategories["DrawPosText"] = categories["text"]; |
553 logItemCategories["DrawPosTextH"] = categories["text"]; | 553 logItemCategories["DrawPosTextH"] = categories["text"]; |
554 logItemCategories["DrawTextOnPath"] = categories["text"]; | 554 logItemCategories["DrawTextOnPath"] = categories["text"]; |
555 | 555 |
556 WebInspector.PaintProfilerView._logItemCategoriesMap = logItemCategories; | 556 WebInspector.PaintProfilerView._logItemCategoriesMap = logItemCategories; |
557 return logItemCategories; | 557 return logItemCategories; |
558 } | 558 }; |
559 | 559 |
560 /** | 560 /** |
561 * @param {!Object} logItem | 561 * @param {!Object} logItem |
562 * @return {!WebInspector.PaintProfilerCategory} | 562 * @return {!WebInspector.PaintProfilerCategory} |
563 */ | 563 */ |
564 WebInspector.PaintProfilerView._categoryForLogItem = function(logItem) | 564 WebInspector.PaintProfilerView._categoryForLogItem = function(logItem) |
565 { | 565 { |
566 var method = logItem.method.toTitleCase(); | 566 var method = logItem.method.toTitleCase(); |
567 | 567 |
568 var logItemCategories = WebInspector.PaintProfilerView._initLogItemCategorie
s(); | 568 var logItemCategories = WebInspector.PaintProfilerView._initLogItemCategorie
s(); |
569 var result = logItemCategories[method]; | 569 var result = logItemCategories[method]; |
570 if (!result) { | 570 if (!result) { |
571 result = WebInspector.PaintProfilerView.categories()["misc"]; | 571 result = WebInspector.PaintProfilerView.categories()["misc"]; |
572 logItemCategories[method] = result; | 572 logItemCategories[method] = result; |
573 } | 573 } |
574 return result; | 574 return result; |
575 } | 575 }; |
OLD | NEW |