/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* We render non-antialiased geometry (consisting of rectangles) into a mask,
* which is later used in a composition step.
* To avoid mask-allocations of large size, MaskTileManager splits
* geometry larger than MASK_SIZE into several tiles,
* and stores the geometry in instances of MaskTile.
*
* @author Clemens Eisserer
*/
public class MaskTileManager {
int maskPixmap;
int maskPicture;
long maskGC;
int lineMaskPixmap;
int lineMaskPicture;
long drawLineGC;
long clearLineGC;
}
/**
* Adds a rectangle to the mask.
*/
}
/**
* Adds a line to the mask.
*/
}
/**
* Transfers the geometry stored (rectangles, lines) to one or more masks,
* and renders the result to the destination surface.
*/
if (maskRequired) {
// We don't need tiling if all geometry fits in a single tile
{
} else {
tileRects();
for (int i = 0; i < yTiles; i++) {
for (int m = 0; m < xTiles; m++) {
int tileStartX = m * MASK_SIZE;
int tileStartY = i * MASK_SIZE;
}
}
}
} else {
}
}
/**
*/
float maskAlpha =
} else if (xrMgr.isTexturePaintActive()) {
}
return maskPic;
}
/**
* Clears the area of the mask-pixmap used for uploading aa coverage values.
*/
if (mask == maskPicture) {
}
}
/**
* Renders the rectangles provided to the mask, and does a composition
* operation with the properties set inXRCompositeManager.
*/
boolean maskRequired,
int tileStartX, int tileStartY,
if (maskRequired) {
/*
* Optimization: When the tile only contains one rectangle, the
* composite-operation boundaries can be used as geometry
*/
if (rectCnt > 1) {
mask = maskPicture;
} else {
if (xrMgr.isTexturePaintActive()) {
}
}
x, y, tileDirtyArea.x, tileDirtyArea.y,
/* Clear dirty rectangle of the rect-mask */
if (rectCnt > 1) {
tileDirtyArea.x, tileDirtyArea.y,
}
} else if (rectCnt > 0) {
tileStartY + dirtyArea.y);
}
}
}
/**
* Allocates enough MaskTile instances, to cover the whole
* mask area, or resets existing ones.
*/
if (tileCnt > allocatedTiles) {
for (int i = 0; i < tileCnt; i++) {
if (i < allocatedTiles) {
} else {
}
}
}
}
/**
* Tiles the stored rectangles, if they are larger than the MASK_SIZE
*/
protected void tileRects() {
int tileXLength =
int tileYLength =
for (int n = 0; n < tileYLength; n++) {
for (int m = 0; m < tileXLength; m++) {
int tileIndex =
}
}
}
}
/**
* Limits the rect's coordinates to the mask coordinates. The result is used
* by growDirtyRegion.
*/
}
}
}
}
}
}