123 * Note that this method is called from a synchronized block in 124 * WComponentPeer, so we don't need to synchronize 125 * 126 * Note that we only create a substibute d3dw surface if certain conditions 127 * are met 128 * <ul> 129 * <li>the fake d3d rendering on screen is not disabled via flag 130 * <li>d3d on the device is enabled 131 * <li>surface is larger than MIN_WIN_SIZE (don't bother for smaller ones) 132 * <li>it doesn't have a backBuffer for a BufferStrategy already 133 * <li>the peer is either Canvas, Panel, Window, Frame, 134 * Dialog or EmbeddedFrame 135 * </ul> 136 * 137 * @param gc GraphicsConfiguration on associated with the surface 138 * @param peer peer for which the surface is to be created 139 * @param bbNum number of back-buffers requested. if this number is >0, 140 * method returns GDI surface (we don't want to have two swap chains) 141 * @param isResize whether this surface is being created in response to 142 * a component resize event. This determines whether a repaint event will 143 * be issued after a surface is created: it will be if <code>isResize</code> 144 * is <code>true</code>. 145 * @return surface data to be use for onscreen rendering 146 */ 147 @Override 148 public SurfaceData createScreenSurface(Win32GraphicsConfig gc, 149 WComponentPeer peer, 150 int bbNum, boolean isResize) 151 { 152 if (done || !(gc instanceof D3DGraphicsConfig)) { 153 return super.createScreenSurface(gc, peer, bbNum, isResize); 154 } 155 156 SurfaceData sd = null; 157 158 if (canUseD3DOnScreen(peer, gc, bbNum)) { 159 try { 160 // note that the created surface will be in the "lost" 161 // state, it will be restored prior to rendering to it 162 // for the first time. This is done so that vram is not 163 // wasted for surfaces never rendered to 164 sd = D3DSurfaceData.createData(peer); | 123 * Note that this method is called from a synchronized block in 124 * WComponentPeer, so we don't need to synchronize 125 * 126 * Note that we only create a substibute d3dw surface if certain conditions 127 * are met 128 * <ul> 129 * <li>the fake d3d rendering on screen is not disabled via flag 130 * <li>d3d on the device is enabled 131 * <li>surface is larger than MIN_WIN_SIZE (don't bother for smaller ones) 132 * <li>it doesn't have a backBuffer for a BufferStrategy already 133 * <li>the peer is either Canvas, Panel, Window, Frame, 134 * Dialog or EmbeddedFrame 135 * </ul> 136 * 137 * @param gc GraphicsConfiguration on associated with the surface 138 * @param peer peer for which the surface is to be created 139 * @param bbNum number of back-buffers requested. if this number is >0, 140 * method returns GDI surface (we don't want to have two swap chains) 141 * @param isResize whether this surface is being created in response to 142 * a component resize event. This determines whether a repaint event will 143 * be issued after a surface is created: it will be if {@code isResize} 144 * is {@code true}. 145 * @return surface data to be use for onscreen rendering 146 */ 147 @Override 148 public SurfaceData createScreenSurface(Win32GraphicsConfig gc, 149 WComponentPeer peer, 150 int bbNum, boolean isResize) 151 { 152 if (done || !(gc instanceof D3DGraphicsConfig)) { 153 return super.createScreenSurface(gc, peer, bbNum, isResize); 154 } 155 156 SurfaceData sd = null; 157 158 if (canUseD3DOnScreen(peer, gc, bbNum)) { 159 try { 160 // note that the created surface will be in the "lost" 161 // state, it will be restored prior to rendering to it 162 // for the first time. This is done so that vram is not 163 // wasted for surfaces never rendered to 164 sd = D3DSurfaceData.createData(peer); |