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

Side by Side Diff: tracing/tracing/importer/find_input_expectations.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2015 The Chromium Authors. All rights reserved. 3 Copyright (c) 2015 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/range_utils.html"> 8 <link rel="import" href="/tracing/base/math/range_utils.html">
9 <link rel="import" href="/tracing/extras/chrome/cc/input_latency_async_slice.htm l"> 9 <link rel="import" href="/tracing/extras/chrome/cc/input_latency_async_slice.htm l">
10 <link rel="import" href="/tracing/importer/proto_expectation.html"> 10 <link rel="import" href="/tracing/importer/proto_expectation.html">
11 <link rel="import" href="/tracing/model/user_model/user_expectation.html"> 11 <link rel="import" href="/tracing/model/user_model/user_expectation.html">
12 12
13 <script> 13 <script>
14 'use strict'; 14 'use strict';
15 15
16 tr.exportTo('tr.importer', function() { 16 tr.exportTo('tr.importer', function() {
17 var ProtoExpectation = tr.importer.ProtoExpectation; 17 var ProtoExpectation = tr.importer.ProtoExpectation;
18 var INITIATOR_TYPE = tr.model.um.INITIATOR_TYPE; 18 var INITIATOR_TYPE = tr.model.um.INITIATOR_TYPE;
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 }); 789 });
790 790
791 791
792 // Time ranges where animations are actually running will be collected here. 792 // Time ranges where animations are actually running will be collected here.
793 // Each element will contain {min, max, animation}. 793 // Each element will contain {min, max, animation}.
794 var animationRanges = []; 794 var animationRanges = [];
795 795
796 // This helper function will be called when a time range is found 796 // This helper function will be called when a time range is found
797 // during which the animation is actually running. 797 // during which the animation is actually running.
798 function pushAnimationRange(start, end, animation) { 798 function pushAnimationRange(start, end, animation) {
799 var range = tr.b.Range.fromExplicitRange(start, end); 799 var range = tr.b.math.Range.fromExplicitRange(start, end);
800 range.animation = animation; 800 range.animation = animation;
801 animationRanges.push(range); 801 animationRanges.push(range);
802 } 802 }
803 803
804 animationEvents.forEach(function(animation) { 804 animationEvents.forEach(function(animation) {
805 if (animation.subSlices.length === 0) { 805 if (animation.subSlices.length === 0) {
806 pushAnimationRange(animation.start, animation.end, animation); 806 pushAnimationRange(animation.start, animation.end, animation);
807 } else { 807 } else {
808 // Now run a state machine over the animation's subSlices, which 808 // Now run a state machine over the animation's subSlices, which
809 // indicate the animations running/paused/finished states, in order to 809 // indicate the animations running/paused/finished states, in order to
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 1174
1175 for (var pe of protoExpectations) { 1175 for (var pe of protoExpectations) {
1176 if (pe.type !== ProtoExpectation.ANIMATION_TYPE) { 1176 if (pe.type !== ProtoExpectation.ANIMATION_TYPE) {
1177 newPEs.push(pe); 1177 newPEs.push(pe);
1178 continue; 1178 continue;
1179 } 1179 }
1180 1180
1181 var frameEvents = []; 1181 var frameEvents = [];
1182 // TODO(benjhayden): Use frame blame contexts here. 1182 // TODO(benjhayden): Use frame blame contexts here.
1183 for (var pid of Object.keys(modelHelper.rendererHelpers)) { 1183 for (var pid of Object.keys(modelHelper.rendererHelpers)) {
1184 var range = tr.b.Range.fromExplicitRange(pe.start, pe.end); 1184 var range = tr.b.math.Range.fromExplicitRange(pe.start, pe.end);
1185 frameEvents.push.apply(frameEvents, 1185 frameEvents.push.apply(frameEvents,
1186 range.filterArray(frameEventsByPid[pid], e => e.start)); 1186 range.filterArray(frameEventsByPid[pid], e => e.start));
1187 } 1187 }
1188 1188
1189 // If a tree falls in a forest... 1189 // If a tree falls in a forest...
1190 // If there were not actually any frames while the animation was 1190 // If there were not actually any frames while the animation was
1191 // running, then it wasn't really an animation, now, was it? 1191 // running, then it wasn't really an animation, now, was it?
1192 // Philosophy aside, the system_health Animation metrics fail hard if 1192 // Philosophy aside, the system_health Animation metrics fail hard if
1193 // there are no frames in an AnimationExpectation. 1193 // there are no frames in an AnimationExpectation.
1194 // Since WebGL animations don't generate this type of frame event, 1194 // Since WebGL animations don't generate this type of frame event,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 } 1268 }
1269 1269
1270 return { 1270 return {
1271 findInputExpectations, 1271 findInputExpectations,
1272 compareEvents, 1272 compareEvents,
1273 CSS_ANIMATION_TITLE, 1273 CSS_ANIMATION_TITLE,
1274 INITIATOR_TYPE, 1274 INITIATOR_TYPE,
1275 }; 1275 };
1276 }); 1276 });
1277 </script> 1277 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/extras/importer/trace_event_importer.html ('k') | tracing/tracing/importer/proto_expectation.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698