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


C++ J2dTraceLn1函数代码示例

本文整理汇总了C++中J2dTraceLn1函数的典型用法代码示例。如果您正苦于以下问题:C++ J2dTraceLn1函数的具体用法?C++ J2dTraceLn1怎么用?C++ J2dTraceLn1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了J2dTraceLn1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OGLSD_Flush

/**
 * Disposes of all native resources associated with this surface.
 */
void
OGLSD_Flush(JNIEnv *env, OGLSDOps *oglsdo)
{
    J2dTraceLn1(J2D_TRACE_INFO, "OGLSD_Flush: type=%d",
                oglsdo->drawableType);

    if (oglsdo->drawableType == OGLSD_TEXTURE) {
        if (oglsdo->textureID != 0) {
            j2d_glDeleteTextures(1, &oglsdo->textureID);
            oglsdo->textureID = 0;
        }
    } else if (oglsdo->drawableType == OGLSD_FBOBJECT) {
        if (oglsdo->textureID != 0) {
            j2d_glDeleteTextures(1, &oglsdo->textureID);
            oglsdo->textureID = 0;
        }
        if (oglsdo->depthID != 0) {
            j2d_glDeleteRenderbuffersEXT(1, &oglsdo->depthID);
            oglsdo->depthID = 0;
        }
        if (oglsdo->fbobjectID != 0) {
            j2d_glDeleteFramebuffersEXT(1, &oglsdo->fbobjectID);
            oglsdo->fbobjectID = 0;
        }
    } else {
        // dispose windowing system resources (pbuffer, pixmap, etc)
        OGLSD_DestroyOGLSurface(env, oglsdo);
    }
}
开发者ID:cncomkyle,项目名称:openjdk_7_b147,代码行数:32,代码来源:OGLSurfaceData.c

示例2: OGLPaints_ResetPaint

void
OGLPaints_ResetPaint(OGLContext *oglc)
{
    jubyte ea;

    J2dTraceLn(J2D_TRACE_INFO, "OGLPaints_ResetPaint");

    RETURN_IF_NULL(oglc);
    J2dTraceLn1(J2D_TRACE_VERBOSE, "  state=%d", oglc->paintState);
    RESET_PREVIOUS_OP();

    if (oglc->useMask) {
        // switch to texture unit 1, where paint state is currently enabled
        j2d_glActiveTextureARB(GL_TEXTURE1_ARB);
    }

    switch (oglc->paintState) {
    case sun_java2d_SunGraphics2D_PAINT_GRADIENT:
        j2d_glDisable(GL_TEXTURE_1D);
        j2d_glDisable(GL_TEXTURE_GEN_S);
        break;

    case sun_java2d_SunGraphics2D_PAINT_TEXTURE:
        // Note: The texture object used in SetTexturePaint() will
        // still be bound at this point, so it is safe to call the following.
        OGLSD_RESET_TEXTURE_WRAP(GL_TEXTURE_2D);
        j2d_glDisable(GL_TEXTURE_2D);
        j2d_glDisable(GL_TEXTURE_GEN_S);
        j2d_glDisable(GL_TEXTURE_GEN_T);
        break;

    case sun_java2d_SunGraphics2D_PAINT_LIN_GRADIENT:
    case sun_java2d_SunGraphics2D_PAINT_RAD_GRADIENT:
        j2d_glUseProgramObjectARB(0);
        j2d_glDisable(GL_TEXTURE_1D);
        break;

    case sun_java2d_SunGraphics2D_PAINT_ALPHACOLOR:
    default:
        break;
    }

    if (oglc->useMask) {
        // restore control to texture unit 0
        j2d_glActiveTextureARB(GL_TEXTURE0_ARB);
    }

    // set each component of the current color state to the extra alpha
    // value, which will effectively apply the extra alpha to each fragment
    // in paint/texturing operations
    ea = (jubyte)(oglc->extraAlpha * 0xff + 0.5f);
    j2d_glColor4ub(ea, ea, ea, ea);
    oglc->pixel = (ea << 24) | (ea << 16) | (ea << 8) | (ea << 0);
    oglc->r = ea;
    oglc->g = ea;
    oglc->b = ea;
    oglc->a = ea;
    oglc->useMask = JNI_FALSE;
    oglc->paintState = -1;
}
开发者ID:michalwarecki,项目名称:ManagedRuntimeInitiative,代码行数:60,代码来源:OGLPaints.c

