Changeset 186133 in webkit


Ignore:
Timestamp:
Jun 30, 2015, 2:45:55 PM (10 years ago)
Author:
Matt Baker
Message:

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.

Location:
trunk/Source
Files:
1 added
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r186091 r186133  
     12015-06-30  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
     4        https://bugs.webkit.org/show_bug.cgi?id=146168
     5
     6        Reviewed by Brian Burg.
     7
     8        * inspector/protocol/Timeline.json:
     9        New timeline record type for compositing events.
     10
    1112015-06-29  Dean Jackson  <dino@apple.com>
    212
  • trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json

    r182660 r186133  
    1414                "Layout",
    1515                "Paint",
     16                "Composite",
    1617                "RenderingFrame",
    1718                "ScrollLayer",
  • trunk/Source/WebCore/ChangeLog

    r186132 r186133  
     12015-06-30  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
     4        https://bugs.webkit.org/show_bug.cgi?id=146168
     5
     6        Reviewed by Brian Burg.
     7
     8        Added Inspector instrumentation for measuring CoreAnimation compositing time. We mark the start of a composite
     9        event when the LayerFlushScheduler triggers a scheduled layer flush. InspectorController now exports a function
     10        for marking the end of the composite event, which should be called during the CA transaction post-commit phase
     11        (based on platform support). Lacking platform support, the event is considered complete after CoreAnimation
     12        runloop observers have run.
     13
     14        * inspector/InspectorController.cpp:
     15        (WebCore::InspectorController::didComposite):
     16        * inspector/InspectorController.h:
     17        New export for instrumentation in WebKit2.
     18
     19        * inspector/InspectorInstrumentation.cpp:
     20        (WebCore::InspectorInstrumentation::willCompositeImpl):
     21        (WebCore::InspectorInstrumentation::didCompositeImpl):
     22        * inspector/InspectorInstrumentation.h:
     23        (WebCore::InspectorInstrumentation::willComposite):
     24        (WebCore::InspectorInstrumentation::didComposite):
     25        Plumbing for new instrumentation.
     26
     27        * inspector/InspectorTimelineAgent.cpp:
     28        (WebCore::InspectorTimelineAgent::internalStart):
     29        (WebCore::InspectorTimelineAgent::internalStop):
     30        (WebCore::InspectorTimelineAgent::willComposite):
     31        (WebCore::InspectorTimelineAgent::didComposite):
     32        (WebCore::toProtocol):
     33        * inspector/InspectorTimelineAgent.h:
     34        New Composite event type and instrumentation.
     35
     36        * page/FrameView.cpp:
     37        (WebCore::FrameView::flushCompositingStateIncludingSubframes):
     38        Hook for start of compositing.
     39
     40        * platform/spi/cocoa/QuartzCoreSPI.h:
     41        New header include and interface declaration.
     42
    1432015-06-30  Beth Dakin  <bdakin@apple.com>
    244
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r185784 r186133  
    454454}
    455455
     456void InspectorController::didComposite(Frame& frame)
     457{
     458    InspectorInstrumentation::didComposite(frame);
     459}
     460
    456461} // namespace WebCore
  • trunk/Source/WebCore/inspector/InspectorController.h

    r185784 r186133  
    138138    virtual Ref<WTF::Stopwatch> executionStopwatch() override;
    139139
     140    WEBCORE_EXPORT void didComposite(Frame&);
     141
    140142private:
    141143    friend class InspectorInstrumentation;
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r182193 r186133  
    476476}
    477477
     478void InspectorInstrumentation::willCompositeImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
     479{
     480    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
     481        timelineAgent->willComposite(frame);
     482}
     483
     484void InspectorInstrumentation::didCompositeImpl(InstrumentingAgents& instrumentingAgents)
     485{
     486    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
     487        timelineAgent->didComposite();
     488}
     489
    478490void InspectorInstrumentation::willPaintImpl(InstrumentingAgents& instrumentingAgents, RenderObject* renderer)
    479491{
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r182193 r186133  
    165165    static void willScrollLayer(Frame&);
    166166    static void didScrollLayer(Frame&);
     167    static void willComposite(Frame&);
     168    static void didComposite(Frame&);
    167169    static void willPaint(RenderObject*);
    168170    static void didPaint(RenderObject*, const LayoutRect&);
     
    343345    static void willScrollLayerImpl(InstrumentingAgents&, Frame&);
    344346    static void didScrollLayerImpl(InstrumentingAgents&);
     347    static void willCompositeImpl(InstrumentingAgents&, Frame&);
     348    static void didCompositeImpl(InstrumentingAgents&);
    345349    static void willPaintImpl(InstrumentingAgents&, RenderObject*);
    346350    static void didPaintImpl(InstrumentingAgents&, RenderObject*, const LayoutRect&);
     
    815819}
    816820
     821inline void InspectorInstrumentation::willComposite(Frame& frame)
     822{
     823    FAST_RETURN_IF_NO_FRONTENDS(void());
     824    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
     825        willCompositeImpl(*instrumentingAgents, frame);
     826}
     827
     828inline void InspectorInstrumentation::didComposite(Frame& frame)
     829{
     830    FAST_RETURN_IF_NO_FRONTENDS(void());
     831    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
     832        didCompositeImpl(*instrumentingAgents);
     833}
     834
    817835inline void InspectorInstrumentation::willPaint(RenderObject* renderer)
    818836{
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r185777 r186133  
    171171        ASSERT(m_runLoopNestingLevel > 0);
    172172        m_runLoopNestingLevel--;
    173         if (!m_runLoopNestingLevel)
    174             didCompleteCurrentRecord(TimelineRecordType::RenderingFrame);
     173        if (m_runLoopNestingLevel)
     174            return;
     175
     176        if (m_startedComposite)
     177            didComposite();
     178
     179        didCompleteCurrentRecord(TimelineRecordType::RenderingFrame);
    175180    });
    176181
     
    217222
    218223    m_enabled = false;
     224    m_startedComposite = false;
    219225
    220226    if (m_frontendDispatcher)
     
    398404{
    399405    didCompleteCurrentRecord(TimelineRecordType::RecalculateStyles);
     406}
     407
     408void InspectorTimelineAgent::willComposite(Frame& frame)
     409{
     410    ASSERT(!m_startedComposite);
     411    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Composite, true, &frame);
     412    m_startedComposite = true;
     413}
     414
     415void InspectorTimelineAgent::didComposite()
     416{
     417    ASSERT(m_startedComposite);
     418    didCompleteCurrentRecord(TimelineRecordType::Composite);
     419    m_startedComposite = false;
    400420}
    401421
     
    608628    case TimelineRecordType::Paint:
    609629        return Inspector::Protocol::Timeline::EventType::Paint;
     630    case TimelineRecordType::Composite:
     631        return Inspector::Protocol::Timeline::EventType::Composite;
    610632    case TimelineRecordType::RenderingFrame:
    611633        return Inspector::Protocol::Timeline::EventType::RenderingFrame;
     
    721743    : InspectorAgentBase(ASCIILiteral("Timeline"), instrumentingAgents)
    722744    , m_pageAgent(pageAgent)
    723     , m_scriptDebugServer(nullptr)
    724     , m_id(1)
    725     , m_callStackDepth(0)
    726     , m_maxCallStackDepth(5)
    727745    , m_inspectorType(type)
    728746    , m_client(client)
    729     , m_enabled(false)
    730     , m_enabledFromFrontend(false)
    731     , m_runLoopNestingLevel(0)
    732747{
    733748}
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r185777 r186133  
    7373    Layout,
    7474    Paint,
     75    Composite,
    7576    RenderingFrame,
    7677    ScrollLayer,
     
    156157    void willDispatchXHRLoadEvent(const String&, Frame*);
    157158    void didDispatchXHRLoadEvent();
     159    void willComposite(Frame&);
     160    void didComposite();
    158161    void willPaint(Frame&);
    159162    void didPaint(RenderObject*, const LayoutRect&);
     
    230233
    231234    InspectorPageAgent* m_pageAgent;
    232     PageScriptDebugServer* m_scriptDebugServer;
     235    PageScriptDebugServer* m_scriptDebugServer { nullptr };
    233236
    234237    std::unique_ptr<Inspector::TimelineFrontendDispatcher> m_frontendDispatcher;
     
    237240    Vector<TimelineRecordEntry> m_recordStack;
    238241
    239     int m_id;
    240     int m_callStackDepth;
    241     int m_maxCallStackDepth;
     242    int m_id { 1 };
     243    int m_callStackDepth { 0 };
     244    int m_maxCallStackDepth { 5 };
    242245    InspectorType m_inspectorType;
    243246    InspectorClient* m_client;
     
    245248    Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords;
    246249
    247     bool m_enabled;
    248     bool m_enabledFromFrontend;
     250    bool m_enabled { false };
     251    bool m_enabledFromFrontend { false };
    249252
    250253#if PLATFORM(COCOA)
     
    252255    std::unique_ptr<WebCore::RunLoopObserver> m_frameStopObserver;
    253256#endif
    254     int m_runLoopNestingLevel;
     257    int m_runLoopNestingLevel { 0 };
     258    bool m_startedComposite { false };
    255259};
    256260
  • trunk/Source/WebCore/page/FrameView.cpp

    r185966 r186133  
    10831083bool FrameView::flushCompositingStateIncludingSubframes()
    10841084{
     1085    InspectorInstrumentation::willComposite(frame());
     1086
    10851087    bool allFramesFlushed = flushCompositingStateForThisFrame(&frame());
    10861088
  • trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h

    r183997 r186133  
    4646#import <QuartzCore/CAFilter.h>
    4747#import <QuartzCore/CATiledLayerPrivate.h>
     48#import <QuartzCore/CATransactionPrivate.h>
    4849
    4950#ifdef __cplusplus
     
    113114@property (copy) NSString *name;
    114115@end
     116
     117#if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
     118typedef enum {
     119    kCATransactionPhasePreLayout,
     120    kCATransactionPhasePreCommit,
     121    kCATransactionPhasePostCommit,
     122} CATransactionPhase;
     123
     124@interface CATransaction (Details)
     125+ (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase;
     126@end
     127#endif
    115128#endif // __OBJC__
    116129
  • trunk/Source/WebInspectorUI/ChangeLog

    r186120 r186133  
     12015-06-30  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
     4        https://bugs.webkit.org/show_bug.cgi?id=146168
     5
     6        Reviewed by Brian Burg.
     7
     8        * Localizations/en.lproj/localizedStrings.js:
     9        * UserInterface/Controllers/TimelineManager.js:
     10        (WebInspector.TimelineManager.prototype._processRecord):
     11        Added handling for new Composite record type. Paint records with a parent Composite record
     12        are flagged to simplify processing after the event hierarchy is unpacked.
     13
     14        * UserInterface/Images/TimelineRecordComposite.svg: Added.
     15        New composite record icon.
     16
     17        * UserInterface/Models/LayoutTimelineRecord.js:
     18        (WebInspector.LayoutTimelineRecord):
     19        (WebInspector.LayoutTimelineRecord.displayNameForEventType):
     20        (WebInspector.LayoutTimelineRecord.prototype.get duringComposite): Added
     21        Composite record support.
     22
     23        * UserInterface/Models/RenderingFrameTimelineRecord.js:
     24        (WebInspector.RenderingFrameTimelineRecord.prototype.durationForTask.get validRecordForTaskType):
     25        Add compositing time when bucketing runloop tasks, ignoring Paint events that are
     26        contained within a Composite event.
     27
     28        * UserInterface/Views/LayoutTimelineOverviewGraph.js:
     29        (WebInspector.LayoutTimelineOverviewGraph.prototype._layoutTimelineRecordAdded):
     30        Add Composite records to paint timeline row.
     31
     32        * UserInterface/Views/RenderingFrameTimelineView.js:
     33        (WebInspector.RenderingFrameTimelineView.prototype._processPendingRecords):
     34        Small unrelated fix.
     35
     36        * UserInterface/Views/TimelineIcons.css:
     37        (.composite-record .icon):
     38        * UserInterface/Views/TimelineRecordBar.css:
     39        (.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-composite > .segment):
     40        * UserInterface/Views/TimelineRecordTreeElement.js:
     41        (WebInspector.TimelineRecordTreeElement):
     42        New styles and tree element icon.
     43
    1442015-06-30  Joseph Pecoraro  <pecoraro@apple.com>
    245
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r185933 r186133  
    109109localizedStrings["Comment"] = "Comment";
    110110localizedStrings["Comment All Properties"] = "Comment All Properties";
     111localizedStrings["Composite"] = "Composite";
    111112localizedStrings["Compressed"] = "Compressed";
    112113localizedStrings["Compression"] = "Compression";
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

    r186098 r186133  
    263263            // COMPATIBILITY (iOS 6): Paint records data contained x, y, width, height properties. This became a quad "clip".
    264264            var quad = recordPayload.data.clip ? new WebInspector.Quad(recordPayload.data.clip) : null;
     265            var duringComposite = recordPayload.__duringComposite || false;
    265266            if (quad)
    266                 return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, null, null, quad.width, quad.height, quad);
     267                return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, null, null, quad.width, quad.height, quad, duringComposite);
    267268            else
    268                 return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Paint, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.x, recordPayload.data.y, recordPayload.data.width, recordPayload.data.height);
     269                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);
     270
     271        case TimelineAgent.EventType.Composite:
     272            recordPayload.children.forEach(function(childRecordPayload) {
     273                console.assert(childRecordPayload.type === TimelineAgent.EventType.Paint, childRecordPayload.type);
     274                childRecordPayload.__duringComposite = true;
     275            });
     276            return new WebInspector.LayoutTimelineRecord(WebInspector.LayoutTimelineRecord.EventType.Composite, startTime, endTime, callFrames, sourceCodeLocation);
    269277
    270278        case TimelineAgent.EventType.RenderingFrame:
  • trunk/Source/WebInspectorUI/UserInterface/Models/LayoutTimelineRecord.js

    r181769 r186133  
    2626WebInspector.LayoutTimelineRecord = class LayoutTimelineRecord extends WebInspector.TimelineRecord
    2727{
    28     constructor(eventType, startTime, endTime, callFrames, sourceCodeLocation, x, y, width, height, quad)
     28    constructor(eventType, startTime, endTime, callFrames, sourceCodeLocation, x, y, width, height, quad, duringComposite)
    2929    {
    3030        super(WebInspector.TimelineRecord.Type.Layout, startTime, endTime, callFrames, sourceCodeLocation);
     
    4141        this._height = typeof height === "number" ? height : NaN;
    4242        this._quad = quad instanceof WebInspector.Quad ? quad : null;
     43        this._duringComposite = duringComposite || false;
    4344    }
    4445
     
    6061        case WebInspector.LayoutTimelineRecord.EventType.Paint:
    6162            return WebInspector.UIString("Paint");
     63        case WebInspector.LayoutTimelineRecord.EventType.Composite:
     64            return WebInspector.UIString("Composite");
    6265        }
    6366    }
     
    107110    }
    108111
     112    get duringComposite()
     113    {
     114        return this._duringComposite;
     115    }
     116
    109117    saveIdentityToCookie(cookie)
    110118    {
     
    121129    ForcedLayout: "layout-timeline-record-forced-layout",
    122130    Layout: "layout-timeline-record-layout",
    123     Paint: "layout-timeline-record-paint"
     131    Paint: "layout-timeline-record-paint",
     132    Composite: "layout-timeline-record-composite"
    124133};
    125134
  • trunk/Source/WebInspectorUI/UserInterface/Models/RenderingFrameTimelineRecord.js

    r185455 r186133  
    8484                return record.type === WebInspector.TimelineRecord.Type.Script;
    8585            case WebInspector.RenderingFrameTimelineRecord.TaskType.Layout:
    86                 return record.type === WebInspector.TimelineRecord.Type.Layout && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Paint;
     86                return record.type === WebInspector.TimelineRecord.Type.Layout && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Paint && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Composite;
    8787            case WebInspector.RenderingFrameTimelineRecord.TaskType.Paint:
    88                 return record.type === WebInspector.TimelineRecord.Type.Layout && record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint;
     88                return record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint || record.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite;
    8989            default:
    9090                console.error("Unsupported task type: " + taskType);
     
    107107            }, 0);
    108108
    109             // Time spent in layout events which were synchronously triggered from JavaScript must be deducted from the
    110             // rendering frame's script duration, to prevent the time from being counted twice.
    111109            if (taskType === WebInspector.RenderingFrameTimelineRecord.TaskType.Script) {
     110                // Layout events synchronously triggered from JavaScript must be subtracted from the total
     111                // script time, to prevent the time from being counted twice.
    112112                duration -= this._children.reduce(function(previousValue, currentValue) {
    113113                    if (currentValue.type === WebInspector.TimelineRecord.Type.Layout && (currentValue.sourceCodeLocation || currentValue.callFrames))
    114114                        return previousValue + currentValue.duration;
    115115                    return previousValue;
     116                }, 0);
     117            } else if (taskType === WebInspector.RenderingFrameTimelineRecord.TaskType.Paint) {
     118                // Paint events triggered during a Composite event must be subtracted from the total painting time,
     119                // since the compositing time already includes time spent in these Paint events.
     120                var paintRecords = this._children.filter(function(record) { return record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint; });
     121                duration -= paintRecords.reduce(function(previousValue, currentValue) {
     122                    return currentValue.duringComposite ? previousValue + currentValue.duration : previousValue;
    116123                }, 0);
    117124            }
  • trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineOverviewGraph.js

    r185875 r186133  
    106106        console.assert(layoutTimelineRecord instanceof WebInspector.LayoutTimelineRecord);
    107107
    108         if (layoutTimelineRecord.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint)
     108        if (layoutTimelineRecord.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint || layoutTimelineRecord.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite)
    109109            this._timelinePaintRecordRow.records.push(layoutTimelineRecord);
    110110        else
  • trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js

    r185455 r186133  
    226226                    this._dataGrid.addRowInSortOrder(layoutTreeElement, layoutDataGridNode, treeElement);
    227227                } else if (childRecord.type === WebInspector.TimelineRecord.Type.Script) {
     228                    var rootNodes = [];
    228229                    if (childRecord.profile) {
    229230                        // FIXME: Support using the bottom-up tree once it is implemented.
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css

    r183579 r186133  
    7676}
    7777
     78.composite-record .icon {
     79    content: url(../Images/TimelineRecordComposite.svg);
     80}
     81
    7882.rendering-frame-record .icon {
    7983    content: url(../Images/TimelineRecordRenderingFrame.svg);
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordBar.css

    r185875 r186133  
    8888}
    8989
    90 .timeline-record-bar.timeline-record-type-layout.layout-timeline-record-paint > .segment {
     90
     91.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-paint > .segment,
     92.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-composite > .segment {
    9193    background-color: rgb(176, 204, 105);
    9294    border-color: rgb(152, 188, 77);
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js

    r183821 r186133  
    6262            case WebInspector.LayoutTimelineRecord.EventType.Paint:
    6363                iconStyleClass = WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass;
     64                break;
     65            case WebInspector.LayoutTimelineRecord.EventType.Composite:
     66                iconStyleClass = WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass;
    6467                break;
    6568            default:
     
    158161WebInspector.TimelineRecordTreeElement.LayoutRecordIconStyleClass = "layout-record";
    159162WebInspector.TimelineRecordTreeElement.PaintRecordIconStyleClass = "paint-record";
     163WebInspector.TimelineRecordTreeElement.CompositeRecordIconStyleClass = "composite-record";
    160164WebInspector.TimelineRecordTreeElement.RenderingFrameRecordIconStyleClass = "rendering-frame-record";
    161165WebInspector.TimelineRecordTreeElement.EvaluatedRecordIconStyleClass = "evaluated-record";
  • trunk/Source/WebKit2/ChangeLog

    r186132 r186133  
     12015-06-30  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
     4        https://bugs.webkit.org/show_bug.cgi?id=146168
     5
     6        Reviewed by Brian Burg.
     7
     8        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
     9        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
     10        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     11        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
     12        Added CA transaction post-commit handlers to instrument end of composite.
     13
    1142015-06-30  Beth Dakin  <bdakin@apple.com>
    215
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

    r184947 r186133  
    4141#import <WebCore/Frame.h>
    4242#import <WebCore/FrameView.h>
     43#import <WebCore/InspectorController.h>
    4344#import <WebCore/MainFrame.h>
    4445#import <WebCore/PageOverlayController.h>
     46#import <WebCore/QuartzCoreSPI.h>
    4547#import <WebCore/RenderLayerCompositor.h>
    4648#import <WebCore/RenderView.h>
     
    360362    visibleRect.intersect(m_scrolledExposedRect);
    361363
     364#if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
     365    [CATransaction addCommitHandler:^{
     366        m_webPage.corePage()->inspectorController().didComposite(m_webPage.mainFrameView()->frame());
     367    } forPhase:kCATransactionPhasePostCommit];
     368#endif
     369
    362370    m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
    363371
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r186045 r186133  
    4444#import <WebCore/GraphicsContext.h>
    4545#import <WebCore/GraphicsLayerCA.h>
     46#import <WebCore/InspectorController.h>
    4647#import <WebCore/MachSendRight.h>
    4748#import <WebCore/MainFrame.h>
    4849#import <WebCore/Page.h>
    4950#import <WebCore/PlatformCAAnimationCocoa.h>
     51#import <WebCore/QuartzCoreSPI.h>
    5052#import <WebCore/RenderLayerBacking.h>
    5153#import <WebCore/RenderLayerCompositor.h>
     
    389391            m_viewOverlayRootLayer->flushCompositingState(visibleRect);
    390392
     393#if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
     394        [CATransaction addCommitHandler:^{
     395            m_webPage.corePage()->inspectorController().didComposite(m_webPage.mainFrameView()->frame());
     396        } forPhase:kCATransactionPhasePostCommit];
     397#endif
     398
    391399        bool returnValue = m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
    392400#if ENABLE(ASYNC_SCROLLING)
Note: See TracChangeset for help on using the changeset viewer.