/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "D3DResourceManager.h"
#include "awt.h"
#include "D3DPaints.h"
#include "D3DTextRenderer.h"
void
{
pSwapChain = pSC;
switch (type) {
case D3DRTYPE_TEXTURE:
// addRef is needed because both pResource and pTexture will be
// Release()d, and they point to the same object
break;
case D3DRTYPE_SURFACE:
break;
case D3DRTYPE_CUBETEXTURE:
break;
default:
}
} else if (pSwapChain != NULL) {
} else {
}
}
}
{
Release();
}
void
{
// something's wrong, we're overwriting
// a non-null field (setting it to null is allowed)
"D3DResource::SetSDOps: overwriting "\
}
}
{
}
return TRUE;
}
void
{
// if sdOps is not NULL it means that the release was initiated
// from the native level, and is caused by a surface loss
}
}
{
*ppResourceMgr = new D3DResourceManager();
delete *ppResourceMgr;
*ppResourceMgr = NULL;
}
return res;
}
{
}
{
{
ReleaseAll();
}
return S_OK;
}
{
ReleaseAll();
}
void
{
delete pCurrent;
}
pBlitTexture = NULL;
pMaskTexture = NULL;
}
void
{
// REMIND: for now, release all resources
ReleaseAll();
}
{
} else {
// it's the head
}
}
}
delete pResource;
}
return S_OK;
}
{
}
}
return S_OK;
}
{
{
return E_FAIL;
}
return res;
}
} else {
if (isOpaque) {
} else {
}
}
if (isRTT) {
} else {
dwUsage = 0;
}
if (dwUsage == D3DUSAGE_DYNAMIC) {
} else {
}
}
if (pCtx->IsPow2TexturesOnly()) {
UINT w, h;
width = w;
height = h;
}
if (pCtx->IsSquareTexturesOnly()) {
} else {
}
}
} else {
}
}
return res;
}
{
{
return E_FAIL;
}
return res;
}
}
} else {
}
return res;
}
// REMIND: this method is currently unused; consider removing it later...
{
{
return E_FAIL;
}
return res;
}
// since the off-screen plain surface is intended to be used with
// the UpdateSurface() method, it is essential that it be created
// in the same format as the destination and allocated in the
// SYSTEMMEM pool (otherwise UpdateSurface() will fail)
if (fmt == D3DFMT_UNKNOWN) {
} else {
}
} else {
}
return res;
}
{
{
return E_FAIL;
}
// there's a single swap chain in full-screen mode, use it if
// it fits our parameters, reset the device otherwise
{
// this reset will not have released the device, so our pd3dDevice
// is still valid, but to be on a safe side, reset it
}
} else {
}
} else {
}
return res;
}
{
&pMaskTexture)))
{
return res;
}
if (needsInit) {
// init special fully opaque tile in the upper-right corner of
// the mask cache texture
0, 0,
{
return res;
}
}
return res;
}
{
&pBlitTexture);
return res;
}
{
return res;
}
{
return res;
}
{
return res;
}
{
&format, 0,
{
return res;
}
// current texture doesn't fit, release and allocate a new one
}
return res;
}
{
if (pBlitOSPSurface != NULL) {
{
return res;
}
// current surface doesn't fit, release and allocate a new one
}
return res;
}
{
if (pLockableRTSurface != NULL) {
{
return res;
}
// current surface doesn't fit, release and allocate a new one
}
&format, &pLockableRTSurface);
return res;
}
{
&format, 0, &pCachedDestTexture);
{
return res;
}
// current texture doesn't fit, release and allocate a new one
}
return res;
}
{
return S_OK;
}
}
}