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

Side by Side Diff: Source/core/inspector/InspectorTimelineAgent.cpp

Issue 91183002: Timeline: do not rely on UpdateLayer & PaintLayer trace events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: re-upload Created 7 years 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 TimelineRecordFactory::appendStyleRecalcDetails(entry.data.get(), m_styleRec alcElementCounter); 450 TimelineRecordFactory::appendStyleRecalcDetails(entry.data.get(), m_styleRec alcElementCounter);
451 m_styleRecalcElementCounter = 0; 451 m_styleRecalcElementCounter = 0;
452 didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles); 452 didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles);
453 } 453 }
454 454
455 void InspectorTimelineAgent::didRecalculateStyleForElement() 455 void InspectorTimelineAgent::didRecalculateStyleForElement()
456 { 456 {
457 ++m_styleRecalcElementCounter; 457 ++m_styleRecalcElementCounter;
458 } 458 }
459 459
460 void InspectorTimelineAgent::willPaint(RenderObject* renderer) 460 void InspectorTimelineAgent::willPaint(RenderObject* renderer, const GraphicsLay er* graphicsLayer)
461 { 461 {
462 Frame* frame = renderer->frame(); 462 Frame* frame = renderer->frame();
463 TRACE_EVENT_INSTANT2(InternalEventCategory, InstrumentationEvents::Paint, 463 m_nodeBeingPainted = nodeId(renderer);
464 InstrumentationEventArguments::PageId, reinterpret_cast<unsigned long lo ng>(frame->page()), 464 m_layerBeingPainted = graphicsLayer ? graphicsLayer->platformLayer()->id() : 0;
465 InstrumentationEventArguments::NodeId, nodeId(renderer)); 465 TRACE_EVENT_INSTANT1(InternalEventCategory, InstrumentationEvents::Paint,
466 466 InstrumentationEventArguments::PageId, reinterpret_cast<unsigned long lo ng>(frame->page()));
467 pushCurrentRecord(JSONObject::create(), TimelineRecordType::Paint, true, fra me, true); 467 pushCurrentRecord(JSONObject::create(), TimelineRecordType::Paint, true, fra me, true);
468 } 468 }
469 469
470 void InspectorTimelineAgent::didPaint(RenderObject* renderer, const GraphicsLaye r* graphicsLayer, GraphicsContext*, const LayoutRect& clipRect) 470 void InspectorTimelineAgent::didPaint(RenderObject* renderer, const GraphicsLaye r* graphicsLayer, GraphicsContext*, const LayoutRect& clipRect)
471 { 471 {
472 TimelineRecordEntry& entry = m_recordStack.last(); 472 TimelineRecordEntry& entry = m_recordStack.last();
473 ASSERT(entry.type == TimelineRecordType::Paint); 473 ASSERT(entry.type == TimelineRecordType::Paint);
474 FloatQuad quad; 474 FloatQuad quad;
475 localToPageQuad(*renderer, clipRect, &quad); 475 localToPageQuad(*renderer, clipRect, &quad);
476 int graphicsLayerId = graphicsLayer ? graphicsLayer->platformLayer()->id() : 0; 476 int graphicsLayerId = graphicsLayer ? graphicsLayer->platformLayer()->id() : 0;
477 entry.data = TimelineRecordFactory::createPaintData(quad, nodeId(renderer), graphicsLayerId); 477 entry.data = TimelineRecordFactory::createPaintData(quad, nodeId(renderer), graphicsLayerId);
478 m_nodeBeingPainted = 0;
479 m_layerBeingPainted = 0;
478 didCompleteCurrentRecord(TimelineRecordType::Paint); 480 didCompleteCurrentRecord(TimelineRecordType::Paint);
479 } 481 }
480 482
481 void InspectorTimelineAgent::willPaintImage(RenderImage* renderImage) 483 void InspectorTimelineAgent::willPaintImage(RenderImage* renderImage)
482 { 484 {
483 ASSERT(!m_imageBeingPainted); 485 ASSERT(!m_imageBeingPainted);
484 m_imageBeingPainted = renderImage; 486 m_imageBeingPainted = renderImage;
485 } 487 }
486 488
487 void InspectorTimelineAgent::didPaintImage() 489 void InspectorTimelineAgent::didPaintImage()
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 , m_frontend(0) 899 , m_frontend(0)
898 , m_id(1) 900 , m_id(1)
899 , m_maxCallStackDepth(5) 901 , m_maxCallStackDepth(5)
900 , m_platformInstrumentationClientInstalledAtStackDepth(0) 902 , m_platformInstrumentationClientInstalledAtStackDepth(0)
901 , m_inspectorType(type) 903 , m_inspectorType(type)
902 , m_client(client) 904 , m_client(client)
903 , m_weakFactory(this) 905 , m_weakFactory(this)
904 , m_styleRecalcElementCounter(0) 906 , m_styleRecalcElementCounter(0)
905 , m_layerTreeId(0) 907 , m_layerTreeId(0)
906 , m_imageBeingPainted(0) 908 , m_imageBeingPainted(0)
909 , m_nodeBeingPainted(0)
910 , m_layerBeingPainted(0)
907 , m_overlay(overlay) 911 , m_overlay(overlay)
908 { 912 {
909 } 913 }
910 914
911 void InspectorTimelineAgent::appendRecord(PassRefPtr<JSONObject> data, const Str ing& type, bool captureCallStack, Frame* frame) 915 void InspectorTimelineAgent::appendRecord(PassRefPtr<JSONObject> data, const Str ing& type, bool captureCallStack, Frame* frame)
912 { 916 {
913 pushGCEventRecords(); 917 pushGCEventRecords();
914 RefPtr<JSONObject> record = TimelineRecordFactory::createGenericRecord(times tamp(), captureCallStack ? m_maxCallStackDepth : 0, type); 918 RefPtr<JSONObject> record = TimelineRecordFactory::createGenericRecord(times tamp(), captureCallStack ? m_maxCallStackDepth : 0, type);
915 record->setObject("data", data); 919 record->setObject("data", data);
916 setFrameIdentifier(record.get(), frame); 920 setFrameIdentifier(record.get(), frame);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime()); 996 return m_timeConverter.fromMonotonicallyIncreasingTime(WTF::monotonicallyInc reasingTime());
993 } 997 }
994 998
995 Page* InspectorTimelineAgent::page() 999 Page* InspectorTimelineAgent::page()
996 { 1000 {
997 return m_pageAgent ? m_pageAgent->page() : 0; 1001 return m_pageAgent ? m_pageAgent->page() : 0;
998 } 1002 }
999 1003
1000 } // namespace WebCore 1004 } // namespace WebCore
1001 1005
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.h ('k') | Source/core/inspector/TimelineTraceEventProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698