jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h
author ohair
Tue, 28 Dec 2010 15:53:50 -0800
changeset 7668 d4a77089c587
parent 7489 9136c8c7d74c
permissions -rw-r--r--
6962318: Update copyright year Reviewed-by: xdono
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 7489
diff changeset
     2
 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
2
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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 888
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 888
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
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
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 888
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 888
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 888
diff changeset
    23
 * questions.
2
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 _WIN32SURFACEDATA_H_
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#define _WIN32SURFACEDATA_H_
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "SurfaceData.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#include "colordata.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#include "awt_Brush.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#include "awt_Pen.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#include "awt_Win32GraphicsDevice.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#include "stdhdrs.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#define TEST_SURFACE_BITS(a,f) (((a)&(f)) == (f))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * This include file contains support definitions for loops using the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * SurfaceData interface to talk to a Win32 drawable from native code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    47
typedef struct _GDIWinSDOps GDIWinSDOps;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#define CONTEXT_NORMAL 0
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#define CONTEXT_DISPLAY_CHANGE 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#define CONTEXT_ENTER_FULL_SCREEN 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#define CONTEXT_CHANGE_BUFFER_COUNT 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#define CONTEXT_EXIT_FULL_SCREEN 4
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 definitions of the various attribute flags for requesting
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * which rendering objects should be selected into the HDC returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * from GetDC().
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#define PEN             1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#define NOPEN           2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#define BRUSH           4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#define NOBRUSH         8
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#define CLIP            16              /* For tracking purposes only */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
#define PENBRUSH        (PEN | BRUSH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#define PENONLY         (PEN | NOBRUSH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
#define BRUSHONLY       (BRUSH | NOPEN)
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 retrieves an HDC for rendering to the destination
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
    71
 * managed by the indicated GDIWinSDOps structure.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * The env parameter should be the JNIEnv of the surrounding JNI context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * The ops parameter should be a pointer to the ops object upon which
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * this function is being invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * The flags parameter should be an inclusive OR of any of the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * flags defined above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * The patrop parameter should be a pointer to a jint that will receive
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * the appropriate ROP code (PATCOPY or PATINVERT) based on the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * composite, or NULL if the ROP code will be ignored by the caller.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * The clip parameter should be a pointer to a rectangle indicating the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * desired clip.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * The comp parameter should be a pointer to a Composite object, or NULL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * which means the Src (default) compositing rule will be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * The pixel parameter should be a 24-bit XRGB value indicating the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * color that will be used for rendering.  The upper 8 bits are allowed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * to be any value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * The ReleaseDC function should be called to release the lock on the DC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * after a given atomic set of rendering operations is complete.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 *      This function may use JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
typedef HDC GetDCFunc(JNIEnv *env,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   104
                      GDIWinSDOps *wsdo,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                      jint flags,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                      jint *patrop,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                      jobject clip,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                      jobject comp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                      jint color);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * This function releases an HDC that was retrieved from the GetDC
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   113
 * function of the indicated GDIWinSDOps structure.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * The env parameter should be the JNIEnv of the surrounding JNI context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 * The ops parameter should be a pointer to the ops object upon which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * this function is being invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * The hdc parameter should be the handle to the HDC object that was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * returned from the GetDC function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 *      This function may use JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
typedef void ReleaseDCFunc(JNIEnv *env,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   129
                           GDIWinSDOps *wsdo,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                           HDC hdc);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
