< prev index next >

src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java

Print this page




 506      */
 507     private synchronized SurfaceData getGdiSurface(D3DWindowSurfaceData d3dw) {
 508         if (gdiSurfaces == null) {
 509             gdiSurfaces =
 510                 new HashMap<D3DWindowSurfaceData, GDIWindowSurfaceData>();
 511         }
 512         GDIWindowSurfaceData gdisd = gdiSurfaces.get(d3dw);
 513         if (gdisd == null) {
 514             gdisd = GDIWindowSurfaceData.createData(d3dw.getPeer());
 515             gdiSurfaces.put(d3dw, gdisd);
 516         }
 517         return gdisd;
 518     }
 519 
 520     /**
 521      * Returns true if the component has heavyweight children.
 522      *
 523      * @param comp component to check for hw children
 524      * @return true if Component has heavyweight children
 525      */

 526     private static boolean hasHWChildren(Component comp) {
 527         if (comp instanceof Container) {
 528             for (Component c : ((Container)comp).getComponents()) {
 529                 if (c.getPeer() instanceof WComponentPeer || hasHWChildren(c)) {
 530                     return true;
 531                 }
 532             }
 533         }
 534         return false;
 535     }
 536 }


 506      */
 507     private synchronized SurfaceData getGdiSurface(D3DWindowSurfaceData d3dw) {
 508         if (gdiSurfaces == null) {
 509             gdiSurfaces =
 510                 new HashMap<D3DWindowSurfaceData, GDIWindowSurfaceData>();
 511         }
 512         GDIWindowSurfaceData gdisd = gdiSurfaces.get(d3dw);
 513         if (gdisd == null) {
 514             gdisd = GDIWindowSurfaceData.createData(d3dw.getPeer());
 515             gdiSurfaces.put(d3dw, gdisd);
 516         }
 517         return gdisd;
 518     }
 519 
 520     /**
 521      * Returns true if the component has heavyweight children.
 522      *
 523      * @param comp component to check for hw children
 524      * @return true if Component has heavyweight children
 525      */
 526     @SuppressWarnings("deprecation")
 527     private static boolean hasHWChildren(Component comp) {
 528         if (comp instanceof Container) {
 529             for (Component c : ((Container)comp).getComponents()) {
 530                 if (c.getPeer() instanceof WComponentPeer || hasHWChildren(c)) {
 531                     return true;
 532                 }
 533             }
 534         }
 535         return false;
 536     }
 537 }
< prev index next >