<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[186133] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/186133">186133</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2015-06-30 14:45:55 -0700 (Tue, 30 Jun 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
https://bugs.webkit.org/show_bug.cgi?id=146168
Reviewed by Brian Burg.
Source/JavaScriptCore:
* inspector/protocol/Timeline.json:
New timeline record type for compositing events.
Source/WebCore:
Added Inspector instrumentation for measuring CoreAnimation compositing time. We mark the start of a composite
event when the LayerFlushScheduler triggers a scheduled layer flush. InspectorController now exports a function
for marking the end of the composite event, which should be called during the CA transaction post-commit phase
(based on platform support). Lacking platform support, the event is considered complete after CoreAnimation
runloop observers have run.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::didComposite):
* inspector/InspectorController.h:
New export for instrumentation in WebKit2.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willCompositeImpl):
(WebCore::InspectorInstrumentation::didCompositeImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willComposite):
(WebCore::InspectorInstrumentation::didComposite):
Plumbing for new instrumentation.
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::internalStart):
(WebCore::InspectorTimelineAgent::internalStop):
(WebCore::InspectorTimelineAgent::willComposite):
(WebCore::InspectorTimelineAgent::didComposite):
(WebCore::toProtocol):
* inspector/InspectorTimelineAgent.h:
New Composite event type and instrumentation.
* page/FrameView.cpp:
(WebCore::FrameView::flushCompositingStateIncludingSubframes):
Hook for start of compositing.
* platform/spi/cocoa/QuartzCoreSPI.h:
New header include and interface declaration.
Source/WebInspectorUI:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype._processRecord):
Added handling for new Composite record type. Paint records with a parent Composite record
are flagged to simplify processing after the event hierarchy is unpacked.
* UserInterface/Images/TimelineRecordComposite.svg: Added.
New composite record icon.
* UserInterface/Models/LayoutTimelineRecord.js:
(WebInspector.LayoutTimelineRecord):
(WebInspector.LayoutTimelineRecord.displayNameForEventType):
(WebInspector.LayoutTimelineRecord.prototype.get duringComposite): Added
Composite record support.
* UserInterface/Models/RenderingFrameTimelineRecord.js:
(WebInspector.RenderingFrameTimelineRecord.prototype.durationForTask.get validRecordForTaskType):
Add compositing time when bucketing runloop tasks, ignoring Paint events that are
contained within a Composite event.
* UserInterface/Views/LayoutTimelineOverviewGraph.js:
(WebInspector.LayoutTimelineOverviewGraph.prototype._layoutTimelineRecordAdded):
Add Composite records to paint timeline row.
* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView.prototype._processPendingRecords):
Small unrelated fix.
* UserInterface/Views/TimelineIcons.css:
(.composite-record .icon):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-composite > .segment):
* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):
New styles and tree element icon.
Source/WebKit2:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
Added CA transaction post-commit handlers to instrument end of composite.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolTimelinejson">trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllercpp">trunk/Source/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllerh">trunk/Source/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationcpp">trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationh">trunk/Source/WebCore/inspector/InspectorInstrumentation.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgenth">trunk/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh">trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsLayoutTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsRenderingFrameTimelineRecordjs">trunk/Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineOverviewGraphjs">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRenderingFrameTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordBarcss">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesTimelineRecordCompositesvg">trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordComposite.svg</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-06-30 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
+ https://bugs.webkit.org/show_bug.cgi?id=146168
+
+ Reviewed by Brian Burg.
+
+ * inspector/protocol/Timeline.json:
+ New timeline record type for compositing events.
+
</ins><span class="cx"> 2015-06-29 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> Temporarily disable PICTURE_SIZES
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolTimelinejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -13,6 +13,7 @@
</span><span class="cx"> "InvalidateLayout",
</span><span class="cx"> "Layout",
</span><span class="cx"> "Paint",
</span><ins>+ "Composite",
</ins><span class="cx"> "RenderingFrame",
</span><span class="cx"> "ScrollLayer",
</span><span class="cx"> "ParseHTML",
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/ChangeLog        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2015-06-30 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
+ https://bugs.webkit.org/show_bug.cgi?id=146168
+
+ Reviewed by Brian Burg.
+
+ Added Inspector instrumentation for measuring CoreAnimation compositing time. We mark the start of a composite
+ event when the LayerFlushScheduler triggers a scheduled layer flush. InspectorController now exports a function
+ for marking the end of the composite event, which should be called during the CA transaction post-commit phase
+ (based on platform support). Lacking platform support, the event is considered complete after CoreAnimation
+ runloop observers have run.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::didComposite):
+ * inspector/InspectorController.h:
+ New export for instrumentation in WebKit2.
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::willCompositeImpl):
+ (WebCore::InspectorInstrumentation::didCompositeImpl):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::willComposite):
+ (WebCore::InspectorInstrumentation::didComposite):
+ Plumbing for new instrumentation.
+
+ * inspector/InspectorTimelineAgent.cpp:
+ (WebCore::InspectorTimelineAgent::internalStart):
+ (WebCore::InspectorTimelineAgent::internalStop):
+ (WebCore::InspectorTimelineAgent::willComposite):
+ (WebCore::InspectorTimelineAgent::didComposite):
+ (WebCore::toProtocol):
+ * inspector/InspectorTimelineAgent.h:
+ New Composite event type and instrumentation.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::flushCompositingStateIncludingSubframes):
+ Hook for start of compositing.
+
+ * platform/spi/cocoa/QuartzCoreSPI.h:
+ New header include and interface declaration.
+
</ins><span class="cx"> 2015-06-30 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> The bounds on InteractionInformationAtPosition should be more precise
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.cpp        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -453,4 +453,9 @@
</span><span class="cx"> return m_executionStopwatch.copyRef();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorController::didComposite(Frame& frame)
+{
+ InspectorInstrumentation::didComposite(frame);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.h (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.h        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/inspector/InspectorController.h        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -137,6 +137,8 @@
</span><span class="cx"> virtual void frontendInitialized() override;
</span><span class="cx"> virtual Ref<WTF::Stopwatch> executionStopwatch() override;
</span><span class="cx">
</span><ins>+ WEBCORE_EXPORT void didComposite(Frame&);
+
</ins><span class="cx"> private:
</span><span class="cx"> friend class InspectorInstrumentation;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -475,6 +475,18 @@
</span><span class="cx"> timelineAgent->didDispatchXHRLoadEvent();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorInstrumentation::willCompositeImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
+{
+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
+ timelineAgent->willComposite(frame);
+}
+
+void InspectorInstrumentation::didCompositeImpl(InstrumentingAgents& instrumentingAgents)
+{
+ if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
+ timelineAgent->didComposite();
+}
+
</ins><span class="cx"> void InspectorInstrumentation::willPaintImpl(InstrumentingAgents& instrumentingAgents, RenderObject* renderer)
</span><span class="cx"> {
</span><span class="cx"> if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -164,6 +164,8 @@
</span><span class="cx"> static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
</span><span class="cx"> static void willScrollLayer(Frame&);
</span><span class="cx"> static void didScrollLayer(Frame&);
</span><ins>+ static void willComposite(Frame&);
+ static void didComposite(Frame&);
</ins><span class="cx"> static void willPaint(RenderObject*);
</span><span class="cx"> static void didPaint(RenderObject*, const LayoutRect&);
</span><span class="cx"> static InspectorInstrumentationCookie willRecalculateStyle(Document&);
</span><span class="lines">@@ -342,6 +344,8 @@
</span><span class="cx"> static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
</span><span class="cx"> static void willScrollLayerImpl(InstrumentingAgents&, Frame&);
</span><span class="cx"> static void didScrollLayerImpl(InstrumentingAgents&);
</span><ins>+ static void willCompositeImpl(InstrumentingAgents&, Frame&);
+ static void didCompositeImpl(InstrumentingAgents&);
</ins><span class="cx"> static void willPaintImpl(InstrumentingAgents&, RenderObject*);
</span><span class="cx"> static void didPaintImpl(InstrumentingAgents&, RenderObject*, const LayoutRect&);
</span><span class="cx"> static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents&, Document&);
</span><span class="lines">@@ -814,6 +818,20 @@
</span><span class="cx"> didDispatchXHRLoadEventImpl(cookie);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline void InspectorInstrumentation::willComposite(Frame& frame)
+{
+ FAST_RETURN_IF_NO_FRONTENDS(void());
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+ willCompositeImpl(*instrumentingAgents, frame);
+}
+
+inline void InspectorInstrumentation::didComposite(Frame& frame)
+{
+ FAST_RETURN_IF_NO_FRONTENDS(void());
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+ didCompositeImpl(*instrumentingAgents);
+}
+
</ins><span class="cx"> inline void InspectorInstrumentation::willPaint(RenderObject* renderer)
</span><span class="cx"> {
</span><span class="cx"> FAST_RETURN_IF_NO_FRONTENDS(void());
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -170,8 +170,13 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(m_runLoopNestingLevel > 0);
</span><span class="cx"> m_runLoopNestingLevel--;
</span><del>- if (!m_runLoopNestingLevel)
- didCompleteCurrentRecord(TimelineRecordType::RenderingFrame);
</del><ins>+ if (m_runLoopNestingLevel)
+ return;
+
+ if (m_startedComposite)
+ didComposite();
+
+ didCompleteCurrentRecord(TimelineRecordType::RenderingFrame);
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> m_frameStartObserver->schedule(currentRunLoop(), kCFRunLoopEntry | kCFRunLoopAfterWaiting);
</span><span class="lines">@@ -216,6 +221,7 @@
</span><span class="cx"> clearRecordStack();
</span><span class="cx">
</span><span class="cx"> m_enabled = false;
</span><ins>+ m_startedComposite = false;
</ins><span class="cx">
</span><span class="cx"> if (m_frontendDispatcher)
</span><span class="cx"> m_frontendDispatcher->recordingStopped();
</span><span class="lines">@@ -399,6 +405,20 @@
</span><span class="cx"> didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InspectorTimelineAgent::willComposite(Frame& frame)
+{
+ ASSERT(!m_startedComposite);
+ pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Composite, true, &frame);
+ m_startedComposite = true;
+}
+
+void InspectorTimelineAgent::didComposite()
+{
+ ASSERT(m_startedComposite);
+ didCompleteCurrentRecord(TimelineRecordType::Composite);
+ m_startedComposite = false;
+}
+
</ins><span class="cx"> void InspectorTimelineAgent::willPaint(Frame& frame)
</span><span class="cx"> {
</span><span class="cx"> pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true, &frame);
</span><span class="lines">@@ -607,6 +627,8 @@
</span><span class="cx"> return Inspector::Protocol::Timeline::EventType::Layout;
</span><span class="cx"> case TimelineRecordType::Paint:
</span><span class="cx"> return Inspector::Protocol::Timeline::EventType::Paint;
</span><ins>+ case TimelineRecordType::Composite:
+ return Inspector::Protocol::Timeline::EventType::Composite;
</ins><span class="cx"> case TimelineRecordType::RenderingFrame:
</span><span class="cx"> return Inspector::Protocol::Timeline::EventType::RenderingFrame;
</span><span class="cx"> case TimelineRecordType::ScrollLayer:
</span><span class="lines">@@ -720,15 +742,8 @@
</span><span class="cx"> InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorType type, InspectorClient* client)
</span><span class="cx"> : InspectorAgentBase(ASCIILiteral("Timeline"), instrumentingAgents)
</span><span class="cx"> , m_pageAgent(pageAgent)
</span><del>- , m_scriptDebugServer(nullptr)
- , m_id(1)
- , m_callStackDepth(0)
- , m_maxCallStackDepth(5)
</del><span class="cx"> , m_inspectorType(type)
</span><span class="cx"> , m_client(client)
</span><del>- , m_enabled(false)
- , m_enabledFromFrontend(false)
- , m_runLoopNestingLevel(0)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> InvalidateLayout,
</span><span class="cx"> Layout,
</span><span class="cx"> Paint,
</span><ins>+ Composite,
</ins><span class="cx"> RenderingFrame,
</span><span class="cx"> ScrollLayer,
</span><span class="cx">
</span><span class="lines">@@ -155,6 +156,8 @@
</span><span class="cx"> void didScroll();
</span><span class="cx"> void willDispatchXHRLoadEvent(const String&, Frame*);
</span><span class="cx"> void didDispatchXHRLoadEvent();
</span><ins>+ void willComposite(Frame&);
+ void didComposite();
</ins><span class="cx"> void willPaint(Frame&);
</span><span class="cx"> void didPaint(RenderObject*, const LayoutRect&);
</span><span class="cx"> void willRecalculateStyle(Frame*);
</span><span class="lines">@@ -229,29 +232,30 @@
</span><span class="cx"> Page* page();
</span><span class="cx">
</span><span class="cx"> InspectorPageAgent* m_pageAgent;
</span><del>- PageScriptDebugServer* m_scriptDebugServer;
</del><ins>+ PageScriptDebugServer* m_scriptDebugServer { nullptr };
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<Inspector::TimelineFrontendDispatcher> m_frontendDispatcher;
</span><span class="cx"> RefPtr<Inspector::TimelineBackendDispatcher> m_backendDispatcher;
</span><span class="cx">
</span><span class="cx"> Vector<TimelineRecordEntry> m_recordStack;
</span><span class="cx">
</span><del>- int m_id;
- int m_callStackDepth;
- int m_maxCallStackDepth;
</del><ins>+ int m_id { 1 };
+ int m_callStackDepth { 0 };
+ int m_maxCallStackDepth { 5 };
</ins><span class="cx"> InspectorType m_inspectorType;
</span><span class="cx"> InspectorClient* m_client;
</span><span class="cx">
</span><span class="cx"> Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords;
</span><span class="cx">
</span><del>- bool m_enabled;
- bool m_enabledFromFrontend;
</del><ins>+ bool m_enabled { false };
+ bool m_enabledFromFrontend { false };
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> std::unique_ptr<WebCore::RunLoopObserver> m_frameStartObserver;
</span><span class="cx"> std::unique_ptr<WebCore::RunLoopObserver> m_frameStopObserver;
</span><span class="cx"> #endif
</span><del>- int m_runLoopNestingLevel;
</del><ins>+ int m_runLoopNestingLevel { 0 };
+ bool m_startedComposite { false };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -1082,6 +1082,8 @@
</span><span class="cx">
</span><span class="cx"> bool FrameView::flushCompositingStateIncludingSubframes()
</span><span class="cx"> {
</span><ins>+ InspectorInstrumentation::willComposite(frame());
+
</ins><span class="cx"> bool allFramesFlushed = flushCompositingStateForThisFrame(&frame());
</span><span class="cx">
</span><span class="cx"> for (Frame* child = frame().tree().firstRenderedChild(); child; child = child->tree().traverseNextRendered(m_frame.ptr())) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #import <QuartzCore/CAContext.h>
</span><span class="cx"> #import <QuartzCore/CAFilter.h>
</span><span class="cx"> #import <QuartzCore/CATiledLayerPrivate.h>
</span><ins>+#import <QuartzCore/CATransactionPrivate.h>
</ins><span class="cx">
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="lines">@@ -112,6 +113,18 @@
</span><span class="cx"> + (CAFilter *)filterWithType:(NSString *)type;
</span><span class="cx"> @property (copy) NSString *name;
</span><span class="cx"> @end
</span><ins>+
+#if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
+typedef enum {
+ kCATransactionPhasePreLayout,
+ kCATransactionPhasePreCommit,
+ kCATransactionPhasePostCommit,
+} CATransactionPhase;
+
+@interface CATransaction (Details)
++ (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase;
+@end
+#endif
</ins><span class="cx"> #endif // __OBJC__
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2015-06-30 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
+ https://bugs.webkit.org/show_bug.cgi?id=146168
+
+ Reviewed by Brian Burg.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Controllers/TimelineManager.js:
+ (WebInspector.TimelineManager.prototype._processRecord):
+ Added handling for new Composite record type. Paint records with a parent Composite record
+ are flagged to simplify processing after the event hierarchy is unpacked.
+
+ * UserInterface/Images/TimelineRecordComposite.svg: Added.
+ New composite record icon.
+
+ * UserInterface/Models/LayoutTimelineRecord.js:
+ (WebInspector.LayoutTimelineRecord):
+ (WebInspector.LayoutTimelineRecord.displayNameForEventType):
+ (WebInspector.LayoutTimelineRecord.prototype.get duringComposite): Added
+ Composite record support.
+
+ * UserInterface/Models/RenderingFrameTimelineRecord.js:
+ (WebInspector.RenderingFrameTimelineRecord.prototype.durationForTask.get validRecordForTaskType):
+ Add compositing time when bucketing runloop tasks, ignoring Paint events that are
+ contained within a Composite event.
+
+ * UserInterface/Views/LayoutTimelineOverviewGraph.js:
+ (WebInspector.LayoutTimelineOverviewGraph.prototype._layoutTimelineRecordAdded):
+ Add Composite records to paint timeline row.
+
+ * UserInterface/Views/RenderingFrameTimelineView.js:
+ (WebInspector.RenderingFrameTimelineView.prototype._processPendingRecords):
+ Small unrelated fix.
+
+ * UserInterface/Views/TimelineIcons.css:
+ (.composite-record .icon):
+ * UserInterface/Views/TimelineRecordBar.css:
+ (.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-composite > .segment):
+ * UserInterface/Views/TimelineRecordTreeElement.js:
+ (WebInspector.TimelineRecordTreeElement):
+ New styles and tree element icon.
+
</ins><span class="cx"> 2015-06-30 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: iOS 8: Uncaught Exception expanding Object Prototype
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx"> localizedStrings["Collapse columns"] = "Collapse columns";
</span><span class="cx"> localizedStrings["Comment"] = "Comment";
</span><span class="cx"> localizedStrings["Comment All Properties"] = "Comment All Properties";
</span><ins>+localizedStrings["Composite"] = "Composite";
</ins><span class="cx"> localizedStrings["Compressed"] = "Compressed";
</span><span class="cx"> localizedStrings["Compression"] = "Compression";
</span><span class="cx"> localizedStrings["Computed"] = "Computed";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -262,11 +262,19 @@
</span><span class="cx"> case TimelineAgent.EventType.Paint:
</span><span class="cx"> // COMPATIBILITY (iOS 6): Paint records data contained x, y, width, height properties. This became a quad "clip".
</span><span class="cx"> var quad = recordPayload.data.clip ? new WebInspector.Quad(recordPayload.data.clip) : null;
</span><ins>+ var duringComposite = recordPayload.__duringComposite || false;
</ins><span class="cx"> if (quad)
</span><del>- return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, null, null, quad.width, quad.height, quad);
</del><ins>+ return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, null, null, quad.width, quad.height, quad, duringComposite);
</ins><span class="cx"> else
</span><del>- return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.x, recordPayload.data.y, recordPayload.data.width, recordPayload.data.height);
</del><ins>+ return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.x, recordPayload.data.y, recordPayload.data.width, recordPayload.data.height, null, duringComposite);
</ins><span class="cx">
</span><ins>+ case TimelineAgent.EventType.Composite:
+ recordPayload.children.forEach(function(childRecordPayload) {
+ console.assert(childRecordPayload.type === TimelineAgent.EventType.Paint, childRecordPayload.type);
+ childRecordPayload.__duringComposite = true;
+ });
+ return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Composite, startTime, endTime, callFrames, sourceCodeLocation);
+
</ins><span class="cx"> case TimelineAgent.EventType.RenderingFrame:
</span><span class="cx"> if (!recordPayload.children)
</span><span class="cx"> return null;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesTimelineRecordCompositesvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordComposite.svg (0 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordComposite.svg         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/TimelineRecordComposite.svg        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright © 2015 Apple Inc. All rights reserved. -->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+ <path fill="rgb(176, 204, 105)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 Z"/>
+ <path fill="rgb(152, 188, 77)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 M 13 2 C 13.550781 2 14 2.449219 14 3 L 14 13 C 14 13.550781 13.550781 14 13 14 L 3 14 C 2.449219 14 2 13.550781 2 13 L 2 3 C 2 2.449219 2.449219 2 3 2 L 13 2"/>
+ <path fill="rgb(152, 188, 77)" d="M 4.773438 11.542969 C 3.855469 10.621094 3.390625 9.347656 3.390625 7.769531 C 3.390625 6.15625 3.863281 4.878906 4.789062 3.964844 C 5.710938 3.054688 7.003906 2.59375 8.625 2.59375 C 9.570312 2.59375 10.519531 2.707031 11.441406 2.929688 C 11.890625 3.035156 12.210938 3.4375 12.210938 3.902344 L 12.210938 5.195312 C 12.210938 5.519531 12.050781 5.824219 11.789062 6.011719 C 11.613281 6.132812 11.410156 6.195312 11.207031 6.195312 C 11.097656 6.195312 10.984375 6.179688 10.878906 6.140625 C 10.015625 5.835938 9.308594 5.683594 8.769531 5.683594 C 8.058594 5.683594 7.753906 5.941406 7.589844 6.132812 C 7.296875 6.476562 7.148438 7.019531 7.148438 7.746094 C 7.148438 8.445312 7.308594 8.972656 7.621094 9.320312 C 7.808594 9.523438 8.148438 9.796875 8.921875 9.796875 C 9.542969 9.796875 10.1875 9.632812 10.839844 9.308594 C 10.980469 9.242188 11.132812 9.207031 11.285156 9.207031 C 11.46875 9.207031 11.648438 9.257812 11
.8125 9.359375 C 12.105469 9.539062 12.285156 9.859375 12.285156 10.207031 L 12.285156 11.425781 C 12.285156 11.820312 12.050781 12.179688 11.691406 12.339844 C 10.792969 12.738281 9.730469 12.941406 8.527344 12.941406 C 6.957031 12.941406 5.691406 12.472656 4.773438 11.542969"/>
+ <path fill="white" d="M 11.285156 11.425781 C 10.515625 11.769531 9.597656 11.941406 8.527344 11.941406 C 7.226562 11.941406 6.210938 11.574219 5.484375 10.839844 C 4.757812 10.105469 4.394531 9.082031 4.394531 7.769531 C 4.394531 6.429688 4.757812 5.398438 5.492188 4.675781 C 6.222656 3.957031 7.269531 3.59375 8.625 3.59375 C 9.492188 3.59375 10.351562 3.695312 11.210938 3.902344 L 11.210938 5.195312 C 10.238281 4.855469 9.425781 4.683594 8.769531 4.683594 C 7.933594 4.683594 7.285156 4.949219 6.832031 5.484375 C 6.375 6.015625 6.148438 6.769531 6.148438 7.746094 C 6.148438 8.707031 6.394531 9.453125 6.882812 9.992188 C 7.371094 10.527344 8.050781 10.796875 8.921875 10.796875 C 9.703125 10.796875 10.488281 10.601562 11.285156 10.207031 Z"/>
+</svg>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsLayoutTimelineRecordjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">
</span><span class="cx"> WebInspector.LayoutTimelineRecord = class LayoutTimelineRecord extends WebInspector.TimelineRecord
</span><span class="cx"> {
</span><del>- constructor(eventType, startTime, endTime, callFrames, sourceCodeLocation, x, y, width, height, quad)
</del><ins>+ constructor(eventType, startTime, endTime, callFrames, sourceCodeLocation, x, y, width, height, quad, duringComposite)
</ins><span class="cx"> {
</span><span class="cx"> super(WebInspector.TimelineRecord.Type.Layout, startTime, endTime, callFrames, sourceCodeLocation);
</span><span class="cx">
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> this._width = typeof width === "number" ? width : NaN;
</span><span class="cx"> this._height = typeof height === "number" ? height : NaN;
</span><span class="cx"> this._quad = quad instanceof WebInspector.Quad ? quad : null;
</span><ins>+ this._duringComposite = duringComposite || false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Static
</span><span class="lines">@@ -59,6 +60,8 @@
</span><span class="cx"> return WebInspector.UIString("Layout");
</span><span class="cx"> case WebInspector.LayoutTimelineRecord.EventType.Paint:
</span><span class="cx"> return WebInspector.UIString("Paint");
</span><ins>+ case WebInspector.LayoutTimelineRecord.EventType.Composite:
+ return WebInspector.UIString("Composite");
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -106,6 +109,11 @@
</span><span class="cx"> return this._quad;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ get duringComposite()
+ {
+ return this._duringComposite;
+ }
+
</ins><span class="cx"> saveIdentityToCookie(cookie)
</span><span class="cx"> {
</span><span class="cx"> super.saveIdentityToCookie(cookie);
</span><span class="lines">@@ -120,7 +128,8 @@
</span><span class="cx"> InvalidateLayout: "layout-timeline-record-invalidate-layout",
</span><span class="cx"> ForcedLayout: "layout-timeline-record-forced-layout",
</span><span class="cx"> Layout: "layout-timeline-record-layout",
</span><del>- Paint: "layout-timeline-record-paint"
</del><ins>+ Paint: "layout-timeline-record-paint",
+ Composite: "layout-timeline-record-composite"
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.LayoutTimelineRecord.TypeIdentifier = "layout-timeline-record";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsRenderingFrameTimelineRecordjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -83,9 +83,9 @@
</span><span class="cx"> case WebInspector.RenderingFrameTimelineRecord.TaskType.Script:
</span><span class="cx"> return record.type === WebInspector.TimelineRecord.Type.Script;
</span><span class="cx"> case WebInspector.RenderingFrameTimelineRecord.TaskType.Layout:
</span><del>- return record.type === WebInspector.TimelineRecord.Type.Layout && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Paint;
</del><ins>+ return record.type === WebInspector.TimelineRecord.Type.Layout && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Paint && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Composite;
</ins><span class="cx"> case WebInspector.RenderingFrameTimelineRecord.TaskType.Paint:
</span><del>- return record.type === WebInspector.TimelineRecord.Type.Layout && record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint;
</del><ins>+ return record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint || record.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite;
</ins><span class="cx"> default:
</span><span class="cx"> console.error("Unsupported task type: " + taskType);
</span><span class="cx"> return false;
</span><span class="lines">@@ -106,14 +106,21 @@
</span><span class="cx"> return previousValue + currentDuration;
</span><span class="cx"> }, 0);
</span><span class="cx">
</span><del>- // Time spent in layout events which were synchronously triggered from JavaScript must be deducted from the
- // rendering frame's script duration, to prevent the time from being counted twice.
</del><span class="cx"> if (taskType === WebInspector.RenderingFrameTimelineRecord.TaskType.Script) {
</span><ins>+ // Layout events synchronously triggered from JavaScript must be subtracted from the total
+ // script time, to prevent the time from being counted twice.
</ins><span class="cx"> duration -= this._children.reduce(function(previousValue, currentValue) {
</span><span class="cx"> if (currentValue.type === WebInspector.TimelineRecord.Type.Layout && (currentValue.sourceCodeLocation || currentValue.callFrames))
</span><span class="cx"> return previousValue + currentValue.duration;
</span><span class="cx"> return previousValue;
</span><span class="cx"> }, 0);
</span><ins>+ } else if (taskType === WebInspector.RenderingFrameTimelineRecord.TaskType.Paint) {
+ // Paint events triggered during a Composite event must be subtracted from the total painting time,
+ // since the compositing time already includes time spent in these Paint events.
+ var paintRecords = this._children.filter(function(record) { return record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint; });
+ duration -= paintRecords.reduce(function(previousValue, currentValue) {
+ return currentValue.duringComposite ? previousValue + currentValue.duration : previousValue;
+ }, 0);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineOverviewGraphjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx"> var layoutTimelineRecord = event.data.record;
</span><span class="cx"> console.assert(layoutTimelineRecord instanceof WebInspector.LayoutTimelineRecord);
</span><span class="cx">
</span><del>- if (layoutTimelineRecord.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint)
</del><ins>+ if (layoutTimelineRecord.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint || layoutTimelineRecord.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite)
</ins><span class="cx"> this._timelinePaintRecordRow.records.push(layoutTimelineRecord);
</span><span class="cx"> else
</span><span class="cx"> this._timelineLayoutRecordRow.records.push(layoutTimelineRecord);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRenderingFrameTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -225,6 +225,7 @@
</span><span class="cx">
</span><span class="cx"> this._dataGrid.addRowInSortOrder(layoutTreeElement, layoutDataGridNode, treeElement);
</span><span class="cx"> } else if (childRecord.type === WebInspector.TimelineRecord.Type.Script) {
</span><ins>+ var rootNodes = [];
</ins><span class="cx"> if (childRecord.profile) {
</span><span class="cx"> // FIXME: Support using the bottom-up tree once it is implemented.
</span><span class="cx"> rootNodes = childRecord.profile.topDownRootNodes;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineIconscss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -75,6 +75,10 @@
</span><span class="cx"> content: url(../Images/TimelineRecordPaint.svg);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.composite-record .icon {
+ content: url(../Images/TimelineRecordComposite.svg);
+}
+
</ins><span class="cx"> .rendering-frame-record .icon {
</span><span class="cx"> content: url(../Images/TimelineRecordRenderingFrame.svg);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordBarcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -87,7 +87,9 @@
</span><span class="cx"> border-color: rgb(212, 108, 108);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-paint > .segment {
</del><ins>+
+.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-paint > .segment,
+.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-composite > .segment {
</ins><span class="cx"> background-color: rgb(176, 204, 105);
</span><span class="cx"> border-color: rgb(152, 188, 77);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineRecordTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -62,6 +62,9 @@
</span><span class="cx"> case WebInspector.LayoutTimelineRecord.EventType.Paint:
</span><span class="cx"> iconStyleClass = WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass;
</span><span class="cx"> break;
</span><ins>+ case WebInspector.LayoutTimelineRecord.EventType.Composite:
+ iconStyleClass = WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass;
+ break;
</ins><span class="cx"> default:
</span><span class="cx"> console.error("Unknown LayoutTimelineRecord eventType: " + timelineRecord.eventType, timelineRecord);
</span><span class="cx"> }
</span><span class="lines">@@ -157,6 +160,7 @@
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.StyleRecordIconStyleClass = "style-record";
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass = "layout-record";
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass = "paint-record";
</span><ins>+WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass = "composite-record";
</ins><span class="cx"> WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass = "rendering-frame-record";
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass = "evaluated-record";
</span><span class="cx"> WebInspector.TimelineRecordTreeElement.EventRecordIconStyleClass = "event-record";
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-06-30 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
+ https://bugs.webkit.org/show_bug.cgi?id=146168
+
+ Reviewed by Brian Burg.
+
+ * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+ (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+ Added CA transaction post-commit handlers to instrument end of composite.
+
</ins><span class="cx"> 2015-06-30 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> The bounds on InteractionInformationAtPosition should be more precise
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -40,8 +40,10 @@
</span><span class="cx"> #import <WebCore/DebugPageOverlays.h>
</span><span class="cx"> #import <WebCore/Frame.h>
</span><span class="cx"> #import <WebCore/FrameView.h>
</span><ins>+#import <WebCore/InspectorController.h>
</ins><span class="cx"> #import <WebCore/MainFrame.h>
</span><span class="cx"> #import <WebCore/PageOverlayController.h>
</span><ins>+#import <WebCore/QuartzCoreSPI.h>
</ins><span class="cx"> #import <WebCore/RenderLayerCompositor.h>
</span><span class="cx"> #import <WebCore/RenderView.h>
</span><span class="cx"> #import <WebCore/Settings.h>
</span><span class="lines">@@ -359,6 +361,12 @@
</span><span class="cx"> FloatRect visibleRect(FloatPoint(), m_viewSize);
</span><span class="cx"> visibleRect.intersect(m_scrolledExposedRect);
</span><span class="cx">
</span><ins>+#if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
+ [CATransaction addCommitHandler:^{
+ m_webPage.corePage()->inspectorController().didComposite(m_webPage.mainFrameView()->frame());
+ } forPhase:kCATransactionPhasePostCommit];
+#endif
+
</ins><span class="cx"> m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
</span><span class="cx">
</span><span class="cx"> // Because our view-relative overlay root layer is not attached to the FrameView's GraphicsLayer tree, we need to flush it manually.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (186132 => 186133)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-06-30 21:40:01 UTC (rev 186132)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2015-06-30 21:45:55 UTC (rev 186133)
</span><span class="lines">@@ -43,10 +43,12 @@
</span><span class="cx"> #import <WebCore/FrameView.h>
</span><span class="cx"> #import <WebCore/GraphicsContext.h>
</span><span class="cx"> #import <WebCore/GraphicsLayerCA.h>
</span><ins>+#import <WebCore/InspectorController.h>
</ins><span class="cx"> #import <WebCore/MachSendRight.h>
</span><span class="cx"> #import <WebCore/MainFrame.h>
</span><span class="cx"> #import <WebCore/Page.h>
</span><span class="cx"> #import <WebCore/PlatformCAAnimationCocoa.h>
</span><ins>+#import <WebCore/QuartzCoreSPI.h>
</ins><span class="cx"> #import <WebCore/RenderLayerBacking.h>
</span><span class="cx"> #import <WebCore/RenderLayerCompositor.h>
</span><span class="cx"> #import <WebCore/RenderView.h>
</span><span class="lines">@@ -388,6 +390,12 @@
</span><span class="cx"> if (m_viewOverlayRootLayer)
</span><span class="cx"> m_viewOverlayRootLayer->flushCompositingState(visibleRect);
</span><span class="cx">
</span><ins>+#if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
+ [CATransaction addCommitHandler:^{
+ m_webPage.corePage()->inspectorController().didComposite(m_webPage.mainFrameView()->frame());
+ } forPhase:kCATransactionPhasePostCommit];
+#endif
+
</ins><span class="cx"> bool returnValue = m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx"> if (ScrollingCoordinator* scrollingCoordinator = m_webPage.corePage()->scrollingCoordinator())
</span></span></pre>
</div>
</div>
</body>
</html>