aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-05-04 07:24:18 +0000
committerJeremias Maerki <jeremias@apache.org>2006-05-04 07:24:18 +0000
commit956c6ac30199e427442ccd7ac829cb2d78cce856 (patch)
tree3396f9abe1a2c9669a0990fb436987bee50870ab /src
parentfc3f1a4c0a64e7f5559e30fbd2664900326d8359 (diff)
downloadxmlgraphics-fop-956c6ac30199e427442ccd7ac829cb2d78cce856.tar.gz
xmlgraphics-fop-956c6ac30199e427442ccd7ac829cb2d78cce856.zip
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.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@399582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java8
-rw-r--r--src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java1
-rw-r--r--src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java13
3 files changed, 18 insertions, 4 deletions
diff --git a/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java b/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java
index fe2d6a12a..674b63941 100644
--- a/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java
+++ b/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2D.java
@@ -95,6 +95,14 @@ public class PCLGraphics2D extends AbstractGraphics2D {
}
/**
+ * 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
*/
diff --git a/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java b/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java
index 665eb6d6c..df9fb8589 100644
--- a/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java
+++ b/src/sandbox/org/apache/fop/render/pcl/PCLGraphics2DAdapter.java
@@ -74,6 +74,7 @@ public class PCLGraphics2DAdapter extends AbstractGraphics2DAdapter {
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);
diff --git a/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java b/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java
index 2f77dd4aa..462abfa48 100644
--- a/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java
+++ b/src/sandbox/org/apache/fop/render/pcl/PCLRendererContext.java
@@ -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 class PCLRendererContext extends RendererContext.RendererContextWrapper {
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));
+ }
+
} \ No newline at end of file