当前位置: 首页>>代码示例>>C++>>正文


C++ SurfaceDataOps::Lock方法代码示例

本文整理汇总了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);
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:66,代码来源:DrawGlyphList.c


注:本文中的SurfaceDataOps::Lock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。