2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. 430N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 430N/A * This code is free software; you can redistribute it and/or modify it 430N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 430N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 430N/A * This code is distributed in the hope that it will be useful, but WITHOUT 430N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 430N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 430N/A * version 2 for more details (a copy is included in the LICENSE file that 430N/A * accompanied this code). 430N/A * You should have received a copy of the GNU General Public License version 430N/A * 2 along with this work; if not, write to the Free Software Foundation, 430N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 430N/A * We will attempt to accelerate this image only under the 430N/A * following conditions: 430N/A * - the image is opaque OR 430N/A * - the image is translucent AND 430N/A * - the GraphicsConfig supports the FBO extension OR 430N/A * - the GraphicsConfig has a stored alpha channel 430N/A * Create a pbuffer-based SurfaceData object (or init the backbuffer 430N/A * of an existing window if this is a double buffered GraphicsConfig). 430N/A // peer must be non-null in this case 430N/A // if acceleration type is forced (type != UNDEFINED) then 430N/A // use the forced type, otherwise use RT_TEXTURE 430N/A * Set the number of iterations for restoreAcceleratedSurface to fail 430N/A * before attempting to restore the accelerated surface. 430N/A * @see #restoreAcceleratedSurface 430N/A * @see #handleVItoScreenOp 430N/A * Note that we create a new surface instead of restoring 430N/A * an old one. This will help with D3DContext revalidation. 430N/A // REMIND: alternatively, we could try this: 430N/A// ((D3DSurfaceData)sdAccel).restoreSurface(); 430N/A * We're asked to restore contents by the accelerated surface, which means 430N/A * that it had been lost. 430N/A * If the destination surface's peer can potentially handle accelerated 430N/A * on-screen rendering then it is likely that the condition which resulted 430N/A * in VI to Screen operation is temporary, so this method sets the 430N/A * restore countdown in hope that the on-screen accelerated rendering will 430N/A * resume. In the meantime the backup surface of the VISM will be used. 430N/A * The countdown is needed because otherwise we may never break out 430N/A * of "do { vi.validate()..} while(vi.lost)" loop since validate() could 430N/A * restore the source surface every time and it will get lost again on the 430N/A * next copy attempt, and we would never get a chance to use the backup 430N/A * surface. By using the countdown we allow the backup surface to be used 430N/A * while the screen surface gets sorted out, or if it for some reason can 430N/A * If the destination surface's peer could never do accelerated onscreen 430N/A * rendering then the acceleration for the SurfaceManager associated with 430N/A * the source surface is disabled forever. 430N/A // 10 is only chosen to be greater than the number of 430N/A // times a sane person would call validate() inside 430N/A // a validation loop, and to reduce thrashing between 430N/A // accelerated and backup surfaces