示例3: J2dTraceLn

/*
 * Class:     sun_java2d_d3d_D3DGraphicsDevice
 * Method:    getAvailableAcceleratedMemoryNative
 * Signature: (I)J
 */
JNIEXPORT jlong JNICALL
Java_sun_java2d_d3d_D3DGraphicsDevice_getAvailableAcceleratedMemoryNative
  (JNIEnv *env, jclass gdc, jint gdiScreen)
{
    // REMIND: looks like Direct3D provides information about texture memory
    // only via IDirect3DDevice9::GetAvailableTextureMem, however, it
    // seems to report the same amount as direct draw used to.
    HRESULT res;
    D3DPipelineManager *pMgr;
    D3DContext *pCtx;
    IDirect3DDevice9 *pd3dDevice;
    UINT adapter;

    J2dTraceLn(J2D_TRACE_INFO, "D3DGD_getAvailableAcceleratedMemoryNative");

    RETURN_STATUS_IF_NULL(pMgr = D3DPipelineManager::GetInstance(), 0L);
    adapter = pMgr->GetAdapterOrdinalForScreen(gdiScreen);

    if (FAILED(res = pMgr->GetD3DContext(adapter, &pCtx))) {
        D3DRQ_MarkLostIfNeeded(res, D3DRQ_GetCurrentDestination());
        return 0L;
    }
    RETURN_STATUS_IF_NULL(pd3dDevice = pCtx->Get3DDevice(), 0L);

    UINT mem = pd3dDevice->GetAvailableTextureMem();
    J2dTraceLn1(J2D_TRACE_VERBOSE, "  available memory=%d", mem);
    return mem;
}
开发者ID:frohoff,项目名称:jdk6,代码行数:33,代码来源:D3DGraphicsDevice.cpp

示例4: Java_sun_java2d_windows_WinBackBufferSurfaceData_initSurface

/*
 * Class:     sun_java2d_windows_WinBackBufferSurfaceData
 * Method:    initSurface
 * Signature: (IIILsun/awt/windows/WinBackBufferSurfaceData;)V
 */
JNIEXPORT void JNICALL
Java_sun_java2d_windows_WinBackBufferSurfaceData_initSurface(JNIEnv *env,
    jobject sData, jint depth, jint width, jint height, jint screen,
    jobject parentData)
{
    Win32SDOps *wsdo = (Win32SDOps *)SurfaceData_GetOps(env, sData);

    J2dTraceLn(J2D_TRACE_INFO, "Win32BBSD_initSurface");
    /* Set the correct dispose method */
    wsdo->sdOps.Dispose = Win32BBSD_Dispose;
    jboolean status =
        initOSSD_WSDO(env, wsdo, width, height, screen, JNI_FALSE);
    if (status == JNI_FALSE || parentData == NULL) {
        SurfaceData_ThrowInvalidPipeException(env,
            "Error initalizing back-buffer surface");
        return;
    }
    Win32SDOps *wsdo_parent = (Win32SDOps*)SurfaceData_GetOps(env, parentData);
    if (!DDGetAttachedSurface(env, wsdo_parent, wsdo)) {
        SurfaceData_ThrowInvalidPipeException(env,
            "Can't create attached surface");
    }
    J2dTraceLn1(J2D_TRACE_VERBOSE,
                "Win32BackBufferSurfaceData_initSurface: "\
                "completed wsdo->lpSurface=0x%x", wsdo->lpSurface);
}
开发者ID:michalwarecki,项目名称:ManagedRuntimeInitiative,代码行数:31,代码来源:WinBackBufferSurfaceData.cpp

示例5: OGLContext_SetXorComposite

/**
 * Initializes the OpenGL logic op state to XOR mode.  Blending is disabled
 * before enabling logic op mode.  The XOR pixel value will be applied
 * later in the OGLContext_SetColor() method.
 */
