Skip to content

Commit 94dc330

Browse files
authored
Merge pull request #2685 from ControlSystemStudio/CSSTUDIO-1905
CSSTUDIO-1905 Improve caching of ImageView of the widgets "Picture" and "Symbol"
2 parents f75520e + 0c463cf commit 94dc330

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/PictureRepresentation.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import java.util.logging.Level;
1313

14+
import javafx.scene.CacheHint;
1415
import org.csstudio.display.builder.model.DirtyFlag;
1516
import org.csstudio.display.builder.model.DisplayModel;
1617
import org.csstudio.display.builder.model.UntypedWidgetPropertyListener;
@@ -56,6 +57,8 @@ public ImageView createJFXNode() throws Exception
5657
{
5758
final ImageView iv = new ImageView();
5859
iv.setSmooth(true);
60+
iv.setCache(true);
61+
iv.setCacheHint(CacheHint.SCALE); // Prevents excessive VRAM usage when zooming in using the D3D library for rendering under Windows.
5962
iv.getTransforms().addAll(translate, rotation);
6063
return iv;
6164
}

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/SymbolRepresentation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.logging.Level;
2424
import java.util.stream.Collectors;
2525

26+
import javafx.scene.CacheHint;
2627
import org.csstudio.display.builder.model.ArrayWidgetProperty;
2728
import org.csstudio.display.builder.model.DirtyFlag;
2829
import org.csstudio.display.builder.model.DisplayModel;
@@ -413,6 +414,9 @@ public void updateChanges ( ) {
413414
@Override
414415
protected StackPane createJFXNode ( ) throws Exception {
415416

417+
imageView.setCache(true);
418+
imageView.setCacheHint(CacheHint.SCALE); // Prevents excessive VRAM usage when zooming in using the D3D library for rendering under Windows.
419+
416420
autoSize = model_widget.propAutoSize().getValue();
417421
symbol = new Symbol(); //getDefaultSymbol();
418422

0 commit comments

Comments
 (0)