本文整理汇总了C++中SurfaceDataOps::GetRasInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ SurfaceDataOps::GetRasInfo方法的具体用法?C++ SurfaceDataOps::GetRasInfo怎么用?C++ SurfaceDataOps::GetRasInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SurfaceDataOps
的用法示例。
在下文中一共展示了SurfaceDataOps::GetRasInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNativePrim
/*
* Class: sun_java2d_loops_MaskBlit
* Method: MaskBlit
* Signature: (Lsun/java2d/SurfaceData;Lsun/java2d/SurfaceData;Ljava/awt/Composite;IIIIII[BII)V
*/
JNIEXPORT void JNICALL
Java_sun_java2d_loops_MaskBlit_MaskBlit
(JNIEnv *env, jobject self,
jobject srcData, jobject dstData, jobject comp, jobject clip,
jint srcx, jint srcy, jint dstx, jint dsty, jint width, jint height,
jbyteArray maskArray, jint maskoff, jint maskscan)
{
SurfaceDataOps *srcOps;
SurfaceDataOps *dstOps;
SurfaceDataRasInfo srcInfo;
SurfaceDataRasInfo dstInfo;
NativePrimitive *pPrim;
CompositeInfo compInfo;
RegionData clipInfo;
pPrim = GetNativePrim(env, self);
if (pPrim == NULL) {
return;
}
if (pPrim->pCompType->getCompInfo != NULL) {
(*pPrim->pCompType->getCompInfo)(env, &compInfo, comp);
}
if (Region_GetInfo(env, clip, &clipInfo)) {
return;
}
srcOps = SurfaceData_GetOps(env, srcData);
dstOps = SurfaceData_GetOps(env, dstData);
if (srcOps == 0 || dstOps == 0) {
return;
}
srcInfo.bounds.x1 = srcx;
srcInfo.bounds.y1 = srcy;
srcInfo.bounds.x2 = srcx + width;
srcInfo.bounds.y2 = srcy + height;
dstInfo.bounds.x1 = dstx;
dstInfo.bounds.y1 = dsty;
dstInfo.bounds.x2 = dstx + width;
dstInfo.bounds.y2 = dsty + height;
srcx -= dstx;
srcy -= dsty;
SurfaceData_IntersectBounds(&dstInfo.bounds, &clipInfo.bounds);
if (srcOps->Lock(env, srcOps, &srcInfo, pPrim->srcflags) != SD_SUCCESS) {
return;
}
if (dstOps->Lock(env, dstOps, &dstInfo, pPrim->dstflags) != SD_SUCCESS) {
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
return;
}
SurfaceData_IntersectBlitBounds(&dstInfo.bounds, &srcInfo.bounds,
srcx, srcy);
Region_IntersectBounds(&clipInfo, &dstInfo.bounds);
if (!Region_IsEmpty(&clipInfo)) {
srcOps->GetRasInfo(env, srcOps, &srcInfo);
dstOps->GetRasInfo(env, dstOps, &dstInfo);
if (srcInfo.rasBase && dstInfo.rasBase) {
SurfaceDataBounds span;
unsigned char *pMask =
(maskArray
? (*env)->GetPrimitiveArrayCritical(env, maskArray, 0)
: 0);
jint savesx = srcInfo.bounds.x1;
jint savedx = dstInfo.bounds.x1;
Region_StartIteration(env, &clipInfo);
while (Region_NextIteration(&clipInfo, &span)) {
void *pSrc = PtrCoord(srcInfo.rasBase,
srcx + span.x1, srcInfo.pixelStride,
srcy + span.y1, srcInfo.scanStride);
void *pDst = PtrCoord(dstInfo.rasBase,
span.x1, dstInfo.pixelStride,
span.y1, dstInfo.scanStride);
maskoff += ((span.y1 - dsty) * maskscan + (span.x1 - dstx));
/*
* Fix for 4804375
* REMIND: There should probably be a better
* way to give the span coordinates to the
* inner loop. This is only really needed
* for the 1, 2, and 4 bit loops.
*/
srcInfo.bounds.x1 = srcx + span.x1;
dstInfo.bounds.x1 = span.x1;
(*pPrim->funcs.maskblit)(pDst, pSrc,
pMask, maskoff, maskscan,
span.x2 - span.x1, span.y2 - span.y1,
&dstInfo, &srcInfo,
pPrim, &compInfo);
}
Region_EndIteration(env, &clipInfo);
if (pMask) {
(*env)->ReleasePrimitiveArrayCritical(env, maskArray,
pMask, JNI_ABORT);
}
srcInfo.bounds.x1 = savesx;
//.........这里部分代码省略.........
示例2: GetNativePrim
//.........这里部分代码省略.........
JNU_ThrowNullPointerException(env, "polygon length array");
return;
}
nPointsLen = (*env)->GetArrayLength(env, nPointsArray);
xPointsLen = (*env)->GetArrayLength(env, xPointsArray);
yPointsLen = (*env)->GetArrayLength(env, yPointsArray);
if (nPointsLen < numPolys) {
JNU_ThrowArrayIndexOutOfBoundsException(env,
"polygon length array size");
return;
}
pPrim = GetNativePrim(env, self);
if (pPrim == NULL) {
return;
}
if (pPrim->pCompType->getCompInfo != NULL) {
GrPrim_Sg2dGetCompInfo(env, sg2d, pPrim, &compInfo);
}
sdOps = SurfaceData_GetOps(env, sData);
if (sdOps == 0) {
return;
}
GrPrim_Sg2dGetClip(env, sg2d, &rasInfo.bounds);
ret = sdOps->Lock(env, sdOps, &rasInfo, SD_LOCK_FASTEST | pPrim->dstflags);
if (ret == SD_FAILURE) {
return;
}
nPointsPtr = (*env)->GetPrimitiveArrayCritical(env, nPointsArray, NULL);
if (!nPointsPtr) {
ok = JNI_FALSE;
}
if (ok) {
pointsNeeded = 0;
for (i = 0; i < numPolys; i++) {
if (nPointsPtr[i] > 0) {
pointsNeeded += nPointsPtr[i];
}
}
if (yPointsLen < pointsNeeded || xPointsLen < pointsNeeded) {
(*env)->ReleasePrimitiveArrayCritical(env, nPointsArray,
nPointsPtr, JNI_ABORT);
SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
JNU_ThrowArrayIndexOutOfBoundsException(env,
"coordinate array length");
return;
}
xPointsPtr = (*env)->GetPrimitiveArrayCritical(env, xPointsArray, NULL);
yPointsPtr = (*env)->GetPrimitiveArrayCritical(env, yPointsArray, NULL);
if (!xPointsPtr || !yPointsPtr) {
ok = JNI_FALSE;
}
}
if (ok) {
if (ret == SD_SLOWLOCK) {
RefineBounds(&rasInfo.bounds, transX, transY,
xPointsPtr, yPointsPtr, pointsNeeded);
ok = (rasInfo.bounds.x2 > rasInfo.bounds.x1 &&
rasInfo.bounds.y2 > rasInfo.bounds.y1);
}
}
if (ok) {
sdOps->GetRasInfo(env, sdOps, &rasInfo);
if (rasInfo.rasBase &&
rasInfo.bounds.x2 > rasInfo.bounds.x1 &&
rasInfo.bounds.y2 > rasInfo.bounds.y1)
{
ProcessPoly(&rasInfo, pPrim->funcs.drawline, pPrim, &compInfo,
pixel, transX, transY,
xPointsPtr, yPointsPtr,
nPointsPtr, numPolys,
close);
}
SurfaceData_InvokeRelease(env, sdOps, &rasInfo);
}
if (nPointsPtr) {
(*env)->ReleasePrimitiveArrayCritical(env, nPointsArray,
nPointsPtr, JNI_ABORT);
}
if (xPointsPtr) {
(*env)->ReleasePrimitiveArrayCritical(env, xPointsArray,
xPointsPtr, JNI_ABORT);
}
if (yPointsPtr) {
(*env)->ReleasePrimitiveArrayCritical(env, yPointsArray,
yPointsPtr, JNI_ABORT);
}
SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
}
示例3: GetNativePrim
/*
* Class: sun_java2d_loops_FillPath
* Method: FillPath
* Signature: (Lsun/java2d/SunGraphics2D;Lsun/java2d/SurfaceData;IILjava/awt/geom/Path2D.Float;)V
*/
JNIEXPORT void JNICALL Java_sun_java2d_loops_FillPath_FillPath
(JNIEnv *env, jobject self,
jobject sg2d, jobject sData,
jint transX, jint transY, jobject p2df)
{
jarray typesArray;
jarray coordsArray;
jint numTypes;
jint fillRule;
jboolean ok = JNI_TRUE;
jint pixel = GrPrim_Sg2dGetPixel(env, sg2d);
jint maxCoords;
jfloat *coords;
SurfaceDataOps *sdOps;
SurfaceDataRasInfo rasInfo;
CompositeInfo compInfo;
jint ret;
NativePrimitive *pPrim = GetNativePrim(env, self);
jint stroke = (*env)->GetIntField(env, sg2d, sg2dStrokeHintID);
if (pPrim == NULL) {
return;
}
if (pPrim->pCompType->getCompInfo != NULL) {
GrPrim_Sg2dGetCompInfo(env, sg2d, pPrim, &compInfo);
}
sdOps = SurfaceData_GetOps(env, sData);
if (sdOps == 0) {
return;
}
typesArray = (jarray)(*env)->GetObjectField(env, p2df, path2DTypesID);
coordsArray = (jarray)(*env)->GetObjectField(env, p2df,
path2DFloatCoordsID);
if (coordsArray == NULL) {
JNU_ThrowNullPointerException(env, "coordinates array");
return;
}
numTypes = (*env)->GetIntField(env, p2df, path2DNumTypesID);
fillRule = (*env)->GetIntField(env, p2df, path2DWindingRuleID);
if ((*env)->GetArrayLength(env, typesArray) < numTypes) {
JNU_ThrowArrayIndexOutOfBoundsException(env, "types array");
return;
}
GrPrim_Sg2dGetClip(env, sg2d, &rasInfo.bounds);
ret = sdOps->Lock(env, sdOps, &rasInfo, SD_LOCK_FASTEST | pPrim->dstflags);
if (ret == SD_FAILURE) {
return;
}
maxCoords = (*env)->GetArrayLength(env, coordsArray);
coords = (jfloat*)(*env)->GetPrimitiveArrayCritical(
env, coordsArray, NULL);
if (ret == SD_SLOWLOCK) {
GrPrim_RefineBounds(&rasInfo.bounds, transX, transY,
coords, maxCoords);
ok = (rasInfo.bounds.x2 > rasInfo.bounds.x1 &&
rasInfo.bounds.y2 > rasInfo.bounds.y1);
}
if (ok) {
sdOps->GetRasInfo(env, sdOps, &rasInfo);
if (rasInfo.rasBase) {
if (rasInfo.bounds.x2 > rasInfo.bounds.x1 &&
rasInfo.bounds.y2 > rasInfo.bounds.y1)
{
DrawHandlerData dHData;
DrawHandler drawHandler = {
NULL,
NULL,
&drawScanline,
0, 0, 0, 0,
0, 0, 0, 0,
NULL
};
jbyte *types = (jbyte*)(*env)->GetPrimitiveArrayCritical(
env, typesArray, NULL);
/* Initialization of the following fields in the declaration of
* the dHData and drawHandler above causes warnings on sun
* studio compiler with
* -xc99=%none option applied (this option means compliance
* with C90 standard instead of C99)
*/
dHData.pRasInfo = &rasInfo;
dHData.pixel = pixel;
dHData.pPrim = pPrim;
dHData.pCompInfo = &compInfo;
drawHandler.xMin = rasInfo.bounds.x1;
//.........这里部分代码省略.........
示例4: PtrCoord
/**
* This implementation of MaskBlit first combines the source system memory
* tile with the corresponding alpha mask and stores the resulting
* IntArgbPre pixels directly into the RenderBuffer. Those pixels are
* then eventually pulled off the RenderBuffer and copied to the destination
* surface in OGL/D3DMaskBlit.
*
* Note that currently there are only inner loops defined for IntArgb,
* IntArgbPre, IntRgb, and IntBgr, as those are the most commonly used
* formats for this operation.
*/
JNIEXPORT jint JNICALL
Java_sun_java2d_pipe_BufferedMaskBlit_enqueueTile
(JNIEnv *env, jobject mb,
jlong buf, jint bpos,
jobject srcData, jlong pSrcOps, jint srcType,
jbyteArray maskArray, jint masklen, jint maskoff, jint maskscan,
jint srcx, jint srcy, jint dstx, jint dsty,
jint width, jint height)
{
SurfaceDataOps *srcOps = (SurfaceDataOps *)jlong_to_ptr(pSrcOps);
SurfaceDataRasInfo srcInfo;
unsigned char *pMask;
unsigned char *bbuf;
jint *pBuf;
J2dTraceLn1(J2D_TRACE_INFO,
"BufferedMaskBlit_enqueueTile: bpos=%d",
bpos);
if (srcOps == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"BufferedMaskBlit_enqueueTile: srcOps is null");
return bpos;
}
bbuf = (unsigned char *)jlong_to_ptr(buf);
if (bbuf == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"BufferedMaskBlit_enqueueTile: cannot get direct buffer address");
return bpos;
}
pBuf = (jint *)(bbuf + bpos);
if (JNU_IsNull(env, maskArray)) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"BufferedMaskBlit_enqueueTile: mask array is null");
return bpos;
}
if (masklen > MAX_MASK_LENGTH) {
// REMIND: this approach is seriously flawed if the mask
// length is ever greater than MAX_MASK_LENGTH (won't fit
// into the cached mask tile); so far this hasn't
// been a problem though...
J2dRlsTraceLn(J2D_TRACE_ERROR,
"BufferedMaskBlit_enqueueTile: mask array too large");
return bpos;
}
pMask = (*env)->GetPrimitiveArrayCritical(env, maskArray, 0);
if (pMask == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"BufferedMaskBlit_enqueueTile: cannot lock mask array");
return bpos;
}
srcInfo.bounds.x1 = srcx;
srcInfo.bounds.y1 = srcy;
srcInfo.bounds.x2 = srcx + width;
srcInfo.bounds.y2 = srcy + height;
if (srcOps->Lock(env, srcOps, &srcInfo, SD_LOCK_READ) != SD_SUCCESS) {
J2dRlsTraceLn(J2D_TRACE_WARNING,
"BufferedMaskBlit_enqueueTile: could not acquire lock");
(*env)->ReleasePrimitiveArrayCritical(env, maskArray,
pMask, JNI_ABORT);
return bpos;
}
if (srcInfo.bounds.x2 > srcInfo.bounds.x1 &&
srcInfo.bounds.y2 > srcInfo.bounds.y1)
{
srcOps->GetRasInfo(env, srcOps, &srcInfo);
if (srcInfo.rasBase) {
jint h;
jint srcScanStride = srcInfo.scanStride;
jint srcPixelStride = srcInfo.pixelStride;
jint *pSrc = (jint *)
PtrCoord(srcInfo.rasBase,
srcInfo.bounds.x1, srcInfo.pixelStride,
srcInfo.bounds.y1, srcInfo.scanStride);
width = srcInfo.bounds.x2 - srcInfo.bounds.x1;
height = srcInfo.bounds.y2 - srcInfo.bounds.y1;
maskoff += ((srcInfo.bounds.y1 - srcy) * maskscan +
(srcInfo.bounds.x1 - srcx));
maskscan -= width;
pMask += maskoff;
srcScanStride -= width * srcPixelStride;
//.........这里部分代码省略.........
示例5: if
//.........这里部分代码省略.........
dstInfo.bounds.x1 = dx1;
dstInfo.bounds.y1 = dy1;
dstInfo.bounds.x2 = dx2;
dstInfo.bounds.y2 = dy2;
SurfaceData_IntersectBounds(&dstInfo.bounds, &clipInfo.bounds);
if (srcOps->Lock(env, srcOps, &srcInfo, pHelperPrim->srcflags)
!= SD_SUCCESS)
{
return;
}
if (dstOps->Lock(env, dstOps, &dstInfo, pMaskBlitPrim->dstflags)
!= SD_SUCCESS)
{
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
return;
}
Region_IntersectBounds(&clipInfo, &dstInfo.bounds);
Transform_GetInfo(env, itxform, &itxInfo);
dxdxlong = DblToLong(itxInfo.dxdx);
dydxlong = DblToLong(itxInfo.dydx);
dxdylong = DblToLong(itxInfo.dxdy);
dydylong = DblToLong(itxInfo.dydy);
x = dxoff+dstInfo.bounds.x1+0.5; /* Center of pixel x1 */
y = dyoff+dstInfo.bounds.y1+0.5; /* Center of pixel y1 */
Transform_transform(&itxInfo, &x, &y);
xbase = DblToLong(x);
ybase = DblToLong(y);
pEdges = calculateEdges(edgebuf, &dstInfo.bounds, &itxInfo,
xbase, ybase, sx2-sx1, sy2-sy1);
if (!Region_IsEmpty(&clipInfo)) {
srcOps->GetRasInfo(env, srcOps, &srcInfo);
dstOps->GetRasInfo(env, dstOps, &dstInfo);
if (srcInfo.rasBase && dstInfo.rasBase) {
union {
jlong align;
jint data[LINE_SIZE];
} rgb;
SurfaceDataBounds span;
Region_StartIteration(env, &clipInfo);
while (Region_NextIteration(&clipInfo, &span)) {
jlong rowxlong, rowylong;
void *pDst;
dy1 = span.y1;
dy2 = span.y2;
rowxlong = xbase + (dy1 - dstInfo.bounds.y1) * dxdylong;
rowylong = ybase + (dy1 - dstInfo.bounds.y1) * dydylong;
while (dy1 < dy2) {
jlong xlong, ylong;
/* Note - process at most one scanline at a time. */
dx1 = pEdges[(dy1 - dstInfo.bounds.y1) * 2];
dx2 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 1];
if (dx1 < span.x1) dx1 = span.x1;
if (dx2 > span.x2) dx2 = span.x2;
/* All pixels from dx1 to dx2 have centers in bounds */
while (dx1 < dx2) {
/* Can process at most one buffer full at a time */
jint numpix = dx2 - dx1;