< prev index next >

modules/javafx.graphics/src/test/java/test/javafx/scene/canvas/CanvasTest.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -47,10 +47,12 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 
 public class CanvasTest {
 
     private Canvas canvas;
     private GraphicsContext gc;

@@ -461,10 +463,20 @@
         assertEquals(BlendMode.ADD, gc.getGlobalBlendMode());
         gc.setGlobalBlendMode(null);
         assertEquals(BlendMode.ADD, gc.getGlobalBlendMode());
     }
 
+    @Test public void testGCState_ImageSmoothing() {
+        assertTrue("Image smoothing should be enabled by default.", gc.isImageSmoothing());
+        // Disable image smoothing.
+        gc.setImageSmoothing(false);
+        assertFalse("Image smoothing should be disabled.", gc.isImageSmoothing());
+        // Reset image smoothing to true.
+        gc.setImageSmoothing(true);
+        assertTrue("Image smoothing should be enabled.", gc.isImageSmoothing());
+    }
+
     @Test public void testGCappendSVGPath_Null() {
         gc.appendSVGPath("m 0 0");
         gc.appendSVGPath("Q 150 -300 300 0");
         gc.appendSVGPath(null);
     }
< prev index next >