From 352be48caa164460eea7d5c500560154be57117a Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:38:22 +0000 Subject: [PATCH] 2003/09/27 07:08:02 darcs-hash:20040130073822-2ba56-146a5defef9e4582ef1ff09f725a033ceacd21a3.gz --- src/org/xwt/Surface.java | 5 +++-- src/org/xwt/VectorGraphics.java | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/org/xwt/Surface.java b/src/org/xwt/Surface.java index 6ed2377..e4cf92d 100644 --- a/src/org/xwt/Surface.java +++ b/src/org/xwt/Surface.java @@ -284,6 +284,8 @@ public abstract class Surface extends PixelBuffer { Refresh(); } + private static VectorGraphics.Affine identity = VectorGraphics.Affine.identity(); + /** runs the prerender() and render() pipelines in the root Box to regenerate the backbuffer, then blits it to the screen */ public synchronized void render() { @@ -309,7 +311,7 @@ public abstract class Surface extends PixelBuffer { if (y+h > root.height) h = root.height - y; if (w <= 0 || h <= 0) continue; - root.render(0, 0, x, y, w, h, this); + root.render(0, 0, x, y, w, h, this, identity); if (abort) { @@ -326,7 +328,6 @@ public abstract class Surface extends PixelBuffer { return; } } - } // FEATURE: reinstate recycler diff --git a/src/org/xwt/VectorGraphics.java b/src/org/xwt/VectorGraphics.java index fc19ba4..e028caa 100644 --- a/src/org/xwt/VectorGraphics.java +++ b/src/org/xwt/VectorGraphics.java @@ -20,7 +20,7 @@ import java.util.*; - mitre (hard) - bevel (easy) - bump (easy, but requires 'round' Paint) - - subtree sharing? otherwise the memory consumption might be outrageous... clone="" attribute? + - subtree sharing? otherwise the memory consumption might be outrageous... clone="" attribute? - better clipping - intersect clip regions (linearity) - clip on trapezoids, not pixels @@ -191,6 +191,20 @@ public final class VectorGraphics { static final byte TYPE_CUBIC = 3; static final byte TYPE_QUADRADIC = 4; + // FEATURE: make this faster and cache it; also deal with negative coordinates + public int boundingBoxWidth() { + int ret = 0; + for(int i=0; i