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

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

Issue 15736032: Remove old cc-frame-viewer now that it is upstreamed into trace_viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4 'use strict';
5
6 /**
7 * @fileoverview Quick range computations.
8 */
9 base.exportTo('base', function() {
10
11 function Range() {
12 this.isEmpty_ = true;
13 this.min_ = undefined;
14 this.max_ = undefined;
15 };
16
17 Range.prototype = {
18 __proto__: Object.prototype,
19
20 reset: function() {
21 this.isEmpty_ = true;
22 this.min_ = undefined;
23 this.max_ = undefined;
24 },
25
26 get isEmpty() {
27 return this.isEmpty_;
28 },
29
30 addRange: function(range) {
31 if (range.isEmpty)
32 return;
33 this.addValue(range.min);
34 this.addValue(range.max);
35 },
36
37 addValue: function(value) {
38 if (this.isEmpty_) {
39 this.max_ = value;
40 this.min_ = value;
41 this.isEmpty_ = false;
42 return;
43 }
44 this.max_ = Math.max(this.max_, value);
45 this.min_ = Math.min(this.min_, value);
46 },
47
48 get min() {
49 if (this.isEmpty_)
50 return undefined;
51 return this.min_;
52 },
53
54 get max() {
55 if (this.isEmpty_)
56 return undefined;
57 return this.max_;
58 },
59 };
60
61 return {
62 Range: Range
63 };
64
65 });
OLDNEW
« no previous file with comments | « tools/cc-frame-viewer/src/base/gl_matrix_test.html ('k') | tools/cc-frame-viewer/src/base/range_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698