You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2006/05/04 09:24:21 UTC

svn commit: r399582 - in /xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl: PCLGraphics2D.java PCLGraphics2DAdapter.java PCLRendererContext.java

Author: jeremias
Date: Thu May  4 00:24:18 2006
New Revision: 399582

URL: http://svn.apache.org/viewcvs?rev=399582&view=rev
Log:
fox:disable-clipping on the i-f-o or e-g can be used to perform more painting operations natively in the HP GL/2 space. Since HP GL/2 provides only limited clipping functionality (which is not supported, yet) and the PCLGraphics2D fails with an UnsupportedException if it encounters an unsupported painting operation, every SVG graphic ends up being painted as a bitmap. This setting can help avoid that. Of course, I have yet to implement the IW (InputWindow, used for rectangular clipping) command.

Modified:
    xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java
    xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java
    xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java

Modified: xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java?rev=399582&r1=399581&r2=399582&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java Thu May  4 00:24:18 2006
@@ -95,6 +95,14 @@
     }
 
     /**
+     * Allows to disable all clipping operations.
+     * @param value true if clipping should be disabled.
+     */
+    public void setClippingDisabled(boolean value) {
+        this.clippingDisabled = value;
+    }
+    
+    /**
      * Central handler for IOExceptions for this class.
      * @param ioe IOException to handle
      */

Modified: xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java?rev=399582&r1=399581&r2=399582&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java Thu May  4 00:24:18 2006
@@ -74,6 +74,7 @@
 
                 PCLGraphics2D graphics = new PCLGraphics2D(tempGen);
                 graphics.setGraphicContext(ctx);
+                graphics.setClippingDisabled(pclContext.isClippingDisabled());
                 Rectangle2D area = new Rectangle2D.Double(0.0, 0.0, imw, imh);
                 painter.paint(graphics, area);
                 

Modified: xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java?rev=399582&r1=399581&r2=399582&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java (original)
+++ xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java Thu May  4 00:24:18 2006
@@ -18,9 +18,6 @@
 
 package org.apache.fop.render.pcl;
 
-import java.util.Map;
-
-import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
 import org.apache.fop.render.RendererContext;
 import org.apache.fop.util.QName;
@@ -54,7 +51,15 @@
     public boolean paintAsBitmap() {
         QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
         return getForeignAttributes() != null 
-             && "bitmap".equals(getForeignAttributes().get(qName));
+             && "bitmap".equalsIgnoreCase((String)getForeignAttributes().get(qName));
     }
+    
+    /** @return true if clipping is disabled inside the PCLGraphics2D. */
+    public boolean isClippingDisabled() {
+        QName qName = new QName(ExtensionElementMapping.URI, null, "disable-clipping");
+        return getForeignAttributes() != null 
+             && "true".equalsIgnoreCase((String)getForeignAttributes().get(qName));
+    }
+    
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org