From 66b522e18e61cc3c42e4ef1012bf691db9b21b35 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Tue, 9 Jun 2015 20:19:52 +0300 Subject: [PATCH] tests ui paint optimization: tree.getRowBounds is not cheap and for most of rows (not run tests) would be ignored, so check if we would paint duration first --- .../execution/testframework/TestTreeView.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java b/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java index 38b2c195c89d..2c32b366a923 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java @@ -195,18 +195,18 @@ public abstract class TestTreeView extends Tree implements DataProvider, CopyPro if (isExpandableHandlerVisibleForCurrentRow(row)) { continue; } - Rectangle rowBounds = getRowBounds(row); - rowBounds.x = 0; - rowBounds.width = Integer.MAX_VALUE; + Object node = getPathForRow(row).getLastPathComponent(); + if (node instanceof DefaultMutableTreeNode) { + Object data = ((DefaultMutableTreeNode)node).getUserObject(); + if (data instanceof BaseTestProxyNodeDescriptor) { + final AbstractTestProxy testProxy = ((BaseTestProxyNodeDescriptor)data).getElement(); + final String durationString = testProxy.getDurationString(properties); + if (durationString != null) { + Rectangle rowBounds = getRowBounds(row); + rowBounds.x = 0; + rowBounds.width = Integer.MAX_VALUE; - if (rowBounds.intersects(clip)) { - Object node = getPathForRow(row).getLastPathComponent(); - if (node instanceof DefaultMutableTreeNode) { - Object data = ((DefaultMutableTreeNode)node).getUserObject(); - if (data instanceof BaseTestProxyNodeDescriptor) { - final AbstractTestProxy testProxy = ((BaseTestProxyNodeDescriptor)data).getElement(); - final String durationString = testProxy.getDurationString(properties); - if (durationString != null) { + if (rowBounds.intersects(clip)) { final Rectangle fullRowRect = new Rectangle(visibleRect.x, rowBounds.y, visibleRect.width, rowBounds.height); final boolean rowSelected = isRowSelected(row); final boolean hasTreeFocus = hasFocus();