changeset 11053:240c59f7a492

8148129: Implement Accelerated composition for WebView Reviewed-by: kcr, mbilla, arapte
author arajkumar
date Wed, 05 Sep 2018 21:44:47 +0530
parents b3da7e2896ae
children 3821cac856e3
files modules/javafx.graphics/src/main/java/com/sun/prism/Graphics.java modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DContext.java modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2Context.java modules/javafx.graphics/src/main/java/com/sun/prism/impl/BaseContext.java modules/javafx.graphics/src/main/java/com/sun/prism/impl/BaseGraphics.java modules/javafx.graphics/src/main/java/com/sun/prism/impl/ps/BaseShaderContext.java modules/javafx.graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java modules/javafx.graphics/src/main/java/com/sun/prism/sw/SWGraphics.java modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCBufferedContext.java modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCGraphicsPrismContext.java modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCPageBackBufferImpl.java modules/javafx.web/src/main/java/com/sun/webkit/WebPage.java modules/javafx.web/src/main/java/com/sun/webkit/graphics/GraphicsDecoder.java modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCCamera.java modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCGraphicsContext.java modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCTransform.java modules/javafx.web/src/main/java/com/sun/webkit/perf/WCGraphicsPerfLogger.java modules/javafx.web/src/main/native/Source/WebCore/PlatformJava.cmake modules/javafx.web/src/main/native/Source/WebCore/SourcesPlatformJava.txt modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/GraphicsContextJava.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/PlatformContextJava.h modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTextureJava.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTextureJava.h modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapper.h modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperJava.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperJava.h modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h modules/javafx.web/src/main/native/Source/WebCore/platform/java/ChromeClientJava.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/java/ChromeClientJava.h modules/javafx.web/src/main/native/Source/WebCore/platform/java/WebPage.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/java/WebPage.h modules/javafx.web/src/main/native/Source/WebCore/rendering/RenderLayerCompositor.cpp
diffstat 36 files changed, 634 insertions(+), 194 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/Graphics.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/Graphics.java	Wed Sep 05 21:44:47 2018 +0530
@@ -31,6 +31,7 @@
 import com.sun.javafx.geom.Rectangle;
 import com.sun.javafx.geom.Shape;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.geom.transform.GeneralTransform3D;
 import com.sun.javafx.scene.text.GlyphList;
 import com.sun.javafx.sg.prism.NGCamera;
 import com.sun.javafx.sg.prism.NGLightBase;
@@ -57,6 +58,7 @@
     public void scale(float sx, float sy);
     public void scale(float sx, float sy, float sz);
 
+    public void setPerspectiveTransform(GeneralTransform3D perspectiveTransform);
     public void setCamera(NGCamera camera);
     public NGCamera getCameraNoClone();
     public void setDepthTest(boolean depthTest);
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DContext.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/d3d/D3DContext.java	Wed Sep 05 21:44:47 2018 +0530
@@ -283,15 +283,27 @@
 
     @Override
     protected void updateShaderTransform(Shader shader, BaseTransform xform) {
+        if (xform == null) {
+            xform = BaseTransform.IDENTITY_TRANSFORM;
+        }
+
+        final GeneralTransform3D perspectiveTransform = getPerspectiveTransformNoClone();
         int res;
-        if (xform == null || xform.isIdentity()) {
+        if (xform.isIdentity() && perspectiveTransform.isIdentity()) {
             res = nResetTransform(pContext);
-        } else {
+        } else if (perspectiveTransform.isIdentity()) {
             res = nSetTransform(pContext,
                 xform.getMxx(), xform.getMxy(), xform.getMxz(), xform.getMxt(),
                 xform.getMyx(), xform.getMyy(), xform.getMyz(), xform.getMyt(),
                 xform.getMzx(), xform.getMzy(), xform.getMzz(), xform.getMzt(),
                 0.0, 0.0, 0.0, 1.0);
+        } else {
+            scratchTx.setIdentity().mul(xform).mul(perspectiveTransform);
+            res = nSetTransform(pContext,
+                scratchTx.get(0), scratchTx.get(1), scratchTx.get(2), scratchTx.get(3),
+                scratchTx.get(4), scratchTx.get(5), scratchTx.get(6), scratchTx.get(7),
+                scratchTx.get(8), scratchTx.get(9), scratchTx.get(10), scratchTx.get(11),
+                scratchTx.get(12), scratchTx.get(13), scratchTx.get(14), scratchTx.get(15));
         }
         validate(res);
     }
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2Context.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2Context.java	Wed Sep 05 21:44:47 2018 +0530
@@ -271,7 +271,12 @@
         }
 
         scratchTx.set(projViewTx);
-        updateRawMatrix(scratchTx.mul(xform));
+        final GeneralTransform3D perspectiveTransform = getPerspectiveTransformNoClone();
+        if (perspectiveTransform.isIdentity()) {
+            updateRawMatrix(scratchTx.mul(xform));
+        } else {
+            updateRawMatrix(scratchTx.mul(xform).mul(perspectiveTransform));
+        }
 
         ES2Shader es2shader = (ES2Shader) shader;
         es2shader.setMatrix("mvpMatrix", rawMatrix);
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/impl/BaseContext.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/impl/BaseContext.java	Wed Sep 05 21:44:47 2018 +0530
@@ -34,6 +34,7 @@
 import com.sun.javafx.font.FontStrike;
 import com.sun.javafx.geom.RectBounds;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.geom.transform.GeneralTransform3D;
 import com.sun.javafx.image.ByteToBytePixelConverter;
 import com.sun.javafx.image.impl.ByteGray;
 import com.sun.javafx.sg.prism.NGCamera;
@@ -70,6 +71,8 @@
     private Texture wrapRectTex;
     private Texture ovalTex;
 
+    private final GeneralTransform3D perspectiveTransform = new GeneralTransform3D();
+
     // TODO: need to dispose these when the context is disposed... (RT-27421)
     private final Map<FontStrike, GlyphCache>
         greyGlyphCaches = new HashMap<FontStrike, GlyphCache>();
@@ -119,6 +122,18 @@
         renderQuads(coordArray, colorArray, numVertices);
     }
 
