jdk/src/windows/native/sun/java2d/d3d/D3DContext.h
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 887 0aab8d3fa11a
permissions -rw-r--r--
Initial load
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-2006 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 D3DCONTEXT_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define D3DCONTEXT_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "java_awt_Transparency.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "sun_java2d_d3d_D3DContext.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#include "ddrawObject.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
extern "C" {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#include "glyphblitting.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#include "AccelGlyphCache.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#include "j2d_md.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
// - State switching optimizations -----------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * The goal is to reduce device state switching as much as possible.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * This means: don't reset the texture if not needed, don't change
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * the texture stage states unless necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * For this we need to track the current device state. So each operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * supplies its own operation type to BeginScene, which updates the state
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * as necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * Another optimization is to use a single vertex format for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * all primitives.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * See D3DContext::UpdateState() and D3DContext::BeginScene() for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * more information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
// The state is undefined, assume that complete initialization is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
// needed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#define STATE_UNDEFINED          (0 << 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
// Current state uses texture mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#define STATE_TEXTURE            (1 << 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
// Texture stage state which is used when mask is involved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
// (text rendering, maskfill)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#define STATE_TEXTURE_STAGE_MASK (1 << 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
// Texture stage state which is used when doing texture
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
// mapping in blits
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#define STATE_TEXTURE_STAGE_BLIT (1 << 2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
// Texture stage state which is used when not doing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
// texture mapping, only use diffuse color
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#define STATE_TEXTURE_STAGE_POLY (1 << 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
// Texture mapping operation which involves mask texture
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#define STATE_MASKOP             (STATE_TEXTURE|STATE_TEXTURE_STAGE_MASK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
// Texture mapping operation which involves image texture
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#define STATE_BLITOP             (STATE_TEXTURE|STATE_TEXTURE_STAGE_BLIT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
// Rendering operation which doesn't use texture mapping
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#define STATE_RENDEROP           (STATE_TEXTURE_STAGE_POLY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
// The max. stage number we currently use (could not be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
// larger than 7)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#define MAX_USED_TEXTURE_STAGE 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
// - Texture pixel format table  -------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#define TR_OPAQUE      java_awt_Transparency_OPAQUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
#define TR_BITMASK     java_awt_Transparency_BITMASK
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
#define TR_TRANSLUCENT java_awt_Transparency_TRANSLUCENT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
// depth indices for the D3DTextureTable type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
#define DEPTH16_IDX 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#define DEPTH24_IDX 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#define DEPTH32_IDX 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#define DEPTH_MAX_IDX 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
// corresponding transparency indices for the D3DTextureTable type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#define TR_OPAQUE_IDX 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#define TR_BITMASK_IDX 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
#define TR_TRANSLUCENT_IDX 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
#define TR_MAX_IDX 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
typedef struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    DDPIXELFORMAT pddpf;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    jint  pfType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
} D3DTextureTableCell;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
// texture table:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
// [transparency={OPAQUE,BITMASK,TRANCLUCENT},depth={16,24,32}]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
typedef D3DTextureTableCell D3DTextureTable[TR_MAX_IDX][DEPTH_MAX_IDX];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
// - D3DContext class  -----------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * This class provides the following functionality:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 *  - holds the state of D3DContext java class (current pixel color,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 *    alpha compositing mode, extra alpha)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 *  - provides access to IDirect3DDevice7 interface (creation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 *    disposal, exclusive access)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 *  - handles state changes of the direct3d device (transform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 *    compositing mode, current texture)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 *  - provides means of creating textures, plain surfaces
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 *  - holds a glyph cache texture for the associated device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 *  - implements primitives batching mechanism
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
class D3DContext {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
public:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * Creates and returns D3DContext instance. If created context was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * unable to initialize d3d device or if the device tests failed,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * returns NULL.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    static D3DContext* CreateD3DContext(DDraw *ddObject, DXObject* dxObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * Releases the old device (if there was one) and all associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * resources, re-creates, initializes and tests the new device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * If the device doesn't pass the test, it's released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * Used when the context is first created, and then after a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * display change event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * Note that this method also does the necessary registry checks,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * and if the registry shows that we've crashed when attempting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * to initialize and test the device last time, it doesn't attempt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * to create/init/test the device.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    void    CreateD3DDevice();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    void    Release3DDevice();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    virtual ~D3DContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * Stores a weak reference of passed D3DContext object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * This method is called from _getNativeDeviceCaps method, and does the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * association of the native D3DContext with the corresponding java object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * We need a reference to the java object so it can be notified when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * the native context is released or recreated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * See jobject jD3DContext field
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    void SetJavaContext(JNIEnv *env, jobject jd3dc);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * Methods to get/release exclusive access to the direct3d device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * interface. Note that some methods of this class assume that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * lock is already taken. They're marked with 'NOLOCK' comment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * Those methods not dealing with the d3d device interface are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * required to obtain the lock (and not marked with NOLOCK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    void GetExclusiveAccess() { CRITICAL_SECTION_ENTER(deviceLock);}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    void ReleaseExclusiveAccess() { CRITICAL_SECTION_LEAVE(deviceLock);}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    // methods replicating java-level D3DContext objext
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    void SetColor(jint eargb, jint flags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    void SetAlphaComposite(jint rule, jfloat extraAlpha, jint flags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    void ResetComposite();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    // Glyph cache-related methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    HRESULT /*NOLOCK*/ InitGlyphCache();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    HRESULT /*NOLOCK*/ GlyphCacheAdd(JNIEnv *env, GlyphInfo *glyph);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    HRESULT /*NOLOCK*/ UploadImageToTexture(DXSurface *texture, jubyte *pixels,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                                            jint dstx, jint dsty,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                                            jint srcx, jint srcy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                                            jint srcWidth, jint srcHeight,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                                            jint srcStride);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    DXSurface /*NOLOCK*/ *GetGlyphCacheTexture() { return lpGlyphCacheTexture; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    DXSurface /*NOLOCK*/ *GetMaskTexture();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    GlyphCacheInfo *GetGlyphCache() { return glyphCache; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    HRESULT CreateSurface(JNIEnv *env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                          jint width, jint height, jint depth,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                          jint transparency, jint d3dSurfaceType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                          DXSurface** dxSurface, jint* pType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * Attaches a depth buffer to the specified dxSurface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * If depthBufferFormat is not initialized (depthBufferFormat.dwSize == 0),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * it will be initialized at the time of the call.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * If the buffer for this surface already exists, a "lost" status of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * depth buffer is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    HRESULT AttachDepthBuffer(DXSurface *dxSurface);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    // methods for dealing with device capabilities as determined by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    // methods in D3DRuntimeTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    int GetDeviceCaps() { return deviceCaps; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    void SetDeviceCaps(int caps) { deviceCaps = caps; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    // Returns the texture pixel format table
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    D3DTextureTable &GetTextureTable() { return textureTable; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    DDrawSurface *GetTargetSurface() { return ddTargetSurface; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    IDirect3DDevice7 *Get3DDevice() { return d3dDevice; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    // IDirect3DDevice7-delegation methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * This method only sets the texture if it's not already set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    HRESULT /*NOLOCK*/ SetTexture(DXSurface *dxSurface, DWORD dwStage = 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    HRESULT SetRenderTarget(DDrawSurface *lpSurface);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    HRESULT SetTransform(jobject xform,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                         jdouble m00, jdouble m10,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                         jdouble m01, jdouble m11,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                         jdouble m02, jdouble m12);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    HRESULT SetClip(JNIEnv *env, jobject clip,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                    jboolean isRect,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                    int x1, int y1, int x2, int y2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    DWORD GetMinTextureWidth() { return d3dDevDesc.dwMinTextureWidth; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    DWORD GetMinTextureHeight() { return d3dDevDesc.dwMinTextureHeight; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    DWORD GetMaxTextureWidth() { return d3dDevDesc.dwMaxTextureWidth; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    DWORD GetMaxTextureHeight() { return d3dDevDesc.dwMaxTextureHeight; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    DWORD GetMaxTextureAspectRatio()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        { return d3dDevDesc.dwMaxTextureAspectRatio; };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    BOOL IsPow2TexturesOnly()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        { return d3dDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_POW2; };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    BOOL IsSquareTexturesOnly()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        { return d3dDevDesc.dpcTriCaps.dwTextureCaps &
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
              D3DPTEXTURECAPS_SQUAREONLY; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * This method invalidates the java-level D3DContext object if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * the passed DDrawSurface is the current render target.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * The invalidation needs to be done so that the D3DContext object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * resets itself in case the native d3d device has been recreated, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * the target surface has been lost (in which case this method is called
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * from D3DSD_RestoreSurface function, see D3DSD_RestoreSurface for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * more info).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    void InvalidateIfTarget(JNIEnv *env, DDrawSurface *lpSurface);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    // primitives batching-related methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * Calls devices's BeginScene if there weren't one already pending,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * sets the pending flag.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    HRESULT /*NOLOCK*/ BeginScene(jbyte newState);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * Only calls device's EndScene if ddResult is an error.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    HRESULT /*NOLOCK*/ EndScene(HRESULT ddResult);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * forces the end of batching by calling EndScene if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * there was BeginScene pending.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    HRESULT /*NOLOCK*/ ForceEndScene();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * flushes the queue if the argument is this device's render target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    void    FlushD3DQueueForTarget(DDrawSurface *ddSurface);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    // fields replicating D3DContext class' fields
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    jint       compState;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    jfloat     extraAlpha;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    jint       colorPixel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    // pixel for vertices used in blits via texture mapping,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    // set in SetAlphaComposite()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    jint       blitPolygonPixel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * Current operation state.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * See STATE_* macros above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    jbyte      opState;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
private:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    D3DContext(DDraw *ddObject, DXObject* dxObject);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    HRESULT InitD3DDevice(IDirect3DDevice7 *d3dDevice);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * This method releases an old device, creates a new one,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * runs d3d caps tests on it and sets the device caps according
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * to the results.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    HRESULT /*NOLOCK*/ CreateAndTestD3DDevice(DxCapabilities *dxCaps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    HRESULT /*NOLOCK*/ InitMaskTileTexture();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    void    /*NOLOCK*/ UpdateState(jbyte newState);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
    IDirect3DDevice7        *d3dDevice;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    IDirect3D7              *d3dObject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
    DDraw                   *ddObject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    DXObject                *dxObject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
    const GUID              *pDeviceGUID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    DDrawSurface            *ddTargetSurface;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    DXSurface               *lpMaskTexture;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    DXSurface               *lpGlyphCacheTexture;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    D3DTextureTable         textureTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    DDPIXELFORMAT           depthBufferFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
    DDPIXELFORMAT           maskTileTexFormat;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    GlyphCacheInfo          *glyphCache;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    BOOL                    glyphCacheAvailable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    // array of the textures currently set to the device
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
    IDirectDrawSurface7     *lastTexture[MAX_USED_TEXTURE_STAGE+1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * A weak reference to the java-level D3DContext object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * Used to invalidate the java D3DContext object if the device has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * recreated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * See SetJavaContext() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    jobject jD3DContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    D3DDEVICEDESC7 d3dDevDesc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    int deviceCaps;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    BOOL bIsHWRasterizer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * Used to implement simple primitive batching.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * See BeginScene/EndScene/ForceEndScene.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    BOOL    bBeginScenePending;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
#ifdef DEBUG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
    int endSceneQueueDepth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
#endif /* DEBUG */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    CriticalSection deviceLock;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
// - Various vertex formats -------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
#define D3DFVF_J2DLVERTEX (D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
typedef struct _J2DLVERTEX {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    float x, y, z;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    DWORD color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    float tu, tv;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
} J2DLVERTEX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
 * We're still debating whether to use a single vertex format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
 * for all primitives or specific per-primitive formats.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
 * Using different vertex formats reduces the amount of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
 * data being sent to the video board, and this shows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
 * benetits when running Java2D benchmarks.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
 * However, in a typical Swing application the number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
 * of primitives of the same type rendered in a row is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
 * relatively small, which means that the driver has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
 * to spend more time state switching to account for different
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
 * vertex formats (and according to MSDN, switching vertex format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
 * is a very expensive operation). So for this kind of application
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
 * it's better to stick with a single vertex format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
#define USE_SINGLE_VERTEX_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
#ifndef USE_SINGLE_VERTEX_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
#define D3DFVF_J2D_XY_C (D3DFVF_XYZ | D3DFVF_DIFFUSE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
#define D3DFVF_XY_VERTEX D3DFVF_XYZ
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
typedef struct _J2D_XY_C_VERTEX {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    float x, y, z;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    DWORD color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
} J2D_XY_C_VERTEX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
typedef struct _J2D_XY_VERTEX {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    float x, y, z;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
} J2D_XY_VERTEX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
#else // USE_SINGLE_VERTEX_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
// When using a single vertex format, define
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
// every format as J2DLVERTEX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
#define D3DFVF_J2D_XY_C D3DFVF_J2DLVERTEX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
#define D3DFVF_XY_VERTEX D3DFVF_J2DLVERTEX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
typedef J2DLVERTEX J2D_XY_C_VERTEX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
typedef J2DLVERTEX J2D_XY_VERTEX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
#endif // USE_SINGLE_VERTEX_FORMAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
typedef J2DLVERTEX      J2DLV_QUAD[4];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
typedef J2DLVERTEX      J2DLV_HEXA[6];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
typedef J2D_XY_C_VERTEX J2DXYC_HEXA[6];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
typedef J2D_XY_VERTEX   J2DXY_HEXA[6];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
#define MAX_CACHED_SPAN_VX_NUM 100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
// - Helper Macros ---------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
#define D3D_DEPTH_IDX(DEPTH) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
  (((DEPTH) <= 16) ? DEPTH16_IDX : \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    (((DEPTH) <= 24) ? DEPTH24_IDX : DEPTH32_IDX))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
#define D3D_TR_IDX(TRAN) ((TRAN) - 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
#define D3DSD_MASK_TILE_SIZE 32
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
#define D3D_GCACHE_WIDTH 512
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
#define D3D_GCACHE_HEIGHT 512
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
#define D3D_GCACHE_CELL_WIDTH 16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
#define D3D_GCACHE_CELL_HEIGHT 16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
#define D3DC_NO_CONTEXT_FLAGS \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    sun_java2d_d3d_D3DContext_NO_CONTEXT_FLAGS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
#define D3DC_SRC_IS_OPAQUE    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    sun_java2d_d3d_D3DContext_SRC_IS_OPAQUE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
#define J2D_D3D_FAILURE \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    sun_java2d_d3d_D3DContext_J2D_D3D_FAILURE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
#define J2D_D3D_PLAIN_SURFACE_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    sun_java2d_d3d_D3DContext_J2D_D3D_PLAIN_SURFACE_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
#define J2D_D3D_OP_TEXTURE_SURFACE_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    sun_java2d_d3d_D3DContext_J2D_D3D_OP_TEXTURE_SURFACE_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
#define J2D_D3D_BM_TEXTURE_SURFACE_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    sun_java2d_d3d_D3DContext_J2D_D3D_BM_TEXTURE_SURFACE_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
#define J2D_D3D_TR_TEXTURE_SURFACE_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    sun_java2d_d3d_D3DContext_J2D_D3D_TR_TEXTURE_SURFACE_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
#define J2D_D3D_DEPTH_SURFACE_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
    sun_java2d_d3d_D3DContext_J2D_D3D_DEPTH_SURFACE_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
#define J2D_D3D_OP_RTT_SURFACE_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
    sun_java2d_d3d_D3DContext_J2D_D3D_OP_RTT_SURFACE_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
#define J2D_D3D_LINES_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    sun_java2d_d3d_D3DContext_J2D_D3D_LINES_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
#define J2D_D3D_TEXTURE_BLIT_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    sun_java2d_d3d_D3DContext_J2D_D3D_TEXTURE_BLIT_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
#define J2D_D3D_TEXTURE_TRANSFORM_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
    sun_java2d_d3d_D3DContext_J2D_D3D_TEXTURE_TRANSFORM_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
#define J2D_D3D_LINE_CLIPPING_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    sun_java2d_d3d_D3DContext_J2D_D3D_LINE_CLIPPING_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
#define J2D_D3D_DEVICE_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    sun_java2d_d3d_D3DContext_J2D_D3D_DEVICE_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
#define J2D_D3D_PIXEL_FORMATS_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    sun_java2d_d3d_D3DContext_J2D_D3D_PIXEL_FORMATS_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
#define J2D_D3D_SET_TRANSFORM_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    sun_java2d_d3d_D3DContext_J2D_D3D_SET_TRANSFORM_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
#define J2D_D3D_HW_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    sun_java2d_d3d_D3DContext_J2D_D3D_HW_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
#define J2D_D3D_ENABLED_OK \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    sun_java2d_d3d_D3DContext_J2D_D3D_ENABLED_OK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
#endif D3DCONTEXT_H