/*
* 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.
*/
/**
* The MaskFill operation is expressed as:
* dst = ((src <MODE> dst) * pathA) + (dst * (1 - pathA))
*
* equation because it is not possible to perform such a complex operation in
* shaders and multitexturing). Therefore, the BufferedMaskFill operation
* is expressed as:
* dst = (src * pathA) <SrcOver> dst
*
* This simplified formula is only equivalent to the "true" MaskFill equation
* in the following situations:
* - <MODE> is SrcOver
* - <MODE> is Src, extra alpha == 1.0, and the source paint is opaque
*
* Therefore, we register BufferedMaskFill primitives for only the SurfaceType
* and CompositeType restrictions mentioned above. In addition, for the
* SrcNoEa case we must override the incoming composite with a SrcOver (no
* mode to match the BufferedMaskFill equation.
*/
{
}
final int x, final int y, final int w, final int h,
final byte[] mask,
{
}
try {
// we adjust the mask length so that the mask ends on a
// 4-byte boundary
int maskBytesRequired;
// we adjust the mask length so that the mask ends on a
// 4-byte boundary
} else {
// mask not needed
maskBytesRequired = 0;
}
// process the queue first and then enqueue the mask
}
// enqueue parameters
// enqueue the mask
if (padding != 0) {
}
}
} else {
// queue is too small to accomodate entire mask; perform
// the operation directly on the queue flushing thread
public void run() {
maskFill(x, y, w, h,
}
});
}
} finally {
}
}
/**
* Called as a separate Runnable when the operation is too large to fit
* native implementation of this method.
*/
protected abstract void maskFill(int x, int y, int w, int h,
byte[] mask);
/**
* Validates the state in the provided SunGraphics2D object and sets up
* any special resources for this operation (e.g. enabling gradient
* shading).
*/
}