jdk/src/windows/native/sun/java2d/d3d/D3DRuntimeTest.h
author ohair
Fri, 08 Aug 2008 08:52:18 -0700
changeset 921 85b4d3bded64
parent 2 90ce3da70b43
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#ifndef D3DRUNTIMETEST_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define D3DRUNTIMETEST_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "ddrawObject.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "dxCapabilities.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#include "D3DContext.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * This is a minimum set of capabilities required for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * enabling D3D pipeline. If any of these is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * missing, d3d will be disabled completely.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * This set is used if the use of d3d pipeline is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * forced via flag or env. variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#define J2D_D3D_REQUIRED_RESULTS ( \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
   J2D_D3D_HW_OK                 | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
   J2D_D3D_DEVICE_OK             | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
   J2D_D3D_DEPTH_SURFACE_OK      | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
   J2D_D3D_PLAIN_SURFACE_OK      | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
   J2D_D3D_PIXEL_FORMATS_OK      | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
   J2D_D3D_OP_TEXTURE_SURFACE_OK | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
   J2D_D3D_TR_TEXTURE_SURFACE_OK | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
   J2D_D3D_SET_TRANSFORM_OK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * This is a set of capabilities desired for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * enabling D3D pipeline. It includes the set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * of required caps, plus a number of rendering
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * quality related caps.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * This is the set of caps checked by default when
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * deciding on whether to enable the d3d pipeline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#define J2D_D3D_DESIRED_RESULTS ( \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
   J2D_D3D_REQUIRED_RESULTS      | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
   J2D_D3D_BM_TEXTURE_SURFACE_OK | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
   J2D_D3D_TEXTURE_BLIT_OK       | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
   J2D_D3D_TEXTURE_TRANSFORM_OK  | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
   J2D_D3D_LINES_OK              | \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
   J2D_D3D_LINE_CLIPPING_OK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * This function tests the direct3d device associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * with the passed ddraw object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * The function returns the capabilities of the tested device, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * results of the quality testing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * Enabling the d3d pipeline for this particular device is based on the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * result of this function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
int TestD3DDevice(DDraw *ddObject, D3DContext *d3dContext, DxCapabilities *dxCaps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
void PrintD3DCaps(int caps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#endif //D3DRUNTIMETEST_H