Search in sources :

Example 1 with TimelineComponent

use of com.android.tools.adtui.TimelineComponent in project android by JetBrains.

the class GpuMonitorView method configureTimelineComponent.

private void configureTimelineComponent(@NotNull TimelineData data) {
    if (myApiLevel >= MHandler.MIN_API_LEVEL) {
        myPanel.remove(myTimelineComponent);
        myTimelineComponent = new TimelineComponent(data, myEvents, POST_M_TIMELINE_BUFFER_TIME, TIMELINE_INITIAL_MAX, POST_M_TIMELINE_ABSOLUTE_MAX, TIMELINE_INITIAL_MARKER_SEPARATION);
        Choreographer.animate(myTimelineComponent);
        myTimelineComponent.configureUnits("ms");
        myTimelineComponent.configureStream(0, "VSync Delay", new JBColor(0x007c6d, 0x00695c));
        myTimelineComponent.configureStream(1, "Input Handling", new JBColor(0x00a292, 0x00897b));
        myTimelineComponent.configureStream(2, "Animation", new JBColor(0x00b2a1, 0x009688));
        myTimelineComponent.configureStream(3, "Measure/Layout", new JBColor(0x2dc5b6, 0x26a69a));
        myTimelineComponent.configureStream(4, "Draw", new JBColor(0x27b2ff, 0x2196f3));
        myTimelineComponent.configureStream(5, "Sync", new JBColor(0x5de7ff, 0x4fc3f7));
        myTimelineComponent.configureStream(6, "Command Issue", new JBColor(0xff4f40, 0xf44336));
        myTimelineComponent.configureStream(7, "Swap Buffers", new JBColor(0xffb400, 0xff9800));
        myTimelineComponent.configureStream(8, "Misc Time", new JBColor(0x008f7f, 0x00796b));
        myTimelineComponent.setBackground(BACKGROUND_COLOR);
        setOverlayEnabled(NEEDS_NEWER_API_LABEL, false);
        myPanel.add(myTimelineComponent, BorderLayout.CENTER);
    } else if (myApiLevel >= JHandler.MIN_API_LEVEL) {
        myPanel.remove(myTimelineComponent);
        myTimelineComponent = new TimelineComponent(data, myEvents, PRE_M_TIMELINE_BUFFER_TIME, TIMELINE_INITIAL_MAX, PRE_M_TIMELINE_ABSOLUTE_MAX, TIMELINE_INITIAL_MARKER_SEPARATION);
        Choreographer.animate(myTimelineComponent);
        if (myApiLevel >= LHandler.MIN_API_LEVEL) {
            myTimelineComponent.configureUnits("ms");
            myTimelineComponent.configureStream(0, "Draw", new JBColor(0x4979f2, 0x3e66cc));
            myTimelineComponent.configureStream(1, "Prepare", new JBColor(0xa900ff, 0x8f00ff));
            myTimelineComponent.configureStream(2, "Process", new JBColor(0xff4315, 0xdc3912));
            myTimelineComponent.configureStream(3, "Execute", new JBColor(0xffb400, 0xe69800));
            myTimelineComponent.setBackground(BACKGROUND_COLOR);
        } else {
            myTimelineComponent.configureUnits("ms");
            myTimelineComponent.configureStream(0, "Draw", new JBColor(0x4979f2, 0x3e66cc));
            myTimelineComponent.configureStream(1, "Process", new JBColor(0xff4315, 0xdc3912));
            myTimelineComponent.configureStream(2, "Execute", new JBColor(0xffb400, 0xe69800));
            myTimelineComponent.setBackground(BACKGROUND_COLOR);
        }
        setOverlayEnabled(NEEDS_NEWER_API_LABEL, false);
        myPanel.add(myTimelineComponent, BorderLayout.CENTER);
    } else {
        setOverlayEnabled(NEEDS_NEWER_API_LABEL, true);
    }
    myTimelineComponent.configureEvent(EVENT_LAUNCH, 0, AndroidIcons.Ddms.Threads, new JBColor(0x92ADC6, 0x718493), new JBColor(0x2B4E8C, 0xC7E5FF), false);
    myTimelineComponent.configureEvent(EVENT_TRACING, 0, AndroidIcons.Ddms.StartMethodProfiling, new JBColor(0x92ADC6, 0x718493), new JBColor(0x2B4E8C, 0xC7E5FF), true);
    myTimelineComponent.addReference(16.6f, JBColor.GREEN);
    myTimelineComponent.addReference(33.3f, JBColor.RED);
}
Also used : JBColor(com.intellij.ui.JBColor) TimelineComponent(com.android.tools.adtui.TimelineComponent)

Aggregations

TimelineComponent (com.android.tools.adtui.TimelineComponent)1 JBColor (com.intellij.ui.JBColor)1