void
OGLContext_SetXorComposite(OGLContext *oglc, jint xorPixel)
{
    J2dTraceLn1(J2D_TRACE_INFO,
                "OGLContext_SetXorComposite: xorPixel=%08x", xorPixel);

    RETURN_IF_NULL(oglc);
    CHECK_PREVIOUS_OP(OGL_STATE_CHANGE);

    // disable blending mode
    if (oglc->compState == sun_java2d_SunGraphics2D_COMP_ALPHA) {
        j2d_glDisable(GL_BLEND);
    }

    // enable XOR mode
    j2d_glEnable(GL_COLOR_LOGIC_OP);
    j2d_glLogicOp(GL_XOR);

    // set up the alpha test so that we discard transparent fragments (this
    // is primarily useful for rendering text in XOR mode)
    j2d_glEnable(GL_ALPHA_TEST);
    j2d_glAlphaFunc(GL_NOTEQUAL, 0.0f);

    // update state
    oglc->compState = sun_java2d_SunGraphics2D_COMP_XOR;
    oglc->xorPixel = xorPixel;
    oglc->extraAlpha = 1.0f;
}
开发者ID:krichter722,项目名称:jdk9-jdk9-jdk,代码行数:33,代码来源:OGLContext.c

示例6: OGLPaints_SetColor

