changeset 7729:e6a0070b2865

Fix RT-38315: [Decora] Render bug with Lighting effect Reviewed by: kcr
author flar <James.Graham@oracle.com>
date Tue, 19 Aug 2014 18:16:49 -0700
parents eb55468a0a26
children 1b66feb4577d
files modules/graphics/src/main/java/com/sun/scenario/effect/PhongLighting.java
diffstat 1 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/scenario/effect/PhongLighting.java	Wed Aug 20 12:56:24 2014 +1200
+++ b/modules/graphics/src/main/java/com/sun/scenario/effect/PhongLighting.java	Tue Aug 19 18:16:49 2014 -0700
@@ -306,8 +306,33 @@
         // TODO: Since only the content input is used for the output bounds
         // we could attempt to factor the bounds of the content input in our
         // answer for the getInputClip() method of the RenderState, but for
-        // now we will just use the stock RenderSpaceRenderState object.
-        return RenderState.RenderSpaceRenderState;
+        // now we will just use (a close copy of) the stock RenderSpaceRenderState object.
+        return new RenderState() {
+            @Override
+            public EffectCoordinateSpace getEffectTransformSpace() {
+                return EffectCoordinateSpace.RenderSpace;
+            }
+
+            @Override
+            public BaseTransform getInputTransform(BaseTransform filterTransform) {
+                return filterTransform;
+            }
+
+            @Override
+            public BaseTransform getResultTransform(BaseTransform filterTransform) {
+                return BaseTransform.IDENTITY_TRANSFORM;
+            }
+
+            @Override
+            public Rectangle getInputClip(int i, Rectangle filterClip) {
+                if (i == 0) {
+                    Rectangle r = new Rectangle(filterClip);
+                    r.grow(1, 1);
+                    return r;
+                }
+                return filterClip;
+            }
+        };
     }
 
     @Override