8195131: Dead code removal for changes present in JDK-8176795
authorjdv
Thu, 08 Feb 2018 14:58:40 +0530
changeset 49081 977219d0ee00
parent 49080 986c4945e3c3
child 49082 c569dfd90325
8195131: Dead code removal for changes present in JDK-8176795 Reviewed-by: prr, pnarayanan
src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java
src/java.desktop/unix/classes/sun/java2d/xr/XRColor.java
src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java
src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java	Mon Feb 05 02:07:12 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRBackendNative.java	Thu Feb 08 14:58:40 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, 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
@@ -149,7 +149,7 @@
 
         XRColor c = new XRColor();
         for (int i = 0; i < pixels.length; i++) {
-            c.setColorValues(pixels[i], true);
+            c.setColorValues(pixels[i]);
             renderColors[i * 4 + 0] = (short) c.alpha;
             renderColors[i * 4 + 1] = (short) c.red;
             renderColors[i * 4 + 2] = (short) c.green;
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRColor.java	Mon Feb 05 02:07:12 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRColor.java	Thu Feb 08 14:58:40 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, 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
@@ -73,7 +73,7 @@
         XRColor c = new XRColor();
 
         for (int i = 0; i < pixels.length; i++) {
-            c.setColorValues(pixels[i], true);
+            c.setColorValues(pixels[i]);
             colorValues[i * 4 + 0] = c.alpha;
             colorValues[i * 4 + 1] = c.red;
             colorValues[i * 4 + 2] = c.green;
@@ -83,7 +83,7 @@
         return colorValues;
     }
 
-    public void setColorValues(int pixel, boolean pre) {
+    public void setColorValues(int pixel) {
         long pix = XRUtils.intToULong(pixel);
         alpha = (int) (((pix & 0xFF000000) >> 16) + 255);
         red = (int) (((pix & 0x00FF0000) >> 8) + 255);
@@ -93,13 +93,6 @@
         if (alpha == 255) {
             alpha = 0;
         }
-
-        if (!pre) {
-            double alphaMult = XRUtils.XFixedToDouble(alpha);
-            this.red = (int) (red * alphaMult);
-            this.green = (int) (green * alphaMult);
-            this.blue = (int) (blue * alphaMult);
-        }
     }
 
     public static int byteToXRColorValue(int byteValue) {
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java	Mon Feb 05 02:07:12 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRCompositeManager.java	Thu Feb 08 14:58:40 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, 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
@@ -131,7 +131,7 @@
     }
 
     public void setForeground(int pixel) {
-        solidColor.setColorValues(pixel, true);
+        solidColor.setColorValues(pixel);
     }
 
     public void setGradientPaint(XRSurfaceData gradient) {
--- a/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java	Mon Feb 05 02:07:12 2018 -0800
+++ b/src/java.desktop/unix/classes/sun/java2d/xr/XRSolidSrcPict.java	Thu Feb 08 14:58:40 2018 +0530
@@ -47,7 +47,7 @@
 
     public XRSurfaceData prepareSrcPict(int pixelVal) {
         if(pixelVal != curPixVal) {
-            xrCol.setColorValues(pixelVal, true);
+            xrCol.setColorValues(pixelVal);
             con.renderRectangle(srcPict.picture, XRUtils.PictOpSrc, xrCol, 0, 0, 1, 1);
             this.curPixVal = pixelVal;
         }