Home | History | Annotate | Download | only in chromium-trace

Lines Matching refs:viewport

369 base.exportTo("tracing.tracks",function(){var d=tracing.getColorPaletteHighlightIdBoost(),b=ui.define("track",ui.ContainerThatDecoratesItsChildren);b.prototype={__proto__:ui.ContainerThatDecoratesItsChildren.prototype,decorate:function(a){ui.ContainerThatDecoratesItsChildren.prototype.decorate.call(this);if(void 0===a)throw Error("viewport is required when creating a Track.");this.viewport_=a;this.classList.add("track");this.categoryFilter_=void 0},get viewport(){return this.viewport_},context:function(){if(this.parentNode){if(!this.parentNode.context)throw Error("Parent container does not support context() method.");
371 c,b){},setupCanvasForDraw_:function(){var a=this.context(),c=window.devicePixelRatio||1,b=this.getBoundingClientRect(),d=a.canvas.getBoundingClientRect();a.translate(0,c*(b.top-d.top));a=this.viewport.xViewToWorld(0);c=this.viewport.xViewToWorld(b.width*c);return{left:a,right:c}},decorateHit:function(a){},addIntersectingItemsInRangeToSelection:function(a,c,b,d,g){var h=window.devicePixelRatio||1,k=this.viewport.xViewVectorToWorld(1);a=this.viewport.xViewToWorld(a*h);c=this.viewport.xViewToWorld(c*
372 h);h=this.getBoundingClientRect();b=Math.max(b,h.top);d=Math.min(d,h.bottom);b>d||this.addIntersectingItemsInRangeToSelectionInWorldSpace(a,c,k,g)},addIntersectingItemsInRangeToSelectionInWorldSpace:function(a,c,b,d){},drawInstantEvents_:function(a,c,b){var f=this.context(),g=window.devicePixelRatio||1,g=this.getBoundingClientRect().height*g,h=this.viewport,k=h.xViewVectorToWorld(1),l=tracing.getColorPalette();f.save();h.applyTransformToCanvas(f);h=new tracing.FastRectRenderer(f,2*k,2*k,l);h.setYandH(0,
375 this.viewportChange_=this.viewportChange_.bind(this);this.viewport.addEventListener("change",this.viewportChange_)},get canvas(){return this.canvas_},context:function(){return this.ctx_},viewportChange_:function(){this.invalidate()},invalidate:function(){this.rafPending_||(this.rafPending_=!0,base.requestPreAnimationFrame(function(){this.rafPending_=!1;this.ctx_.clearRect(0,0,this.canvas_.width,this.canvas_.height);this.updateCanvasSizeIfNeeded_();base.requestAnimationFrameInThisFrameIfPossible(function(){for(var a=
376 0;a<this.children.length;++a)this.children[a]instanceof tracing.tracks.Track&&this.children[a].drawTrack(d.INSTANT_EVENT);for(a=0;a<this.children.length;++a)this.children[a]instanceof tracing.tracks.Track&&this.children[a].drawTrack(d.SLICE);var c=window.devicePixelRatio||1,b=this.canvas_.getBoundingClientRect(),a=this.viewport.xViewToWorld(0),c=this.viewport.xViewToWorld(b.width*c);this.viewport.drawGridLines(this.ctx_,a,c);this.viewport.drawMarkerLines(this.ctx_,a,c)},this)},this))},updateCanvasSizeIfNeeded_:function(){var a=
382 detach:function(){tracing.tracks.HeadingTrack.prototype.detach.call(this);this.viewport.removeEventListener("markersChange",this.viewportMarkersChange_)},viewportMarkersChange_:function(){2>this.viewport.markers.length?this.classList.remove("ruler-track-with-distance-measurements"):this.classList.add("ruler-track-with-distance-measurements")},onMouseDown:function(a){0===a.button&&this.placeAndBeginDraggingMarker(a.clientX)},placeAndBeginDraggingMarker:function(a){var b=window.devicePixelRatio||1;
383 a=this.viewport.xViewToWorld((a-this.offsetLeft-tracing.constants.HEADING_WIDTH)*b);var e=this.viewport.findMarkerNear(a,6),d=!1,g=!1;e||(e=this.viewport.addMarker(a),d=!0);e.selected=!0;var h=function(a){a=this.viewport.xViewToWorld((a.clientX-this.offsetLeft-tracing.constants.HEADING_WIDTH)*b);e.positionWorld=a;g=!0}.bind(this),k=function(a){e.selected=!1;g||d||this.viewport.removeMarker(e);document.removeEventListener("mouseup",k);document.removeEventListener("mousemove",h)}.bind(this);document.addEventListener("mouseup",
385 e)}},drawSlices_:function(a,c){var e=this.context(),d=window.devicePixelRatio||1,g=this.getBoundingClientRect(),h=g.width*d,k=g.height*d,l=this.classList.contains("ruler-track-with-distance-measurements"),g=l?k/2:k,m=this.viewport;m.drawMarkerArrows(e,a,c,g);var d=150*d,n=m.xViewVectorToWorld(d),p,q,t,v;v=Math.pow(10,Math.ceil(Math.log(n)/b));q=[10,5,2,1];for(n=0;n<q.length;++n)if(!(m.xWorldVectorToView(v/q[n])<d)){p=v/q[n-1];break}v=void 0;100>p?(q="ms",t=1,v=this.strings_msecs_):(q="s",t=1E3,v=
400 f=window.devicePixelRatio||1,g=this.getBoundingClientRect().height*f,p=this.viewport,q=p.xViewVectorToWorld(1);d.save();p.applyTransformToCanvas(d);this.asyncStyle_&&(d.globalAlpha=0.25);var t=new tracing.FastRectRenderer(d,2*q,2*q,a);t.setYandH(0,g);for(var v=this.slices_,w=base.findLowIndexInSortedArray(v,function(a){return a.start+a.duration},b),s=w;s<v.length;++s){var r=v[s],u=r.start;if(u>c)break;var x=Math.max(r.duration,0.001),y=r.selected?r.colorId+e:r.colorId;x<q&&(x=q);0<r.duration?t.fillRect(u,
407 updateContents_:function(){this.detach();if(this.cpu_){var b=tracing.filterSliceArray(this.categoryFilter_,this.cpu_.slices);if(b.length){var a=new tracing.tracks.SliceTrack(this.viewport);a.slices=b;a.heading="CPU "+this.cpu_.cpuNumber+":";this.appendChild(a)}for(var c in this.cpu_.counters){b=this.cpu_.counters[c];if(!this.categoryFilter_.matchCounter(b))break;a=new tracing.tracks.CounterTrack(this.viewport);a.heading="CPU "+this.cpu_.cpuNumber+" "+b.name+":";a.counter=b;a.categoryFilter=this.categoryFilter_;
411 d)}},drawSlices_:function(a,e){var f=this.context(),g=window.devicePixelRatio||1,h=this.getBoundingClientRect().height*g,k=0.5*h,l=2*Math.PI,m=this.viewport,n=this.snapshotRadiusView,p=m.xViewVectorToWorld(h),q;f.save();m.applyTransformToCanvas(f);var t=this.objectInstances_;q=base.findLowIndexInSortedArray(t,function(a){return a.deletionTs},a);f.globalAlpha=0.25;for(f.strokeStyle="rgb(0,0,0)";q<t.length;++q){var v=t[q],w=v.creationTs;if(w>e)break;var s=v.selected?v.colorId+b:v.colorId,v=v.deletionTs==
419 g=window.devicePixelRatio||1,h=this.getBoundingClientRect(),k=h.width*g,g=h.height*g,h=this.viewport,l=this.maxBytes_,m=this.objectInstance_.snapshots,n=base.findLowIndexInSortedArray(m,function(a){return a.ts},a);for(0<n&&(n-=1);n<m.length;++n){var p=m[n],q=p.ts;if(q>e)break;q=h.xWorldToView(q);0>q&&(q=0);var t=h.xWorldToView(n<m.length-1?m[n+1].ts:m[m.length-1].ts+5E3);t>k&&(t=k);for(var q=Math.floor(q),t=Math.floor(t),v=g,w=Object.keys(p.heap_.children),s=w.length-1;0<=s;s--){var r=p.heap_.children[w[s]];
424 set categoryFilter(a){this.categoryFilter_=a},get selectedSamples(){return this.selectedSamples_},draw:function(a,b,e){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,e)}},drawSlices_:function(a,b){var e=this.context(),f=window.devicePixelRatio||1,f=this.getBoundingClientRect().height*f,g=this.counter_,h=this.viewport,k=h.xViewVectorToWorld(1),l=h.xViewVectorToWorld(1);e.save();h.applyTransformToCanvas(e);for(var h=g.numSeries,m=g.numSamples,n=base.findLowIndexInSortedArray(g.timestamps,
430 get tooltip(){return this.tooltip_},set tooltip(b){this.tooltip_=b;this.updateContents_()},set decorateHit(b){this.decorateHit_=b;this.updateContents_()},addSliceTrack_:function(b){var a=new tracing.tracks.SliceTrack(this.viewport);a.slices=b;a.decorateHit=this.decorateHit_;a.categoryFilter_=this.categoryFilter;this.appendChild(a);return a},get subRows(){return base.asArray(this.children).map(function(b){return b.slices})},get hasVisibleContent(){return 0<this.children.length},updateContents_:function(){if(this.group_){var b=
438 ": ";this.tooltip=this.thread_.userFriendlyDetails;if(this.thread_.asyncSliceGroup.length){var b=new tracing.tracks.AsyncSliceGroupTrack(this.viewport);b.categoryFilter=this.categoryFilter;b.decorateHit=function(a){};b.group=this.thread_.asyncSliceGroup;b.hasVisibleContent&&this.appendChild(b)}this.thread_.samples.length&&(b=new tracing.tracks.SliceTrack(this.viewport),b.categoryFilter=b,b.group=this.thread_,b.slices=this.thread_.samples,b.decorateHit=function(a){a.thread=this.thread_},this.appendChild(b));
439 this.thread_.cpuSlices&&(b=new tracing.tracks.SliceTrack(this.viewport),b.categoryFilter=this.categoryFilter,b.heading="",b.height="4px",b.decorateHit=function(a){a.thread=this.thread_},b.slices=this.thread_.cpuSlices,b.hasVisibleContent&&this.appendChild(b));this.thread_.sliceGroup.length&&(b=new tracing.tracks.SliceGroupTrack(this.viewport),b.categoryFilter=this.categoryFilter,b.heading=this.thread_.userFriendlyName,b.tooltip=this.thread_.userFriendlyDetails,b.decorateHit=function(a){a.thread=this.thread_},
451 !n||g.push(q))}0!==g.length&&(c=tracing.tracks.ObjectInstanceTrack.getTrackConstructor(c),c||(c=tracing.tracks.ObjectInstanceTrack),c=new c(this.viewport),c.categoryFilter=this.categoryFilter_,c.objectInstances=g,this.appendChild(c),h=!0)},this);h&&this.appendChild(new c(this.viewport))},appendCounterTracks_:function(){var a=base.dictionaryValues(this.processBase.counters).filter(this.categoryFilter.matchCounter,this.categoryFilter);a.sort(tracing.trace_model.Counter.compare);a.forEach(function(a){var b=
452 new tracing.tracks.CounterTrack(this.viewport);b.categoryFilter=this.categoryFilter_;b.counter=a;this.appendChild(b);this.appendChild(new c(this.viewport))}.bind(this))},appendThreadTracks_:function(){var a=base.dictionaryValues(this.processBase.threads).filter(function(a){return this.categoryFilter_.matchThread(a)},this);a.sort(tracing.trace_model.Thread.compare);a.forEach(function(a){var b=new tracing.tracks.ThreadTrack(this.viewport);b.categoryFilter=this.categoryFilter_;b.thread=a;b.hasVisibleContent&&
453 (this.appendChild(b),this.appendChild(new c(this.viewport)))}.bind(this))}};return{ProcessTrackBase:e}});"use strict";base.require("tracing.tracks.process_track_base");base.require("tracing.tracks.cpu_track");base.require("tracing.tracks.spacing_track");
455 d[g];if(!a.matchCpu(h))return;var k=new tracing.tracks.CpuTrack(this.viewport);k.categoryFilter=a;k.cpu=h;k.hasVisibleContent&&(this.appendChild(k),f=!0)}f&&this.appendChild(new b(this.viewport))}};return{KernelTrack:a}});"use strict";base.require("tracing.tracks.process_track_base");
460 applyCategoryFilter_:function(){this.updateContents_()},updateContents_:function(){this.textContent="";if(this.model_&&this.categoryFilter){var b=this.categoryFilter;this.appendKernelTrack_();var a=this.model_.getAllProcesses();a.sort(tracing.trace_model.Process.compare);for(var c=0;c<a.length;++c){var d=a[c];if(!b.matchProcess(d))break;var f=new tracing.tracks.ProcessTrack(this.viewport);f.categoryFilter=b;f.process=d;f.hasVisibleContent&&this.appendChild(f)}}},appendKernelTrack_:function(){if(this.categoryFilter.matchProcess(this.model.kernel)){var b=
461 new tracing.tracks.KernelTrack(this.viewport);b.categoryFilter=this.categoryFilter;b.kernel=this.model.kernel;b.hasVisibleContent&&this.appendChild(b)}},drawTrack:function(b){switch(b){case tracing.tracks.DrawType.INSTANT_EVENT:if(!this.model_.instantEvents||0===this.model_.instantEvents.length)break;var a=this.context();if(void 0===a)break;a.save();var c=this.setupCanvasForDraw_();this.drawInstantEvents_(this.model_.instantEvents,c.left,c.right);a.restore()}tracing.tracks.ContainerTrack.prototype.drawTrack.call(this,
482 (this.boundListeners_=[]);d=d.bind(g);this.boundListeners_.push({object:a,event:b,boundFunc:d});a.addEventListener(b,d)},detach:function(){this.modelTrack_.detach();for(var a=0;a<this.boundListeners_.length;a++){var b=this.boundListeners_[a];b.object.removeEventListener(b.event,b.boundFunc)}this.boundListeners_=void 0;this.viewport_.detach()},get viewport(){return this.viewport_},get categoryFilter(){return this.categoryFilter_},set categoryFilter(a){this.modelTrackContainer_.invalidate();this.categoryFilter_=