+    protected GeneralTransform3D getPerspectiveTransformNoClone() {
+        return perspectiveTransform;
+    }
+
+    protected void setPerspectiveTransform(GeneralTransform3D transform) {
+        if (transform == null) {
+            perspectiveTransform.setIdentity();
+        } else {
+            perspectiveTransform.set(transform);
+        }
+    }
+
     protected abstract void renderQuads(float coordArray[], byte colorArray[], int numVertices);
 
     /**
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/impl/BaseGraphics.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/impl/BaseGraphics.java	Wed Sep 05 21:44:47 2018 +0530
@@ -34,6 +34,7 @@
 import com.sun.javafx.geom.Shape;
 import com.sun.javafx.geom.transform.Affine3D;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.geom.transform.GeneralTransform3D;
 import com.sun.javafx.sg.prism.NGCamera;
 import com.sun.javafx.sg.prism.NodePath;
 import com.sun.prism.BasicStroke;
@@ -137,6 +138,11 @@
         return transform3D;
     }
 
+    @Override
+    public void setPerspectiveTransform(GeneralTransform3D transform) {
+        context.setPerspectiveTransform(transform);
+    }
+
     public void setTransform(BaseTransform transform) {
         if (transform == null) {
             transform3D.setToIdentity();
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/impl/ps/BaseShaderContext.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/impl/ps/BaseShaderContext.java	Wed Sep 05 21:44:47 2018 +0530
@@ -29,6 +29,7 @@
 import com.sun.javafx.geom.Rectangle;
 import com.sun.javafx.geom.transform.Affine3D;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.geom.transform.GeneralTransform3D;
 import com.sun.javafx.sg.prism.NGCamera;
 import com.sun.prism.CompositeMode;
 import com.sun.prism.PixelFormat;
@@ -193,6 +194,12 @@
         private boolean lastState3D = false;
     }
 
+    @Override
+    protected void setPerspectiveTransform(GeneralTransform3D transform) {
+        state.isXformValid = false;
+        super.setPerspectiveTransform(transform);
+    }
+
     protected void resetLastClip(State state) {
         state.lastClip = null;
     }
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java	Wed Sep 05 21:44:47 2018 +0530
@@ -45,6 +45,7 @@
 import com.sun.javafx.geom.Shape;
 import com.sun.javafx.geom.transform.Affine2D;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.geom.transform.GeneralTransform3D;
 import com.sun.javafx.scene.text.GlyphList;
 import com.sun.javafx.sg.prism.NGCamera;
 import com.sun.javafx.sg.prism.NGLightBase;
@@ -1272,6 +1273,10 @@
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
+    public void setPerspectiveTransform(GeneralTransform3D transform) {
+    }
+
+
     public boolean isDepthBuffer() {
         return false;
     }
--- a/modules/javafx.graphics/src/main/java/com/sun/prism/sw/SWGraphics.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.graphics/src/main/java/com/sun/prism/sw/SWGraphics.java	Wed Sep 05 21:44:47 2018 +0530
@@ -40,6 +40,7 @@
 import com.sun.javafx.geom.Shape;
 import com.sun.javafx.geom.transform.Affine2D;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.geom.transform.GeneralTransform3D;
 import com.sun.javafx.geom.transform.NoninvertibleTransformException;
 import com.sun.javafx.scene.text.GlyphList;
 import com.sun.javafx.sg.prism.NGCamera;
@@ -199,6 +200,9 @@
     public void setCamera(NGCamera camera) {
     }
 
+    public void setPerspectiveTransform(GeneralTransform3D transform) {
+    }
+
     public NGCamera getCameraNoClone() {
         throw new UnsupportedOperationException("getCameraNoClone: unimp");
     }
--- a/modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCBufferedContext.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCBufferedContext.java	Wed Sep 05 21:44:47 2018 +0530
@@ -37,6 +37,7 @@
 import com.sun.prism.Graphics;
 import com.sun.scenario.effect.DropShadow;
 import com.sun.webkit.graphics.WCImage;
+import com.sun.webkit.graphics.WCTransform;
 
 final class WCBufferedContext extends WCGraphicsPrismContext {
 
@@ -203,6 +204,11 @@
         super.saveState();
     }
 
+    @Override public void setTransform(WCTransform tm) {
+        init();
+        super.setTransform(tm);
+    }
+
     private void init() {
         if (!isInitialized) {
             BaseTransform t = PrismGraphicsManager.getPixelScaleTransform();
--- a/modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCGraphicsPrismContext.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCGraphicsPrismContext.java	Wed Sep 05 21:44:47 2018 +0530
@@ -33,6 +33,7 @@
 import com.sun.javafx.geom.transform.Affine2D;
 import com.sun.javafx.geom.transform.Affine3D;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.geom.transform.GeneralTransform3D;
 import com.sun.javafx.logging.PlatformLogger;
 import com.sun.javafx.logging.PlatformLogger.Level;
 import com.sun.javafx.scene.text.GlyphList;
@@ -516,7 +517,9 @@
             @Override void doPaint(Graphics g) {
                 Paint paint = (rgba != null) ? createColor(rgba) : state.getPaintNoClone();
                 DropShadow shadow = state.getShadowNoClone();
-                if (shadow != null) {
+                // TextureMapperJava::drawSolidColor calls fillRect with perspective
+                // projection.
+                if (shadow != null || !state.getPerspectiveTransformNoClone().isIdentity()) {
                     final NGRectangle node = new NGRectangle();
                     node.updateRectangle(x, y, w, h, 0, 0);
                     render(g, shadow, paint, null, node);
@@ -1181,6 +1184,7 @@
 
         private DropShadow shadow;
         private Affine3D xform;
+        private GeneralTransform3D perspectiveTransform;
         private Layer layer;
         private int compositeOperation;
 
@@ -1190,6 +1194,7 @@
             stroke.setPaint(Color.BLACK);
             alpha = 1.0f;
             xform = new Affine3D();
+            perspectiveTransform = new GeneralTransform3D();
             compositeOperation = COMPOSITE_SOURCE_OVER;
         }
 
@@ -1201,6 +1206,7 @@
                 clip = new Rectangle(clip);
             }
             xform = new Affine3D(state.getTransformNoClone());
+            perspectiveTransform = new GeneralTransform3D().set(state.getPerspectiveTransformNoClone());
             setShadow(state.getShadowNoClone());
             setLayer(state.getLayerNoClone());
             setAlpha(state.getAlpha());
@@ -1214,8 +1220,8 @@
         }
 
         private void apply(Graphics g) {
-            //TODO: Verify if we need to apply more properties from state
             g.setTransform(getTransformNoClone());
+            g.setPerspectiveTransform(getPerspectiveTransformNoClone());
             g.setClipRect(getClipNoClone());
             g.setExtraAlpha(getAlpha());
         }
@@ -1310,10 +1316,18 @@
             return xform;
         }
 
+        private GeneralTransform3D getPerspectiveTransformNoClone() {
+            return perspectiveTransform;
+        }
+
         private void setTransform(final Affine3D at) {
             this.xform.setTransform(at);
         }
 
+        private void setPerspectiveTransform(final GeneralTransform3D gt) {
+            this.perspectiveTransform.set(gt);
+        }
+
         private void concatTransform(Affine3D at) {
             xform.concatenate(at);
         }
@@ -1790,9 +1804,15 @@
         }
     }
 
+    public void setPerspectiveTransform(WCTransform tm) {
+        final GeneralTransform3D at = new GeneralTransform3D().set(tm.getMatrix());
+        state.setPerspectiveTransform(at);
+        resetCachedGraphics();
+    }
+
     public void setTransform(WCTransform tm) {
-        double m[] = tm.getMatrix();
-        Affine3D at = new Affine3D(new Affine2D(m[0], m[1], m[2], m[3], m[4], m[5]));
+        final double m[] = tm.getMatrix();
+        final Affine3D at = new Affine3D(new Affine2D(m[0], m[1], m[2], m[3], m[4], m[5]));
         if (state.getLayerNoClone() == null) {
             at.preConcatenate(baseTransform);
         }
--- a/modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCPageBackBufferImpl.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCPageBackBufferImpl.java	Wed Sep 05 21:44:47 2018 +0530
@@ -33,6 +33,7 @@
 import com.sun.prism.ResourceFactoryListener;
 import com.sun.prism.Texture;
 import com.sun.prism.paint.Color;
+import com.sun.webkit.graphics.WCCamera;
 import com.sun.webkit.graphics.WCGraphicsContext;
 import com.sun.webkit.graphics.WCGraphicsManager;
 import com.sun.webkit.graphics.WCPageBackBuffer;
@@ -54,6 +55,8 @@
 
     public WCGraphicsContext createGraphics() {
         Graphics g = texture.createGraphics();
+        // Make use of custom camera created for WebKit.
+        g.setCamera(WCCamera.INSTANCE);
         g.scale(pixelScale, pixelScale);
         return WCGraphicsManager.getGraphicsManager().createGraphicsContext(g);
     }
--- a/modules/javafx.web/src/main/java/com/sun/webkit/WebPage.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/webkit/WebPage.java	Wed Sep 05 21:44:47 2018 +0530
@@ -25,6 +25,8 @@
 
 package com.sun.webkit;
 
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
 import com.sun.glass.utils.NativeLibLoader;
 import com.sun.javafx.logging.PlatformLogger;
 import com.sun.javafx.logging.PlatformLogger.Level;
@@ -145,8 +147,13 @@
             final boolean useDFGJIT = Boolean.valueOf(System.getProperty(
                     "com.sun.webkit.useDFGJIT", "true"));
 
+            // TODO: Enable CSS3D by default once it is stabilized.
+            boolean useCSS3D = Boolean.valueOf(System.getProperty(
+                    "com.sun.webkit.useCSS3D", "false"));
+            useCSS3D = useCSS3D && Platform.isSupported(ConditionalFeature.SCENE3D);
+
             // Initialize WTF, WebCore and JavaScriptCore.
-            twkInitWebCore(useJIT, useDFGJIT);
+            twkInitWebCore(useJIT, useDFGJIT, useCSS3D);
             return null;
         });
 
@@ -2529,7 +2536,7 @@
     // Native methods
     // *************************************************************************
 
-    private static native void twkInitWebCore(boolean useJIT, boolean useDFGJIT);
+    private static native void twkInitWebCore(boolean useJIT, boolean useDFGJIT, boolean useCSS3D);
     private native long twkCreatePage(boolean editable);
     private native void twkInit(long pPage, boolean usePlugins, float devicePixelScale);
     private native void twkDestroyPage(long pPage);
--- a/modules/javafx.web/src/main/java/com/sun/webkit/graphics/GraphicsDecoder.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/webkit/graphics/GraphicsDecoder.java	Wed Sep 05 21:44:47 2018 +0530
@@ -84,6 +84,7 @@
     @Native public final static int SET_LINE_JOIN          = 53;
     @Native public final static int SET_MITER_LIMIT        = 54;
     @Native public final static int SET_TEXT_MODE          = 55;
+    @Native public final static int SET_PERSPECTIVE_TRANSFORM = 56;
 
     private final static PlatformLogger log =
             PlatformLogger.getLogger(GraphicsDecoder.class.getName());
@@ -326,6 +327,13 @@
                             buf.getFloat(), buf.getFloat(), buf.getFloat(),
                             buf.getFloat(), buf.getFloat(), buf.getFloat()));
                     break;
+                case SET_PERSPECTIVE_TRANSFORM:
+                    gc.setPerspectiveTransform(new WCTransform(
+                            buf.getFloat(), buf.getFloat(), buf.getFloat(), buf.getFloat(),
+                            buf.getFloat(), buf.getFloat(), buf.getFloat(), buf.getFloat(),
+                            buf.getFloat(), buf.getFloat(), buf.getFloat(), buf.getFloat(),
+                            buf.getFloat(), buf.getFloat(), buf.getFloat(), buf.getFloat()));
+                    break;
                 case SET_TRANSFORM:
                     gc.setTransform(new WCTransform(
                             buf.getFloat(), buf.getFloat(), buf.getFloat(),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCCamera.java	Wed Sep 05 21:44:47 2018 +0530
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 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
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.webkit.graphics;
+
+import com.sun.javafx.sg.prism.NGCamera;
+import com.sun.javafx.sg.prism.NGDefaultCamera;
+
+// WCCamera is based on NGDefaultCamera, but the near and far clip
+// values are modified according to WebKit's requirement.
+// Refer TextureMapperGL.cpp, createProjectionMatrix function.
+
+// According to w3c spec,
+//
+// perspective(<number>)
+//
+// specifies a perspective projection matrix. This matrix maps a viewing cube
+// onto a pyramid whose base is infinitely far away from the viewer and whose
+// peak represents the viewer's position. The viewable area is the region
+// bounded by the four edges of the viewport (the portion of the browser window
+// used for rendering the webpage between the viewer's position and a point
+// at a distance of infinity from the viewer). The depth, given as the
+// parameter to the function, represents the distance of the z=0 plane
+// from the viewer. Lower values give a more flattened pyramid and therefore
+// a more pronounced perspective effect. The value is given in pixels,
+// so a value of 1000 gives a moderate amount of foreshortening and a value of
+// 200 gives an extreme amount. The matrix is computed by starting with an
+// identity matrix and replacing the value at row 3, column 4 with the value
+// -1/depth. The value for depth must be greater than zero, otherwise the
+// function is invalid.
+
+public class WCCamera extends NGDefaultCamera {
+
+    public static final NGCamera INSTANCE = new WCCamera();
+
+    public void validate(final int w, final int h) {
+        if ((w != viewWidth) || (h != viewHeight)) {
+            setViewWidth(w);
+            setViewHeight(h);
+
+            projViewTx.ortho(0.0, w, h, 0.0, -9999999, 99999);
+        }
+    }
+}
+
--- a/modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCGraphicsContext.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCGraphicsContext.java	Wed Sep 05 21:44:47 2018 +0530
@@ -87,6 +87,7 @@
     public abstract void scale(float sx, float sy);
     public abstract void rotate(float radians);
 
+    public abstract void setPerspectiveTransform(WCTransform t);
     public abstract void setTransform(WCTransform t);
     public abstract WCTransform getTransform();
     public abstract void concatTransform(WCTransform t);
--- a/modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCTransform.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/webkit/graphics/WCTransform.java	Wed Sep 05 21:44:47 2018 +0530
@@ -29,10 +29,40 @@
 
 public final class WCTransform extends Ref {
     private final double[] m;
+    private final boolean is3D;
+
+    public WCTransform(double m11, double m12, double m13, double m14,
+                       double m21, double m22, double m23, double m24,
+                       double m31, double m32, double m33, double m34,
+                       double m41, double m42, double m43, double m44)
+    {
+        this.m = new double[16];
+
+        m[0] = m11;
+        m[1] = m21;
+        m[2] = m31;
+        m[3] = m41;
+
+        m[4] = m12;
+        m[5] = m22;
+        m[6] = m32;
+        m[7] = m42;
+
+        m[8] = m13;
+        m[9] = m23;
+        m[10] = m33;
+        m[11] = m43;
+
+        m[12] = m14;
+        m[13] = m24;
+        m[14] = m34;
+        m[15] = m44;
+
+        this.is3D = true;
+    }
 
     public WCTransform(double m00, double m10, double m01, double m11,
-                       double m02, double m12)
-    {
+                       double m02, double m12) {
         this.m = new double[6];
         m[0] = m00;
         m[1] = m10;
@@ -40,9 +70,26 @@
         m[3] = m11;
         m[4] = m02;
         m[5] = m12;
+
+        this.is3D = false;
     }
 
     public double [] getMatrix() {
         return Arrays.copyOf(m, m.length);
     }
+
+    @Override
+    public String toString() {
+         String val = "WCTransform:";
+         if (is3D) {
+            val += "(" + m[0] + "," + m[1] + "," + m[2] + "," + m[3] + ")" +
+                   "(" + m[4] + "," + m[5] + "," + m[6] + "," + m[7] + ")" +
+                   "(" + m[8] + "," + m[9] + "," + m[10] + "," + m[11] + ")" +
+                   "(" + m[12] + "," + m[13] + "," + m[14] + "," + m[15] + ")";
+         } else {
+            val += "(" + m[0] + "," + m[1] + "," + m[2] + ")" +
+                   "(" + m[3] + "," + m[4] + "," + m[5] + ")";
+         }
+         return val;
+    }
 }
--- a/modules/javafx.web/src/main/java/com/sun/webkit/perf/WCGraphicsPerfLogger.java	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/java/com/sun/webkit/perf/WCGraphicsPerfLogger.java	Wed Sep 05 21:44:47 2018 +0530
@@ -440,6 +440,13 @@
     }
 
     @Override
+    public void setPerspectiveTransform(WCTransform t) {
+        logger.resumeCount("SETPERSPECTIVETRANSFORM");
+        gc.setPerspectiveTransform(t);
+        logger.suspendCount("SETPERSPECTIVETRANSFORM");
+    }
+
+    @Override
     public void setTransform(WCTransform t) {
         logger.resumeCount("SETTRANSFORM");
         gc.setTransform(t);
--- a/modules/javafx.web/src/main/native/Source/WebCore/PlatformJava.cmake	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/PlatformJava.cmake	Wed Sep 05 21:44:47 2018 +0530
@@ -44,9 +44,11 @@
         platform/cf/URLCF.cpp
         platform/cf/CFURLExtras.cpp
     )
+# find_library(OPENGL_LIBRARY OpenGL)
     find_library(ACCELERATE_LIBRARY accelerate)
     list(APPEND WebCore_LIBRARIES
         ${ACCELERATE_LIBRARY}
+        # ${OPENGL_LIBRARY}
     )
 endif ()
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/SourcesPlatformJava.txt	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/SourcesPlatformJava.txt	Wed Sep 05 21:44:47 2018 +0530
@@ -85,6 +85,8 @@
 platform/graphics/java/PathJava.cpp
 platform/graphics/java/RenderingQueue.cpp
 platform/graphics/java/RQRef.cpp
+platform/graphics/texmap/TextureMapperJava.cpp
+platform/graphics/texmap/BitmapTextureJava.cpp
 
 platform/ScrollAnimatorSmooth.cpp
 platform/ScrollAnimationSmooth.cpp
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/GraphicsContextJava.cpp	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/GraphicsContextJava.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -901,24 +901,6 @@
     setFillColor(oldFillColor);
 }
 
-#if ENABLE(3D_RENDERING) && USE(TEXTURE_MAPPER)
-TransformationMatrix GraphicsContext::get3DTransform() const
-{
-    // FIXME: Can we approximate the transformation better than this?
-    return getCTM().toTransformationMatrix();
-}
-
-void GraphicsContext::concat3DTransform(const TransformationMatrix& transform)
-{
-    concatCTM(transform.toAffineTransform());
-}
-
-void GraphicsContext::set3DTransform(const TransformationMatrix& transform)
-{
-    setCTM(transform.toAffineTransform());
-}
-#endif
-
 //utatodo: do we need the Java-only m_state.transform?
 AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
 {
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/PlatformContextJava.h	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/PlatformContextJava.h	Wed Sep 05 21:44:47 2018 +0530
@@ -60,6 +60,10 @@
             return m_jRenderTheme;
         }
 
+        void setJRenderTheme(RefPtr<RQRef> jTheme) {
+            m_jRenderTheme = jTheme;
+        }
+
         void beginPath() {
             m_path.clear();
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTextureJava.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 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
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "config.h"
+
+#include "BitmapTextureJava.h"
+#include "GraphicsLayer.h"
+#include "NotImplemented.h"
+#include "PlatformContextJava.h"
+#include "TextureMapperJava.h"
+
+namespace WebCore {
+
+void BitmapTextureJava::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag)
+{
+#if PLATFORM(CAIRO)
+    RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create_for_data(static_cast<unsigned char*>(data()),
+        CAIRO_FORMAT_ARGB32, targetRect.width(), targetRect.height(), bytesPerLine));
+    m_image->context()->platformContext()->drawSurfaceToContext(surface.get(), targetRect,
+        IntRect(sourceOffset, targetRect.size()), m_image->context());
+#else
+    UNUSED_PARAM(data);
+    UNUSED_PARAM(targetRect);
+    UNUSED_PARAM(sourceOffset);
+    UNUSED_PARAM(bytesPerLine);
+#endif
+}
+
+void BitmapTextureJava::updateContents(TextureMapper& mapper, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& sourceOffset, UpdateContentsFlag, float)
+{
+    GraphicsContext& context = m_image->context();
+    // Share RenderThemeJava context
+    context.platformContext()->setJRenderTheme(static_cast<TextureMapperJava&>(mapper).graphicsContext()->platformContext()->jRenderTheme());
+
+    context.clearRect(targetRect);
+
+    IntRect sourceRect(targetRect);
+    sourceRect.setLocation(sourceOffset);
+    context.save();
+    context.clip(targetRect);
+    context.translate(targetRect.x() - sourceOffset.x(), targetRect.y() - sourceOffset.y());
+    sourceLayer->paintGraphicsLayerContents(context, sourceRect);
+    context.restore();
+}
+
+void BitmapTextureJava::didReset()
+{
+    float devicePixelRatio = 1.0;
+    m_image = ImageBuffer::create(contentSize(), Accelerated, devicePixelRatio);
+}
+
+void BitmapTextureJava::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag)
+{
+    m_image->context().drawImage(*image, targetRect, IntRect(offset, targetRect.size()), CompositeCopy);
+}
+
+RefPtr<BitmapTexture> BitmapTextureJava::applyFilters(TextureMapper&, const FilterOperations&)
+{
+    notImplemented();
+    return this;
+}
+
+} // namespace WebCore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTextureJava.h	Wed Sep 05 21:44:47 2018 +0530
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 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
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#pragma once
+
+#include "BitmapTexture.h"
+#include "ImageBuffer.h"
+#include "IntRect.h"
+#include "IntSize.h"
+
+namespace WebCore {
+
+class GraphicsContext;
+
+class BitmapTextureJava : public BitmapTexture {
+public:
+    static Ref<BitmapTexture> create() { return adoptRef(*new BitmapTextureJava); }
+    IntSize size() const override { return m_image->internalSize(); }
+    void didReset() override;
+    bool isValid() const override { return m_image.get(); }
+    inline GraphicsContext* graphicsContext() { return m_image ? &(m_image->context()) : nullptr; }
+    void updateContents(Image*, const IntRect&, const IntPoint&, UpdateContentsFlag) override;
+    void updateContents(TextureMapper&, GraphicsLayer*, const IntRect& target, const IntPoint& offset, UpdateContentsFlag, float scale = 1) override;
+    void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag) override;
+    RefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) override;
+    ImageBuffer* image() const { return m_image.get(); }
+
+private:
+    BitmapTextureJava() { }
+    std::unique_ptr<ImageBuffer> m_image;
+};
+
+}
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -29,6 +29,8 @@
 
 #if USE(TEXTURE_MAPPER_GL)
 #include "BitmapTextureGL.h"
+#elif PLATFORM(JAVA)
+#include "BitmapTextureJava.h"
 #endif
 
 namespace WebCore {
@@ -42,6 +44,11 @@
     , m_releaseUnusedTexturesTimer(RunLoop::current(), this, &BitmapTexturePool::releaseUnusedTexturesTimerFired)
 {
 }
+#else
+BitmapTexturePool::BitmapTexturePool()
+    : m_releaseUnusedTexturesTimer(RunLoop::current(), this, &BitmapTexturePool::releaseUnusedTexturesTimerFired)
+{
+}
 #endif
 
 RefPtr<BitmapTexture> BitmapTexturePool::acquireTexture(const IntSize& size, const BitmapTexture::Flags flags)
@@ -94,6 +101,9 @@
 {
 #if USE(TEXTURE_MAPPER_GL)
     return BitmapTextureGL::create(m_contextAttributes, flags);
+#elif PLATFORM(JAVA)
+    UNUSED_PARAM(flags);
+    return BitmapTextureJava::create();
 #else
     UNUSED_PARAM(flags);
     return nullptr;
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h	Wed Sep 05 21:44:47 2018 +0530
@@ -42,6 +42,8 @@
 public:
 #if USE(TEXTURE_MAPPER_GL)
     explicit BitmapTexturePool(const TextureMapperContextAttributes&);
+#else
+    BitmapTexturePool();
 #endif
 
     RefPtr<BitmapTexture> acquireTexture(const IntSize&, const BitmapTexture::Flags);
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapper.h	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapper.h	Wed Sep 05 21:44:47 2018 +0530
@@ -101,7 +101,7 @@
     const TransformationMatrix& patternTransform() const { return m_patternTransform; }
 
 private:
-#if USE(TEXTURE_MAPPER_GL)
+#if USE(TEXTURE_MAPPER_GL) || PLATFORM(JAVA)
     static std::unique_ptr<TextureMapper> platformCreateAccelerated();
 #else
     static std::unique_ptr<TextureMapper> platformCreateAccelerated()
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -27,45 +27,6 @@
 
 namespace WebCore {
 
-//utatodo: move to TextureMapperTile.cpp
-#if 0 && PLATFORM(JAVA)
-void TextureMapperTile::updateContents(TextureMapper* textureMapper, GraphicsLayer* layer, const IntRect& dirtyRect)
-{
-    IntRect rect = enclosingIntRect(m_rect);
-    IntRect targetRect = rect;
-    targetRect.intersect(dirtyRect);
-    if (targetRect.isEmpty())
-        return;
-
-    if (!m_texture) {
-        m_texture = textureMapper->createTexture();
-        m_texture->reset(rect.size(), BitmapTexture::SupportsAlpha);
-    }
-
-    BitmapTextureImageBuffer* texture = dynamic_cast<BitmapTextureImageBuffer*>(m_texture.get());
-    ASSERT(texture);
-
-    GraphicsContext* context = texture->graphicsContext();
-    context->save();
-    context->setImageInterpolationQuality(textureMapper->imageInterpolationQuality());
-    context->setTextDrawingMode(textureMapper->textDrawingMode());
-    context->translate(-rect.x(), -rect.y());
-    context->clip(targetRect);
-    context->clearRect(targetRect);
-
-    layer->paintGraphicsLayerContents(*context, targetRect);
-
-    context->restore();
-}
-
-void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, GraphicsLayer* layer, const FloatSize& totalSize, const IntRect& dirtyRect)
-{
-    createOrDestroyTilesIfNeeded(totalSize, IntSize(2048, 2048), true);
-    for (size_t i = 0; i < m_tiles.size(); ++i)
-        m_tiles[i].updateContents(textureMapper, layer, dirtyRect);
-}
-#endif
-
 unsigned TextureMapperBackingStore::calculateExposedTileEdges(const FloatRect& totalRect, const FloatRect& tileRect)
 {
     unsigned exposedEdges = TextureMapper::NoEdges;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperJava.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 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
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "config.h"
+#include "TextureMapperJava.h"
+
+#include "PlatformContextJava.h"
+#include "BitmapTexturePool.h"
+#include "GraphicsLayer.h"
+#include "NotImplemented.h"
+#include <wtf/RandomNumber.h>
+
+#include "com_sun_webkit_graphics_GraphicsDecoder.h"
+
+#if USE(TEXTURE_MAPPER)
+namespace WebCore {
+
+static const int s_maximumAllowedImageBufferDimension = 256;
+
+std::unique_ptr<TextureMapper> TextureMapper::platformCreateAccelerated()
+{
+    return std::make_unique<TextureMapperJava>();
+}
+
+TextureMapperJava::TextureMapperJava()
+{
+    m_texturePool = std::make_unique<BitmapTexturePool>();
+}
+
+IntSize TextureMapperJava::maxTextureSize() const
+{
+    return IntSize(s_maximumAllowedImageBufferDimension, s_maximumAllowedImageBufferDimension);
+}
+
+void TextureMapperJava::beginClip(const TransformationMatrix& matrix, const FloatRect& rect)
+{
+    GraphicsContext* context = currentContext();
+    if (!context)
+        return;
+    auto previousTransform = context->getCTM();
+    context->save();
+    context->concatCTM(matrix.toAffineTransform());
+    context->clip(rect);
+    context->setCTM(previousTransform);
+}
+
+void TextureMapperJava::drawTexture(const BitmapTexture& texture, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, unsigned /* exposedEdges */)
+{
+    GraphicsContext* context = currentContext();
+    if (!context)
+        return;
+
+    const BitmapTextureJava& textureImageBuffer = static_cast<const BitmapTextureJava&>(texture);
+    ImageBuffer* image = textureImageBuffer.image();
+    context->save();
+    context->setCompositeOperation(isInMaskMode() ? CompositeDestinationIn : CompositeSourceOver);
+    context->setAlpha(opacity);
+    context->platformContext()->rq().freeSpace(68)
+        << (jint)com_sun_webkit_graphics_GraphicsDecoder_SET_PERSPECTIVE_TRANSFORM
+        << (float)transform.m11() << (float)transform.m12() << (float)transform.m13() << (float)transform.m14()
+        << (float)transform.m21() << (float)transform.m22() << (float)transform.m23() << (float)transform.m24()
+        << (float)transform.m31() << (float)transform.m32() << (float)transform.m33() << (float)transform.m34()
+        << (float)transform.m41() << (float)transform.m42() << (float)transform.m43() << (float)transform.m44();
+    context->drawImageBuffer(*image, targetRect);
+    context->restore();
+}
+
+void TextureMapperJava::drawSolidColor(const FloatRect& rect, const TransformationMatrix& transform, const Color& color)
+{
+    GraphicsContext* context = currentContext();
+    if (!context)
+        return;
+
+    context->save();
+    context->setCompositeOperation(isInMaskMode() ? CompositeDestinationIn : CompositeSourceOver);
+    context->platformContext()->rq().freeSpace(68)
+        << (jint)com_sun_webkit_graphics_GraphicsDecoder_SET_PERSPECTIVE_TRANSFORM
+        << (float)transform.m11() << (float)transform.m12() << (float)transform.m13() << (float)transform.m14()
+        << (float)transform.m21() << (float)transform.m22() << (float)transform.m23() << (float)transform.m24()
+        << (float)transform.m31() << (float)transform.m32() << (float)transform.m33() << (float)transform.m34()
+        << (float)transform.m41() << (float)transform.m42() << (float)transform.m43() << (float)transform.m44();
+
+    context->fillRect(rect, color);
+    context->restore();
+}
+
+void TextureMapperJava::drawBorder(const Color&, float /* borderWidth */, const FloatRect&, const TransformationMatrix&)
+{
+    notImplemented();
+}
+
+void TextureMapperJava::drawNumber(int /* number */, const Color&, const FloatPoint&, const TransformationMatrix&)
+{
+    notImplemented();
+}
+
+void TextureMapperJava::clearColor(const Color&)
+{
+    notImplemented();
+}
+
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperJava.h	Wed Sep 05 21:44:47 2018 +0530
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 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
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#pragma once
+
+#include "BitmapTextureJava.h"
+#include "ImageBuffer.h"
+#include "TextureMapper.h"
+
+#if USE(TEXTURE_MAPPER)
+namespace WebCore {
+
+class TextureMapperJava final : public TextureMapper {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    TextureMapperJava();
+
+    // TextureMapper implementation
+    void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) final;
+    void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) final;
+    void drawTexture(const BitmapTexture&, const FloatRect& targetRect, const TransformationMatrix&, float opacity, unsigned exposedEdges) final;
+    void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) final;
+    void beginClip(const TransformationMatrix&, const FloatRect&) final;
+    void bindSurface(BitmapTexture* surface) final { m_currentSurface = surface;}
+    void endClip() final { graphicsContext()->restore(); }
+    IntRect clipBounds() final { return currentContext()->clipBounds(); }
+    IntSize maxTextureSize() const final;
+    Ref<BitmapTexture> createTexture() final { return BitmapTextureJava::create(); }
+    Ref<BitmapTexture> createTexture(GC3Dint) final { return createTexture(); }
+    void clearColor(const Color&) final;
+
+    inline GraphicsContext* currentContext()
+    {
+        return m_currentSurface ? static_cast<BitmapTextureJava*>(m_currentSurface.get())->graphicsContext() : graphicsContext();
+    }
+
+    void setGraphicsContext(GraphicsContext* context) { m_context = context; }
+    GraphicsContext* graphicsContext() { return m_context; }
+private:
+    RefPtr<BitmapTexture> m_currentSurface;
+    GraphicsContext* m_context;
+};
+
+}
+#endif // USE(TEXTURE_MAPPER)
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -665,31 +665,8 @@
         child->applyAnimationsRecursively();
 }
 
