FileDocCategorySizeDatePackage
MultiRectAreaOp.javaAPI DocAndroid 1.5 API27802Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.gl

MultiRectAreaOp

public class MultiRectAreaOp extends Object
author
Denis M. Kishenko
version
$Revision$

Fields Summary
public static final int
RECT_CAPACITY
Rectangle buffer capacity
private static final int
MAX_SIMPLE
If number of rectangle in MultiRectArea object less than MAX_SIMPLE simple algorithm applies
Constructors Summary
Methods Summary
public static int[]checkBufSize(int[] buf, int capacity)
Checks buffer size and reallocate if necessary

        if (buf[0] + capacity >= buf.length) {
            int length = buf[0] + (capacity > RECT_CAPACITY ? capacity : RECT_CAPACITY);
            int[] tmp = new int[length];
            System.arraycopy(buf, 0, tmp, 0, buf[0]);
            buf = tmp;
        }
        buf[0] += capacity;
        return buf;
    
public static int[]createBuf(int capacity)
Create buffer


           
         
        if (capacity == 0) {
            capacity = RECT_CAPACITY;
        }
        int[] buf = new int[capacity];
        buf[0] = 1;
        return buf;