typedef void InvalidateSDFunc(JNIEnv *env,
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   134
                              GDIWinSDOps *wsdo);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 * A structure that holds all state global to the native surfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 * Note:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 * This structure will be shared between different threads that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * operate on the same surfaceData, so it should not contain any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * variables that could be changed by one thread thus placing other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * threads in a state of confusion.  For example, the hDC field was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 * removed because each thread now has its own shared DC.  But the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 * window field remains because once it is set for a given wsdo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 * structure it stays the same until that structure is destroyed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 */
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   149
struct _GDIWinSDOps {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    SurfaceDataOps      sdOps;
7489
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   151
    LONG                timeStamp; // creation time stamp.
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   152
                                   // Doesn't store a real time -
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   153
                                   // just counts creation events of this structure
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   154
                                   // made by GDIWindowSurfaceData_initOps()
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   155
                                   // see bug# 6859086
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    jboolean            invalid;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    GetDCFunc           *GetDC;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    ReleaseDCFunc       *ReleaseDC;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    InvalidateSDFunc    *InvalidateSD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    jint                lockType;       // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    jint                lockFlags;      // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    jobject             peer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    HWND                window;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    RECT                insets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    jint                depth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    jint                pixelStride;    // Bytes per pixel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    DWORD               pixelMasks[3];  // RGB Masks for Windows DIB creation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    HBITMAP             bitmap;         // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    HBITMAP             oldmap;         // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    HDC                 bmdc;           // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    int                 bmScanStride;   // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    int                 bmWidth;        // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    int                 bmHeight;       // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    void                *bmBuffer;      // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    jboolean            bmCopyToScreen; // Used to track whether we
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                                        // actually should copy the bitmap
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                                        // to the screen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    AwtBrush            *brush;         // used for offscreen surfaces only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    jint                brushclr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    AwtPen              *pen;           // used for offscreen surfaces only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    jint                penclr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    int                 x, y, w, h;     // REMIND: store in TLS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    CriticalSection     *surfaceLock;   // REMIND: try to remove
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    AwtWin32GraphicsDevice *device;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
#define WIN32SD_LOCK_UNLOCKED   0       /* surface is not locked */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
#define WIN32SD_LOCK_BY_NULL    1       /* surface locked for NOP */
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   190
#define WIN32SD_LOCK_BY_DIB     2       /* surface locked by BitBlt */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
extern "C" {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
 * Structure for holding the graphics state of a thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    HDC         hDC;
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   199
    GDIWinSDOps *wsdo;
7489
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   200
    LONG        wsdoTimeStamp; // wsdo creation time stamp.
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   201
                               // Other threads may deallocate wsdo
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   202
                               // and then allocate a new GDIWinSDOps
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   203
                               // structure at the same memory location.
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   204
                               // Time stamp is the only way to detect if
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   205
                               // wsdo got changed.
9136c8c7d74c 6859086: Dialog created by JOptionPane.showMessageDialog does not repaint sometimes
miroslawzn
parents: 5506
diff changeset
   206
                               // see bug# 6859086
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    RECT        bounds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    jobject     clip;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    jobject     comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    jint        xorcolor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    jint        patrop;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    jint        type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    AwtBrush    *brush;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    jint        brushclr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    AwtPen      *pen;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    jint        penclr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
} ThreadGraphicsInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
/*
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   221
 * This function returns a pointer to a native GDIWinSDOps structure
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
 * for accessing the indicated Win32 SurfaceData Java object.  It
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
 * verifies that the indicated SurfaceData object is an instance
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   224
 * of GDIWindowSurfaceData before returning and will return NULL if the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
 * wrong SurfaceData object is being accessed.  This function will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
 * throw the appropriate Java exception if it returns NULL so that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
 * the caller can simply return.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
 *      This function uses JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
 *      The caller may continue to use JNI methods after this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
 *      is called since this function will not leave any outstanding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
 *      JNI Critical locks unreleased.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
 */
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   238
JNIEXPORT GDIWinSDOps * JNICALL
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   239
GDIWindowSurfaceData_GetOps(JNIEnv *env, jobject sData);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   241
JNIEXPORT GDIWinSDOps * JNICALL
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   242
GDIWindowSurfaceData_GetOpsNoSetup(JNIEnv *env, jobject sData);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
JNIEXPORT HWND JNICALL
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   245
GDIWindowSurfaceData_GetWindow(JNIEnv *env, GDIWinSDOps *wsdo);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
JNIEXPORT void JNICALL
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   248
GDIWinSD_InitDC(JNIEnv *env, GDIWinSDOps *wsdo, ThreadGraphicsInfo *info,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
               jint type, jint *patrop,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
               jobject clip, jobject comp, jint color);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
JNIEXPORT AwtComponent * JNICALL
887
0aab8d3fa11a 6725214: D3D: forward-port the new pipeline from 6u10
tdv
parents: 2
diff changeset
   253
GDIWindowSurfaceData_GetComp(JNIEnv *env, GDIWinSDOps *wsdo);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
} /* extern "C" */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
#endif _WIN32SURFACEDATA_H_