| OLD | NEW |
| 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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 * @param {!Event} event | 690 * @param {!Event} event |
| 691 */ | 691 */ |
| 692 _onContextMenu(event) { | 692 _onContextMenu(event) { |
| 693 var contextMenu = new UI.ContextMenu(event); | 693 var contextMenu = new UI.ContextMenu(event); |
| 694 contextMenu.appendItem( | 694 contextMenu.appendItem( |
| 695 Common.UIString('Reset View'), this._transformController.resetAndNotify.
bind(this._transformController), false); | 695 Common.UIString('Reset View'), this._transformController.resetAndNotify.
bind(this._transformController), false); |
| 696 var selection = this._selectionFromEventPoint(event); | 696 var selection = this._selectionFromEventPoint(event); |
| 697 if (selection && selection.type() === LayerViewer.LayerView.Selection.Type.S
napshot) { | 697 if (selection && selection.type() === LayerViewer.LayerView.Selection.Type.S
napshot) { |
| 698 contextMenu.appendItem( | 698 contextMenu.appendItem( |
| 699 Common.UIString('Show Paint Profiler'), | 699 Common.UIString('Show Paint Profiler'), |
| 700 this.dispatchEventToListeners.bind( | 700 this.dispatchEventToListeners.bind(this, LayerViewer.Layers3DView.Even
ts.PaintProfilerRequested, selection), |
| 701 this, LayerViewer.Layers3DView.Events.PaintProfilerRequested, sele
ction.snapshot()), | |
| 702 false); | 701 false); |
| 703 } | 702 } |
| 704 this._layerViewHost.showContextMenu(contextMenu, selection); | 703 this._layerViewHost.showContextMenu(contextMenu, selection); |
| 705 } | 704 } |
| 706 | 705 |
| 707 /** | 706 /** |
| 708 * @param {!Event} event | 707 * @param {!Event} event |
| 709 */ | 708 */ |
| 710 _onMouseMove(event) { | 709 _onMouseMove(event) { |
| 711 if (event.which) | 710 if (event.which) |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 * @return {!Promise} | 1177 * @return {!Promise} |
| 1179 */ | 1178 */ |
| 1180 update(glContext, scale) { | 1179 update(glContext, scale) { |
| 1181 this._gl = glContext; | 1180 this._gl = glContext; |
| 1182 this.scale = scale; | 1181 this.scale = scale; |
| 1183 return this.snapshot.replay(null, null, scale).then(imageURL => imageURL &&
UI.loadImage(imageURL)).then(image => { | 1182 return this.snapshot.replay(null, null, scale).then(imageURL => imageURL &&
UI.loadImage(imageURL)).then(image => { |
| 1184 this.texture = image && LayerViewer.LayerTextureManager._createTextureForI
mage(glContext, image); | 1183 this.texture = image && LayerViewer.LayerTextureManager._createTextureForI
mage(glContext, image); |
| 1185 }); | 1184 }); |
| 1186 } | 1185 } |
| 1187 }; | 1186 }; |
| OLD | NEW |