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

Side by Side Diff: tools/cc-frame-viewer/src/quad_view.js

Issue 12287014: [cc-frame-viewer] Show layers and levels of detail (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 'use strict'; 5 'use strict';
6 6
7 base.require('ui'); 7 base.require('ui');
8 base.require('quad_view_viewport'); 8 base.require('quad_view_viewport');
9 base.requireStylesheet('quad_view'); 9 base.requireStylesheet('quad_view');
10 10
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 createSelection_: function(quadIndices) { 200 createSelection_: function(quadIndices) {
201 return new QuadViewSelection(this, quadIndices); 201 return new QuadViewSelection(this, quadIndices);
202 }, 202 },
203 selectQuadsAtCanvasClientPoint: function(clientX, clientY) { 203 selectQuadsAtCanvasClientPoint: function(clientX, clientY) {
204 var selection = this.createSelection_( 204 var selection = this.createSelection_(
205 this.findQuadsAtCanvasClientPoint(clientX, clientY)); 205 this.findQuadsAtCanvasClientPoint(clientX, clientY));
206 var e = new base.Event('selection-changed'); 206 var e = new base.Event('selection-changed');
207 e.selection = selection; 207 e.selection = selection;
208 this.dispatchEvent(e); 208 this.dispatchEvent(e);
209 this.viewport_.forceRedrawAll();
209 }, 210 },
210 211
211 findQuadsAtCanvasClientPoint: function(clientX, clientY) { 212 findQuadsAtCanvasClientPoint: function(clientX, clientY) {
212 var bounds = this.canvas_.getBoundingClientRect(); 213 var bounds = this.canvas_.getBoundingClientRect();
213 var vecInLayout = vec2.createXY(clientX - bounds.left, 214 var vecInLayout = vec2.createXY(clientX - bounds.left,
214 clientY - bounds.top); 215 clientY - bounds.top);
215 var vecInWorldPixels = 216 var vecInWorldPixels =
216 this.viewport_.layoutPixelsToWorldPixels2(vecInLayout); 217 this.viewport_.layoutPixelsToWorldPixels2(vecInLayout);
217 var pointInWorldPixels = vec2.asPoint(vecInWorldPixels); 218 var pointInWorldPixels = vec2.asPoint(vecInWorldPixels);
218 219
(...skipping 29 matching lines...) Expand all
248 } 249 }
249 250
250 }; 251 };
251 252
252 return { 253 return {
253 QuadView: QuadView, 254 QuadView: QuadView,
254 QuadViewSelection: QuadViewSelection, 255 QuadViewSelection: QuadViewSelection,
255 } 256 }
256 }); 257 });
257 258
OLDNEW
« no previous file with comments | « tools/cc-frame-viewer/src/model_view_test.html ('k') | tools/cc-frame-viewer/src/quad_view_viewport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698