void
OGLPaints_SetColor(OGLContext *oglc, jint pixel)
{
    jubyte r, g, b, a;

    J2dTraceLn1(J2D_TRACE_INFO, "OGLPaints_SetColor: pixel=%08x", pixel);

    RETURN_IF_NULL(oglc);

    // glColor*() is allowed within glBegin()/glEnd() pairs, so
    // no need to reset the current op state here unless the paint
    // state really needs to be changed
    if (oglc->paintState > sun_java2d_SunGraphics2D_PAINT_ALPHACOLOR) {
        OGLPaints_ResetPaint(oglc);
    }

    // store the raw (unmodified) pixel value, which may be used for
    // special operations later
    oglc->pixel = pixel;

    if (oglc->compState != sun_java2d_SunGraphics2D_COMP_XOR) {
        r = (jubyte)(pixel >> 16);
        g = (jubyte)(pixel >>  8);
        b = (jubyte)(pixel >>  0);
        a = (jubyte)(pixel >> 24);

        J2dTraceLn4(J2D_TRACE_VERBOSE,
                    "  updating color: r=%02x g=%02x b=%02x a=%02x",
                    r, g, b, a);
    } else {
开发者ID:michalwarecki,项目名称:ManagedRuntimeInitiative,代码行数:30,代码来源:OGLPaints.c

示例7: OGLTR_UpdateLCDTextColor

/**
 * Updates the current gamma-adjusted source color ("src_adj") of the LCD
 * text shader program.  Note that we could calculate this value in the
 * shader (e.g. just as we do for "dst_adj"), but would be unnecessary work
 * (and a measurable performance hit, maybe around 5%) since this value is
 * constant over the entire glyph list.  So instead we just calculate the
 * gamma-adjusted value once and update the uniform parameter of the LCD
 * shader as needed.
 */
static jboolean
OGLTR_UpdateLCDTextColor(jint contrast)
{
    double gamma = ((double)contrast) / 100.0;
    GLfloat radj, gadj, badj;
    GLfloat clr[4];
    GLint loc;

    J2dTraceLn1(J2D_TRACE_INFO,
                "OGLTR_UpdateLCDTextColor: contrast=%d", contrast);

    /*
     * Note: Ideally we would update the "src_adj" uniform parameter only
     * when there is a change in the source color.  Fortunately, the cost
     * of querying the current OpenGL color state and updating the uniform
     * value is quite small, and in the common case we only need to do this
     * once per GlyphList, so we gain little from trying to optimize too
     * eagerly here.
     */

    // get the current OpenGL primary color state
    j2d_glGetFloatv(GL_CURRENT_COLOR, clr);

    // gamma adjust the primary color
    radj = (GLfloat)pow(clr[0], gamma);
    gadj = (GLfloat)pow(clr[1], gamma);
    badj = (GLfloat)pow(clr[2], gamma);

    // update the "src_adj" parameter of the shader program with this value
    loc = j2d_glGetUniformLocationARB(lcdTextProgram, "src_adj");
    j2d_glUniform3fARB(loc, radj, gadj, badj);

    return JNI_TRUE;
}
开发者ID:ChenYao,项目名称:jdk7u-jdk,代码行数:43,代码来源:OGLTextRenderer.c

示例8: J2dTraceLn1

/**
 * Create a new Devices object with numDevices elements.
 */
Devices::Devices(int numDevices)
{
    J2dTraceLn1(J2D_TRACE_INFO, "Devices::Devices numDevices=%d", numDevices);
    this->numDevices = numDevices;
    this->refCount = 0;
    devices = (AwtWin32GraphicsDevice**)SAFE_SIZE_ARRAY_ALLOC(safe_Malloc,
        numDevices, sizeof(AwtWin32GraphicsDevice *));
}
开发者ID:frohoff,项目名称:jdk6,代码行数:11,代码来源:Devices.cpp

示例9: OGLContext_SetExtraAlpha

/**
 * Initializes the OpenGL state responsible for applying extra alpha.  This
 * step is only necessary for any operation that uses glDrawPixels() or
 * glCopyPixels() with a non-1.0f extra alpha value.  Since the source is
 * always premultiplied, we apply the extra alpha value to both alpha and
 * color components using GL_*_SCALE.
 */
void
OGLContext_SetExtraAlpha(jfloat ea)
{
    J2dTraceLn1(J2D_TRACE_INFO, "OGLContext_SetExtraAlpha: ea=%f", ea);

    j2d_glPixelTransferf(GL_ALPHA_SCALE, ea);
    j2d_glPixelTransferf(GL_RED_SCALE, ea);
    j2d_glPixelTransferf(GL_GREEN_SCALE, ea);
    j2d_glPixelTransferf(GL_BLUE_SCALE, ea);
}
开发者ID:krichter722,项目名称:jdk9-jdk9-jdk,代码行数:17,代码来源:OGLContext.c

示例10: J2dTraceLn1

D3DGlyphCache::D3DGlyphCache(GlyphCacheType type)
{
    J2dTraceLn1(J2D_TRACE_INFO, "D3DGlyphCache::D3DGlyphCache gcType=%d", type);

    pCtx = NULL;
    gcType = type;
    pGlyphCacheRes = NULL;
    pGlyphCache = NULL;
    tileFormat = (gcType == CACHE_GRAY) ? TILEFMT_1BYTE_ALPHA : TILEFMT_UNKNOWN;
    lastRGBOrder = JNI_FALSE;
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:11,代码来源:D3DGlyphCache.cpp

示例11: OGLTR_UpdateLCDTextContrast

/**
 * (Re)Initializes the gamma lookup table textures.
 *
 * The given contrast value is an int in the range [100, 250] which we will
 * then scale to fit in the range [1.0, 2.5].  We create two LUTs, one
 * that essentially calculates pow(x, gamma) and the other calculates
 * pow(x, 1/gamma).  These values are replicated in all three dimensions, so
 * given a single 3D texture coordinate (typically this will be a triplet
 * in the form (r,g,b)), the 3D texture lookup will return an RGB triplet:
 *
 *     (pow(r,g), pow(y,g), pow(z,g)
 *
 * where g is either gamma or 1/gamma, depending on the table.
 */
static jboolean
OGLTR_UpdateLCDTextContrast(jint contrast)
{
    double gamma = ((double)contrast) / 100.0;
    double ig = gamma;
    double g = 1.0 / ig;
    GLfloat lut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3];
    GLfloat invlut[LUT_EDGE][LUT_EDGE][LUT_EDGE][3];
    int min = 0;
    int max = LUT_EDGE - 1;
    int x, y, z;

    J2dTraceLn1(J2D_TRACE_INFO,
                "OGLTR_UpdateLCDTextContrast: contrast=%d", contrast);

    for (z = min; z <= max; z++) {
        double zval = ((double)z) / max;
        GLfloat gz = (GLfloat)pow(zval, g);
        GLfloat igz = (GLfloat)pow(zval, ig);

        for (y = min; y <= max; y++) {
            double yval = ((double)y) / max;
            GLfloat gy = (GLfloat)pow(yval, g);
            GLfloat igy = (GLfloat)pow(yval, ig);

            for (x = min; x <= max; x++) {
                double xval = ((double)x) / max;
                GLfloat gx = (GLfloat)pow(xval, g);
                GLfloat igx = (GLfloat)pow(xval, ig);

                lut[z][y][x][0] = gx;
                lut[z][y][x][1] = gy;
                lut[z][y][x][2] = gz;

                invlut[z][y][x][0] = igx;
                invlut[z][y][x][1] = igy;
                invlut[z][y][x][2] = igz;
            }
        }
    }

    if (gammaLutTextureID == 0) {
        gammaLutTextureID = OGLTR_InitGammaLutTexture();
    }
    OGLTR_UpdateGammaLutTexture(gammaLutTextureID, (GLfloat *)lut, LUT_EDGE);

    if (invGammaLutTextureID == 0) {
        invGammaLutTextureID = OGLTR_InitGammaLutTexture();
    }
    OGLTR_UpdateGammaLutTexture(invGammaLutTextureID,
                                (GLfloat *)invlut, LUT_EDGE);

    return JNI_TRUE;
}
开发者ID:ChenYao,项目名称:jdk7u-jdk,代码行数:68,代码来源:OGLTextRenderer.c

示例12: FormatMessage

/**
 * Debugging utility: prints information about errors received
 * during interaction with the registry.
 */
void RegistryKey::PrintRegistryError(LONG errNum, char *message)
{
    WCHAR errString[255];
    int numChars =  FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, errNum, 0,
        errString, 255, NULL);
    if (numChars == 0) {
        J2dTraceLn1(J2D_TRACE_ERROR, "problem with formatmessage, err = %d\n",
                    GetLastError());
    }
    J2dTraceLn3(J2D_TRACE_ERROR, "problem with %s, errNum, string = %d, %S\n",
                message, errNum, errString);
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:16,代码来源:RegistryKey.cpp

示例13: OGLContext_SetAlphaComposite

/**
 * Initializes the OpenGL blending state.  XOR mode is disabled and the
 * appropriate blend functions are setup based on the AlphaComposite rule
 * constant.
 */
void
OGLContext_SetAlphaComposite(OGLContext *oglc,
                             jint rule, jfloat extraAlpha, jint flags)
{
    J2dTraceLn1(J2D_TRACE_INFO,
                "OGLContext_SetAlphaComposite: flags=%d", flags);

    RETURN_IF_NULL(oglc);
    CHECK_PREVIOUS_OP(OGL_STATE_CHANGE);

    // disable XOR mode
    if (oglc->compState == sun_java2d_SunGraphics2D_COMP_XOR) {
        j2d_glDisable(GL_COLOR_LOGIC_OP);
        j2d_glDisable(GL_ALPHA_TEST);
    }

    // we can safely disable blending when:
    //   - comp is SrcNoEa or SrcOverNoEa, and
    //   - the source is opaque
    // (turning off blending can have a large positive impact on
    // performance)
    if ((rule == RULE_Src || rule == RULE_SrcOver) &&
            (extraAlpha == 1.0f) &&
            (flags & OGLC_SRC_IS_OPAQUE))
    {
        J2dTraceLn1(J2D_TRACE_VERBOSE,
                    "  disabling alpha comp: rule=%d ea=1.0 src=opq", rule);
        j2d_glDisable(GL_BLEND);
    } else {
        J2dTraceLn2(J2D_TRACE_VERBOSE,
                    "  enabling alpha comp: rule=%d ea=%f", rule, extraAlpha);
        j2d_glEnable(GL_BLEND);
        j2d_glBlendFunc(StdBlendRules[rule].src, StdBlendRules[rule].dst);
    }

    // update state
    oglc->compState = sun_java2d_SunGraphics2D_COMP_ALPHA;
    oglc->extraAlpha = extraAlpha;
}
开发者ID:krichter722,项目名称:jdk9-jdk9-jdk,代码行数:44,代码来源:OGLContext.c

示例14: J2dTraceLn1

HRESULT
D3DResourceManager::Init(D3DContext *pCtx)
{
    J2dTraceLn1(J2D_TRACE_INFO, "D3DRM::Init pCtx=%x", pCtx);
    if (this->pCtx != pCtx ||
        (this->pCtx != NULL &&
         this->pCtx->Get3DDevice() != pCtx->Get3DDevice()))
    {
        ReleaseAll();
    }
    this->pCtx = pCtx;
    return S_OK;
}
开发者ID:ChenYao,项目名称:jdk7u-jdk,代码行数:13,代码来源:D3DResourceManager.cpp

示例15: GetFlagValues

void GetFlagValues(JNIEnv *env, jclass wFlagsClass)
{
    jboolean d3dEnabled = env->GetStaticBooleanField(wFlagsClass, d3dEnabledID);
    jboolean d3dSet = env->GetStaticBooleanField(wFlagsClass, d3dSetID);
    if (!d3dSet) {
        // Only check environment variable if user did not set Java
        // command-line parameter; values of sun.java2d.d3d override
        // any setting of J2D_D3D environment variable.
        char *d3dEnv = getenv("J2D_D3D");
        if (d3dEnv) {
            if (strcmp(d3dEnv, "false") == 0) {
                // printf("Java2D Direct3D usage disabled by J2D_D3D env\n");
                d3dEnabled = FALSE;
                d3dSet = TRUE;
                SetD3DEnabledFlag(env, d3dEnabled, d3dSet);
            } else if (strcmp(d3dEnv, "true") == 0) {
                // printf("Java2D Direct3D usage forced on by J2D_D3D env\n");
                d3dEnabled = TRUE;
                d3dSet = TRUE;
                SetD3DEnabledFlag(env, d3dEnabled, d3dSet);
            }
        }
    }
    useD3D = d3dEnabled;
    forceD3DUsage = d3dSet;
    g_offscreenSharing = GetStaticBoolean(env, wFlagsClass,
                                          "offscreenSharingEnabled");
    accelReset = GetStaticBoolean(env, wFlagsClass, "accelReset");
    checkRegistry = GetStaticBoolean(env, wFlagsClass, "checkRegistry");
    disableRegistry = GetStaticBoolean(env, wFlagsClass, "disableRegistry");
    jstring javaVersionString = (jstring)GetStaticObject(env, wFlagsClass,
                                                         "javaVersion",
                                                         "Ljava/lang/String;");

    setHighDPIAware =
        (IS_WINVISTA && GetStaticBoolean(env, wFlagsClass, "setHighDPIAware"));

    J2dTraceLn(J2D_TRACE_INFO, "WindowsFlags (native):");
    J2dTraceLn1(J2D_TRACE_INFO, "  d3dEnabled = %s",
                (useD3D ? "true" : "false"));
    J2dTraceLn1(J2D_TRACE_INFO, "  d3dSet = %s",
                (forceD3DUsage ? "true" : "false"));
    J2dTraceLn1(J2D_TRACE_INFO, "  offscreenSharing = %s",
                (g_offscreenSharing ? "true" : "false"));
    J2dTraceLn1(J2D_TRACE_INFO, "  accelReset = %s",
                (accelReset ? "true" : "false"));
    J2dTraceLn1(J2D_TRACE_INFO, "  checkRegistry = %s",
                (checkRegistry ? "true" : "false"));
    J2dTraceLn1(J2D_TRACE_INFO, "  disableRegistry = %s",
                (disableRegistry ? "true" : "false"));
    J2dTraceLn1(J2D_TRACE_INFO, "  setHighDPIAware = %s",
                (setHighDPIAware ? "true" : "false"));
}
开发者ID:ChenYao,项目名称:jdk7u-jdk,代码行数:53,代码来源:WindowsFlags.cpp


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