Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2019-02-05 10:36:49 +0000
committerAndrey Loskutov2019-02-05 11:44:23 +0000
commit9eb0a3a293e8289a75571731dc9d0b4cfadad548 (patch)
tree44c57071a941fa74089358083b6bf7c5a89d191c
parentfa6c7c34fc37b1d7bb939b8613dcff28c7eece2d (diff)
downloadeclipse.platform.ui-9eb0a3a293e8289a75571731dc9d0b4cfadad548.tar.gz
eclipse.platform.ui-9eb0a3a293e8289a75571731dc9d0b4cfadad548.tar.xz
eclipse.platform.ui-9eb0a3a293e8289a75571731dc9d0b4cfadad548.zip
Bug 505987 - avoid calling getDecorationRectangle() if not needed
This avoids some gazillions of calls to the ControlDecoration.getDecorationRectangle() and underlined OS widgets if the shouldShowDecoration() returns false. Change-Id: If69781d45fc249fc64f9ac6e543780867404e39c Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java
index 075bea90384..f239832fd81 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/fieldassist/ControlDecoration.java
@@ -623,8 +623,8 @@ public class ControlDecoration {
// Listener for painting the decoration
paintListener = event -> {
Control control = (Control) event.widget;
- Rectangle rect = getDecorationRectangle(control);
if (shouldShowDecoration()) {
+ Rectangle rect = getDecorationRectangle(control);
event.gc.drawImage(getImage(), rect.x, rect.y);
}
};

Back to the top