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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineView.js

Issue 326063004: Correctly calculate highlighted quad for tracing based timeline events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comment Created 6 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
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 */ 822 */
823 _highlightQuad: function(rowElement) 823 _highlightQuad: function(rowElement)
824 { 824 {
825 if (!rowElement || !rowElement.row) 825 if (!rowElement || !rowElement.row)
826 return false; 826 return false;
827 var record = rowElement.row._record.record(); 827 var record = rowElement.row._record.record();
828 if (this._highlightedQuadRecord === record) 828 if (this._highlightedQuadRecord === record)
829 return true; 829 return true;
830 this._highlightedQuadRecord = record; 830 this._highlightedQuadRecord = record;
831 831
832 var quad = null; 832 var quad = record.highlightQuad();
833 var recordTypes = WebInspector.TimelineModel.RecordType;
834 switch(record.type()) {
835 case recordTypes.Layout:
836 quad = record.data().root;
837 break;
838 case recordTypes.Paint:
839 quad = record.data().clip;
840 break;
841 default:
842 return false;
843 }
844 if (!quad) 833 if (!quad)
845 return false; 834 return false;
846 record.target().domAgent().highlightQuad(quad, WebInspector.Color.PageHi ghlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutlin e.toProtocolRGBA()); 835 record.target().domAgent().highlightQuad(quad, WebInspector.Color.PageHi ghlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutlin e.toProtocolRGBA());
847 return true; 836 return true;
848 }, 837 },
849 838
850 _hideQuadHighlight: function() 839 _hideQuadHighlight: function()
851 { 840 {
852 if (this._highlightedQuadRecord) { 841 if (this._highlightedQuadRecord) {
853 this._highlightedQuadRecord.target().domAgent().hideHighlight(); 842 this._highlightedQuadRecord.target().domAgent().hideHighlight();
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 this._element.classList.remove("hidden"); 1288 this._element.classList.remove("hidden");
1300 } else 1289 } else
1301 this._element.classList.add("hidden"); 1290 this._element.classList.add("hidden");
1302 }, 1291 },
1303 1292
1304 _dispose: function() 1293 _dispose: function()
1305 { 1294 {
1306 this._element.remove(); 1295 this._element.remove();
1307 } 1296 }
1308 } 1297 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModelImpl.js ('k') | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698