public final class DirtyRegionContainer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private RectBounds[] |
dirtyRegions |
static int |
DTR_CONTAINS_CLIP |
static int |
DTR_OK |
private int |
emptyIndex |
private int[][] |
heap
Shared for all compressing algorithms
|
private int |
heapSize |
private long |
invalidMask |
Constructor and Description |
---|
DirtyRegionContainer(int count) |
Modifier and Type | Method and Description |
---|---|
void |
addDirtyRegion(RectBounds region)
Adds new dirty region to the array.
|
boolean |
checkAndClearRegion(int index) |
private void |
compress_heap()
Heap-based compressing algorithm
|
private RectBounds |
compress(RectBounds region) |
DirtyRegionContainer |
copy() |
DirtyRegionContainer |
deriveWithNewContainer(DirtyRegionContainer other) |
DirtyRegionContainer |
deriveWithNewRegion(RectBounds region) |
DirtyRegionContainer |
deriveWithNewRegions(RectBounds[] regions) |
boolean |
equals(java.lang.Object obj) |
RectBounds |
getDirtyRegion(int index)
Gets the dirty region at given index.
|
void |
grow(int horizontal,
int vertical) |
int |
hashCode() |
private boolean |
hasSpace()
If there are empty regions in the dirty regions array.
|
private void |
heapCompress() |
private void |
heapify() |
private void |
initDirtyRegions(int count) |
int |
maxSpace() |
void |
merge(DirtyRegionContainer other) |
private void |
regioncopy(RectBounds[] src,
int from,
RectBounds[] dest,
int to,
int length) |
void |
reset() |
private int |
resolveMap(int[] map,
int idx) |
void |
roundOut() |
void |
setDirtyRegion(int index,
RectBounds region) |
private void |
siftDown(int i) |
int |
size() |
private int[] |
takeMin() |
private int[] |
takeMinWithMap(int[] map) |
java.lang.String |
toString() |
private int |
unifiedRegionArea(int i0,
int i1) |
public static final int DTR_OK
public static final int DTR_CONTAINS_CLIP
private RectBounds[] dirtyRegions
private int emptyIndex
private int[][] heap
private int heapSize
private long invalidMask
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public DirtyRegionContainer deriveWithNewRegion(RectBounds region)
public DirtyRegionContainer deriveWithNewRegions(RectBounds[] regions)
public DirtyRegionContainer deriveWithNewContainer(DirtyRegionContainer other)
private void initDirtyRegions(int count)
public DirtyRegionContainer copy()
public int maxSpace()
public RectBounds getDirtyRegion(int index)
index
- the index of requested dirty regionpublic void setDirtyRegion(int index, RectBounds region)
public void addDirtyRegion(RectBounds region)
region
- the dirty region.public void merge(DirtyRegionContainer other)
public int size()
public void reset()
private RectBounds compress(RectBounds region)
private boolean hasSpace()
private void regioncopy(RectBounds[] src, int from, RectBounds[] dest, int to, int length)
public boolean checkAndClearRegion(int index)
public void grow(int horizontal, int vertical)
public void roundOut()
public java.lang.String toString()
toString
in class java.lang.Object
private void heapCompress()
private void heapify()
private void siftDown(int i)
private int[] takeMinWithMap(int[] map)
private int[] takeMin()
private int resolveMap(int[] map, int idx)
private int unifiedRegionArea(int i0, int i1)
private void compress_heap()