本文整理汇总了C++中SurfaceDataOps::Lock方法的典型用法代码示例。如果您正苦于以下问题:C++ SurfaceDataOps::Lock方法的具体用法?C++ SurfaceDataOps::Lock怎么用?C++ SurfaceDataOps::Lock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SurfaceDataOps
的用法示例。
在下文中一共展示了SurfaceDataOps::Lock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawGlyphList
/* since the AA and non-AA loop functions share a common method
* signature, can call both through this common function since
* there's no difference except for the inner loop.
* This could be a macro but there's enough of those already.
*/
static void drawGlyphList(JNIEnv *env, jobject self,
jobject sg2d, jobject sData,
GlyphBlitVector *gbv, jint pixel, jint color,
NativePrimitive *pPrim, DrawGlyphListFunc *func) {
SurfaceDataOps *sdOps;
SurfaceDataRasInfo rasInfo;
CompositeInfo compInfo;
int clipLeft, clipRight, clipTop, clipBottom;
int ret;
sdOps = SurfaceData_GetOps(env, sData);
if (sdOps == 0) {
return;
}
if (pPrim->pCompType->getCompInfo != NULL) {
GrPrim_Sg2dGetCompInfo(env, sg2d, pPrim, &compInfo);
}
GrPrim_Sg2dGetClip(env, sg2d, &rasInfo.bounds);
if (rasInfo.bounds.y2 <= rasInfo.bounds.y1 ||
rasInfo.bounds.x2 <= rasInfo.bounds.x1)
{
return;
}
ret = sdOps->Lock(env, sdOps, &rasInfo, pPrim->dstflags);
if (ret != SD_SUCCESS) {
if (ret == SD_SLOWLOCK) {
if (!RefineBounds(gbv, &rasInfo.bounds)) {
SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
return;
}
} else {
return;
}
}
sdOps->GetRasInfo(env, sdOps, &rasInfo);
if (!rasInfo.rasBase) {
SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
return;
}
clipLeft = rasInfo.bounds.x1;
clipRight = rasInfo.bounds.x2;
clipTop = rasInfo.bounds.y1;
clipBottom = rasInfo.bounds.y2;
if (clipRight > clipLeft && clipBottom > clipTop) {
(*func)(&rasInfo,
gbv->glyphs, gbv->numGlyphs,
pixel, color,
clipLeft, clipTop,
clipRight, clipBottom,
pPrim, &compInfo);
SurfaceData_InvokeRelease(env, sdOps, &rasInfo);
}
SurfaceData_InvokeUnlock(env, sdOps, &rasInfo);
}