-#if 0 && PLATFORM(JAVA)
-void TextureMapperLayer::syncAnimationsRecursive()
-{
-    syncAnimations();
-    if (m_state.maskLayer) {
-        m_state.maskLayer->syncAnimationsRecursive();
-    }
-    if (m_state.replicaLayer) {
-        m_state.replicaLayer->syncAnimationsRecursive();
-    }
-    for (size_t i = 0; i < m_children.size(); ++i) {
-        m_children[i]->syncAnimationsRecursive();
-    }
-}
-#endif
-
 void TextureMapperLayer::syncAnimations()
 {
-//JAVAMERGE
-#if 0 && PLATFORM(JAVA)
-    // m_state.transform and m_state.opacity represent the layer state upon
-    // the last layer sync so it makes little sense to apply them at the
-    // end of animation. We better rely on GraphicsLayerAnimation::apply()
-    // to correctly apply the end state.
-#else
     m_animations.apply(*this);
     if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyTransform))
         m_currentTransform.setLocalTransform(m_state.transform);
@@ -698,7 +675,6 @@
 
     if (!m_animations.hasActiveAnimationsOfType(AnimatedPropertyFilter))
         m_currentFilters = m_state.filters;
-#endif
 }
 
 bool TextureMapperLayer::isAncestorFixedToViewport() const
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h	Wed Sep 05 21:44:47 2018 +0530
@@ -124,10 +124,6 @@
     void syncAnimations();
     bool descendantsOrSelfHaveRunningAnimations() const;
 
