< prev index next >

src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp

Print this page
rev 50304 : 8204085: avoid printing uninitialized pointer in java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp


 473     // REMIND: There was originally a condition check here to make sure
 474     // that we were really dealing with a GDIWindowSurfaceData object, but
 475     // it did not allow for the existence of other win32-accelerated
 476     // surface data objects (e.g., Win32OffScreenSurfaceData).  I've
 477     // removed the check for now, but we should replace it with another,
 478     // more general check against Win32-related surfaces.
 479     return (GDIWinSDOps *) ops;
 480 }
 481 
 482 JNIEXPORT GDIWinSDOps * JNICALL
 483 GDIWindowSurfaceData_GetOpsNoSetup(JNIEnv *env, jobject sData)
 484 {
 485     // use the 'no setup' version of GetOps
 486     SurfaceDataOps *ops = SurfaceData_GetOpsNoSetup(env, sData);
 487     return (GDIWinSDOps *) ops;
 488 }
 489 
 490 JNIEXPORT AwtComponent * JNICALL
 491 GDIWindowSurfaceData_GetComp(JNIEnv *env, GDIWinSDOps *wsdo)
 492 {
 493     PDATA pData;
 494     jobject localObj = env->NewLocalRef(wsdo->peer);
 495 
 496     if (localObj == NULL || (pData = JNI_GET_PDATA(localObj)) == NULL) {
 497         J2dTraceLn1(J2D_TRACE_WARNING,
 498                     "GDIWindowSurfaceData_GetComp: Null pData? pData=0x%x",
 499                     pData);
 500         if (beingShutdown == JNI_TRUE) {
 501             wsdo->invalid = JNI_TRUE;
 502             return (AwtComponent *) NULL;
 503         }
 504         try {
 505             AwtToolkit::GetInstance().VerifyActive();
 506         } catch (awt_toolkit_shutdown&) {
 507             beingShutdown = JNI_TRUE;
 508             wsdo->invalid = JNI_TRUE;
 509             return (AwtComponent *) NULL;
 510         }
 511         if (wsdo->invalid == JNI_TRUE) {
 512             SurfaceData_ThrowInvalidPipeException(env,
 513                 "GDIWindowSurfaceData: bounds changed");




 473     // REMIND: There was originally a condition check here to make sure
 474     // that we were really dealing with a GDIWindowSurfaceData object, but
 475     // it did not allow for the existence of other win32-accelerated
 476     // surface data objects (e.g., Win32OffScreenSurfaceData).  I've
 477     // removed the check for now, but we should replace it with another,
 478     // more general check against Win32-related surfaces.
 479     return (GDIWinSDOps *) ops;
 480 }
 481 
 482 JNIEXPORT GDIWinSDOps * JNICALL
 483 GDIWindowSurfaceData_GetOpsNoSetup(JNIEnv *env, jobject sData)
 484 {
 485     // use the 'no setup' version of GetOps
 486     SurfaceDataOps *ops = SurfaceData_GetOpsNoSetup(env, sData);
 487     return (GDIWinSDOps *) ops;
 488 }
 489 
 490 JNIEXPORT AwtComponent * JNICALL
 491 GDIWindowSurfaceData_GetComp(JNIEnv *env, GDIWinSDOps *wsdo)
 492 {
 493     PDATA pData = NULL;
 494     jobject localObj = env->NewLocalRef(wsdo->peer);
 495 
 496     if (localObj == NULL || (pData = JNI_GET_PDATA(localObj)) == NULL) {
 497         J2dTraceLn1(J2D_TRACE_WARNING,
 498                     "GDIWindowSurfaceData_GetComp: Null pData? pData=0x%x",
 499                     pData);
 500         if (beingShutdown == JNI_TRUE) {
 501             wsdo->invalid = JNI_TRUE;
 502             return (AwtComponent *) NULL;
 503         }
 504         try {
 505             AwtToolkit::GetInstance().VerifyActive();
 506         } catch (awt_toolkit_shutdown&) {
 507             beingShutdown = JNI_TRUE;
 508             wsdo->invalid = JNI_TRUE;
 509             return (AwtComponent *) NULL;
 510         }
 511         if (wsdo->invalid == JNI_TRUE) {
 512             SurfaceData_ThrowInvalidPipeException(env,
 513                 "GDIWindowSurfaceData: bounds changed");


< prev index next >