-#if 0 && PLATFORM(JAVA)
-    void syncAnimationsRecursive();
-#endif
-
     void paint();
 
     void setScrollPositionDeltaIfNeeded(const FloatSize&);
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/java/ChromeClientJava.cpp	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/java/ChromeClientJava.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -666,8 +666,7 @@
     notImplemented();
 }
 
-#if USE(ACCELERATED_COMPOSITING)
-void ChromeClientJava::attachRootGraphicsLayer(Frame*, GraphicsLayer* layer)
+void ChromeClientJava::attachRootGraphicsLayer(Frame&, GraphicsLayer* layer)
 {
     WebPage::webPageFromJObject(m_webPage)->setRootChildLayer(layer);
 }
@@ -682,9 +681,9 @@
 {
     WebPage::webPageFromJObject(m_webPage)->scheduleCompositingLayerSync();
 }
-#endif // USE(ACCELERATED_COMPOSITING)
 
-void ChromeClientJava::attachViewOverlayGraphicsLayer(Frame&, GraphicsLayer*) {
+void ChromeClientJava::attachViewOverlayGraphicsLayer(Frame&, GraphicsLayer*)
+{
     notImplemented();
 }
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/java/ChromeClientJava.h	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/java/ChromeClientJava.h	Wed Sep 05 21:44:47 2018 +0530
@@ -143,23 +143,16 @@
     void enumerateChosenDirectory(FileChooser*) override;
 #endif
 
-#if USE(ACCELERATED_COMPOSITING)
-    // Allows ports to customize the type of graphics layers created by this page.
-    GraphicsLayerFactory* graphicsLayerFactory() const { return 0; }
+    GraphicsLayerFactory* graphicsLayerFactory() const override { return nullptr; }
 
     // Pass 0 as the GraphicsLayer to detatch the root layer.
-    void attachRootGraphicsLayer(Frame*, GraphicsLayer*) override;
+    void attachRootGraphicsLayer(Frame&, GraphicsLayer*) override;
     // Sets a flag to specify that the next time content is drawn to the window,
     // the changes appear on the screen in synchrony with updates to GraphicsLayers.
     void setNeedsOneShotDrawingSynchronization() override;
     // Sets a flag to specify that the view needs to be updated, so we need
     // to do an eager layout before the drawing.
     void scheduleCompositingLayerFlush() override;
-#else //XXX: implement?
-    void attachRootGraphicsLayer(Frame&, GraphicsLayer*) override {}
-    void setNeedsOneShotDrawingSynchronization() override {}
-    void scheduleCompositingLayerFlush() override {}
-#endif
     void attachViewOverlayGraphicsLayer(Frame&, GraphicsLayer*) override;
 
 #if ENABLE(TOUCH_EVENTS)
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/java/WebPage.cpp	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/java/WebPage.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -78,11 +78,9 @@
 #include <wtf/java/JavaRef.h>
 #include <wtf/RunLoop.h>
 
-#if USE(ACCELERATED_COMPOSITING)
-#include "TextureMapper.h"
+#include "TextureMapperJava.h"
 #include "TextureMapperLayer.h"
 #include "GraphicsLayerTextureMapper.h"
-#endif
 
 #include "Logging.h"
 #include "ContextMenu.h"
@@ -155,16 +153,8 @@
 namespace WebCore {
 
 WebPage::WebPage(std::unique_ptr<Page> page)
-    :
-    // m_page(page)
-    // ,
-     m_suppressNextKeypressEvent(false)
-    , m_isDebugging(false)
-#if USE(ACCELERATED_COMPOSITING)
-    , m_syncLayers(false)
-#endif
+    : m_page(WTFMove(page))
 {
-    m_page = std::move(page);
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     if(!NotificationController::from(m_page.get())) {
         provideNotification(m_page.get(), NotificationClientJava::instance());
@@ -215,12 +205,10 @@
     frameView->resize(size);
     frameView->layoutContext().scheduleLayout();
 
-#if USE(ACCELERATED_COMPOSITING)
     if (m_rootLayer) {
         m_rootLayer->setSize(size);
         m_rootLayer->setNeedsDisplay();
     }
-#endif
 }
 
 static void drawDebugLed(GraphicsContext& context,
@@ -237,7 +225,6 @@
     context.fillRect(ledRect, color);
 }
 
-#if USE(ACCELERATED_COMPOSITING)
 static void drawDebugBorder(GraphicsContext& context,
                             const IntRect& rect,
                             const Color& color,
@@ -252,10 +239,8 @@
     context.fillRect(FloatRect(x, y, width, h), color);
     context.fillRect(FloatRect(x + w - width, y, width, h), color);
 }
-#endif
 
 void WebPage::prePaint() {
-#if USE(ACCELERATED_COMPOSITING)
     if (m_rootLayer) {
         if (m_syncLayers) {
             m_syncLayers = false;
@@ -263,7 +248,6 @@
         }
         return;
     }
-#endif
 
     Frame* mainFrame = (Frame*)&m_page->mainFrame();
     FrameView* frameView = mainFrame->view();
@@ -283,11 +267,9 @@
 
 void WebPage::paint(jobject rq, jint x, jint y, jint w, jint h)
 {
-#if USE(ACCELERATED_COMPOSITING)
     if (m_rootLayer) {
         return;
     }
-#endif
 
     DBG_CHECKPOINTEX("twkUpdateContent", 15, 100);
 
@@ -316,9 +298,7 @@
 void WebPage::postPaint(jobject rq, jint x, jint y, jint w, jint h)
 {
     if (!m_page->inspectorController().highlightedNode()
-#if USE(ACCELERATED_COMPOSITING)
             && !m_rootLayer
-#endif
     ) {
         return;
     }
@@ -327,8 +307,11 @@
     PlatformContextJava* ppgc = new PlatformContextJava(rq, jRenderTheme());
     GraphicsContext gc(ppgc);
 
-#if USE(ACCELERATED_COMPOSITING)
     if (m_rootLayer) {
+        if (m_syncLayers) {
+            m_syncLayers = false;
+            syncLayers();
+        }
         renderCompositedLayers(gc, IntRect(x, y, w, h));
         if (m_page->settings().showDebugBorders()) {
             drawDebugLed(gc, IntRect(x, y, w, h), Color(0, 192, 0, 128));
@@ -337,7 +320,6 @@
             requestJavaRepaint(pageRect());
         }
     }
-#endif
 
     if (m_page->inspectorController().highlightedNode()) {
         m_page->inspectorController().drawHighlight(gc);
@@ -350,12 +332,10 @@
                      const IntRect& rectToScroll,
                      const IntRect& clipRect)
 {
-#if USE(ACCELERATED_COMPOSITING)
     if (m_rootLayer) {
         m_rootLayer->setNeedsDisplayInRect(rectToScroll);
         return;
     }
-#endif
 
     JNIEnv* env = WebCore_GetJavaEnv();
 
@@ -379,11 +359,9 @@
 
 void WebPage::repaint(const IntRect& rect)
 {
-#if USE(ACCELERATED_COMPOSITING)
     if (m_rootLayer) {
         m_rootLayer->setNeedsDisplayInRect(rect);
     }
-#endif
     requestJavaRepaint(rect);
 }
 
@@ -407,11 +385,10 @@
     CheckAndClearException(env);
 }
 
-#if USE(ACCELERATED_COMPOSITING)
 void WebPage::setRootChildLayer(GraphicsLayer* layer)
 {
     if (layer) {
-        m_rootLayer = adoptPtr(GraphicsLayer::create(nullptr, this).release());
+        m_rootLayer = GraphicsLayer::create(nullptr, *this);
         m_rootLayer->setDrawsContent(true);
         m_rootLayer->setContentsOpaque(true);
         m_rootLayer->setSize(pageRect().size());
@@ -451,16 +428,18 @@
         return;
     }
 
-    ((Frame*)&m_page->mainFrame())->view()->updateLayoutAndStyleIfNeededRecursive();
+    FrameView* frameView = m_page->mainFrame().view();
+    if (!m_page->mainFrame().contentRenderer() || !frameView)
+        return;
 
+    frameView->updateLayoutAndStyleIfNeededRecursive();
     // Updating layout might have taken us out of compositing mode
     if (m_rootLayer) {
         m_rootLayer->flushCompositingStateForThisLayerOnly();
-                    //syncCompositingStateForThisLayerOnly();
     }
 
-    ((Frame*)&m_page->mainFrame())->view()->flushCompositingStateIncludingSubframes();
-                                //syncCompositingStateIncludingSubframes();
+    if (!frameView->flushCompositingStateIncludingSubframes())
+        return;
 }
 
 IntRect WebPage::pageRect()
@@ -474,23 +453,20 @@
     ASSERT(m_rootLayer);
     ASSERT(m_textureMapper);
 
-    TextureMapperLayer rootTextureMapperLayer = downcast<GraphicsLayerTextureMapper>(m_rootLayer.get())->layer();
+    TextureMapperLayer& rootTextureMapperLayer = downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer();
 
-    m_textureMapper.setGraphicsContext(&context);
-    m_textureMapper.setImageInterpolationQuality(context.imageInterpolationQuality());
-    m_textureMapper.setTextDrawingMode(context.textDrawingMode());
+    downcast<TextureMapperJava>(*m_textureMapper).setGraphicsContext(&context);
     TransformationMatrix matrix;
-    rootTextureMapperLayer.setTransform(matrix);
-    m_textureMapper.beginPainting();
-    m_textureMapper.beginClip(matrix, clip);
-    //rootTextureMapperLayer.syncAnimationsRecursive();
+    m_textureMapper->beginPainting();
+    m_textureMapper->beginClip(matrix, clip);
     rootTextureMapperLayer.applyAnimationsRecursively();
+    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers();
     rootTextureMapperLayer.paint();
-    m_textureMapper.endClip();
-    m_textureMapper.endPainting();
+    m_textureMapper->endClip();
+    m_textureMapper->endPainting();
 }
 
-void WebPage::notifyAnimationStarted(const GraphicsLayer*, double)
+void WebPage::notifyAnimationStarted(const GraphicsLayer*, const String& /*animationKey*/, double /*time*/)
 {
     ASSERT_NOT_REACHED();
 }
@@ -503,29 +479,18 @@
 void WebPage::paintContents(const GraphicsLayer*,
                             GraphicsContext& context,
                             GraphicsLayerPaintingPhase,
-                            const FloatRect& inClip)
+                            const FloatRect& inClip,
+                            GraphicsLayerPaintBehavior)
 {
     context.save();
     context.clip(inClip);
-    ((Frame*)&m_page->mainFrame())->view()->paint(&context, roundedIntRect(inClip));
+    m_page->mainFrame().view()->paint(context, enclosingIntRect(inClip));
     if (m_page->settings().showDebugBorders()) {
         drawDebugBorder(context, roundedIntRect(inClip), Color(0, 192, 0), 20);
     }
     context.restore();
 }
 
-bool WebPage::showDebugBorders(const GraphicsLayer*) const
-{
-    return m_page->settings().showDebugBorders();
-}
-
-bool WebPage::showRepaintCounter(const GraphicsLayer*) const
-{
-    return m_page->settings().showRepaintCounter();
-}
-
-#endif // USE(ACCELERATED_COMPOSITING)
-
 bool WebPage::processKeyEvent(const PlatformKeyboardEvent& event)
 {
     return event.type() == PlatformKeyboardEvent::Char
@@ -886,6 +851,7 @@
 
 bool s_useJIT;
 bool s_useDFGJIT;
+bool s_useCSS3D;
 
 }  // namespace
 
@@ -894,9 +860,10 @@
 #endif
 
 JNIEXPORT void JNICALL Java_com_sun_webkit_WebPage_twkInitWebCore
-    (JNIEnv* env, jclass self, jboolean useJIT, jboolean useDFGJIT) {
+    (JNIEnv* env, jclass self, jboolean useJIT, jboolean useDFGJIT, jboolean useCSS3D) {
     s_useJIT = useJIT;
     s_useDFGJIT = useDFGJIT;
+    s_useCSS3D = useCSS3D;
 }
 
 JNIEXPORT jlong JNICALL Java_com_sun_webkit_WebPage_twkCreatePage
@@ -973,8 +940,7 @@
     settings.setLoadsImagesAutomatically(true);
     settings.setMinimumFontSize(0);
     settings.setMinimumLogicalFontSize(5);
-    // FIXME(arunprsad): Will be addressed in JDK-8148129.
-    settings.setAcceleratedCompositingEnabled(false);
+    settings.setAcceleratedCompositingEnabled(s_useCSS3D);
     settings.setScriptEnabled(true);
     settings.setJavaScriptCanOpenWindowsAutomatically(true);
     settings.setPluginsEnabled(usePlugins);
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/java/WebPage.h	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/java/WebPage.h	Wed Sep 05 21:44:47 2018 +0530
@@ -25,10 +25,7 @@
 
 #pragma once
 
-#if USE(ACCELERATED_COMPOSITING)
-#include <UnicodeJava.h>
 #include "GraphicsLayerClient.h"
-#endif
 #include "IntRect.h"
 #include "PrintContext.h"
 #include "RQRef.h"
@@ -51,9 +48,7 @@
 class TextureMapper;
 
 class WebPage
-#if USE(ACCELERATED_COMPOSITING)
     : GraphicsLayerClient
-#endif
 {
 public:
     WebPage(std::unique_ptr<Page> page);
@@ -97,11 +92,9 @@
     int beginPrinting(float width, float height);
     void print(GraphicsContext& gc, int pageIndex, float pageWidth);
     void endPrinting();
-#if USE(ACCELERATED_COMPOSITING)
     void setRootChildLayer(GraphicsLayer*);
     void setNeedsOneShotDrawingSynchronization();
     void scheduleCompositingLayerSync();
-#endif
     void debugStarted();
     void debugEnded();
     void enableWatchdog();
@@ -111,22 +104,19 @@
 
 private:
     void requestJavaRepaint(const IntRect&);
-#if USE(ACCELERATED_COMPOSITING)
     void markForSync();
     void syncLayers();
     IntRect pageRect();
     void renderCompositedLayers(GraphicsContext&, const IntRect&);
 
     // GraphicsLayerClient
-    virtual void notifyAnimationStarted(const GraphicsLayer*, double);
-    virtual void notifyFlushRequired(const GraphicsLayer*);
-    virtual void paintContents(const GraphicsLayer*,
-                               GraphicsContext&,
-                               GraphicsLayerPaintingPhase,
-                               const FloatRect&);
-    virtual bool showDebugBorders(const GraphicsLayer*) const;
-    virtual bool showRepaintCounter(const GraphicsLayer*) const;
-#endif
+    void notifyAnimationStarted(const GraphicsLayer*, const String& /*animationKey*/, double /*time*/) override;
+    void notifyFlushRequired(const GraphicsLayer*) override;
+    void paintContents(const GraphicsLayer*,
+                       GraphicsContext&,
+                       GraphicsLayerPaintingPhase,
+                       const FloatRect&,
+                       GraphicsLayerPaintBehavior) override;
 
     bool keyEvent(const PlatformKeyboardEvent& event);
     bool charEvent(const PlatformKeyboardEvent& event);
@@ -144,19 +134,17 @@
     std::unique_ptr<PrintContext> m_printContext;
     RefPtr<RQRef> m_jRenderTheme;
 
-#if USE(ACCELERATED_COMPOSITING)
     std::unique_ptr<GraphicsLayer> m_rootLayer;
     std::unique_ptr<TextureMapper> m_textureMapper;
-    bool m_syncLayers;
-#endif
+    bool m_syncLayers { false };
 
     // Webkit expects keyPress events to be suppressed if the associated keyDown
     // event was handled. Safari implements this behavior by peeking out the
     // associated WM_CHAR event if the keydown was handled. We emulate
     // this behavior by setting this flag if the keyDown was handled.
-    bool m_suppressNextKeypressEvent;
+    bool m_suppressNextKeypressEvent { false };
 
-    bool m_isDebugging;
+    bool m_isDebugging { false };
     static int globalDebugSessionCounter;
 };
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/rendering/RenderLayerCompositor.cpp	Tue Sep 04 20:13:06 2018 +0200
+++ b/modules/javafx.web/src/main/native/Source/WebCore/rendering/RenderLayerCompositor.cpp	Wed Sep 05 21:44:47 2018 +0530
@@ -2817,7 +2817,12 @@
 
 float RenderLayerCompositor::deviceScaleFactor() const
 {
+#if PLATFORM(JAVA)
+    // Java port does device scale factor in the lower level.
+    return GraphicsLayerClient::deviceScaleFactor();
+#else
     return m_renderView.document().deviceScaleFactor();
+#endif
 }
 
 float RenderLayerCompositor::pageScaleFactor() const