src/java.desktop/share/native/libawt/java2d/SurfaceData.h
author ihse
Wed, 28 Mar 2018 23:56:08 +0200
changeset 49440 396ea30afbd5
parent 47216 71c04702a3d5
child 56721 01b558efd286
permissions -rw-r--r--
8200178: Remove mapfiles for JDK native libraries Reviewed-by: erikj, alanb, mchung, prr, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
     2
 * Copyright (c) 1999, 2018, 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: 2
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: 2
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: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
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
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * This include file contains information on how to use a SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * object from native code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#ifndef _Included_SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#define _Included_SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#include <jni.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
extern "C" {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * This structure is used to represent a rectangular bounding box
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * throughout various functions in the native SurfaceData API.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * All coordinates (x1 <= x < x2, y1 <= y < y2) are considered to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * be inside these bounds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    jint x1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    jint y1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    jint x2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    jint y2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
} SurfaceDataBounds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#define SD_RASINFO_PRIVATE_SIZE         64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * The SurfaceDataRasInfo structure is used to pass in and return various
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * pieces of information about the destination drawable.  In particular:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *      SurfaceDataBounds bounds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * [Needed for SD_LOCK_READ or SD_LOCK_WRITE]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * The 2 dimensional bounds of the raster array that is needed.  Valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * memory locations are required at:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *      *(pixeltype *) (((char *)rasBase) + y * scanStride + x * pixelStride)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * for each x, y pair such that (bounds.x1 <= x < bounds.x2) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * (bounds.y1 <= y < bounds.y2).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 *      void *rasBase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * [Requires SD_LOCK_READ or SD_LOCK_WRITE]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * A pointer to the device space origin (0, 0) of the indicated raster
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * data.  This pointer may point to a location that is outside of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * allocated memory for the requested bounds and it may even point
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * outside of accessible memory.  Only the locations that fall within
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * the coordinates indicated by the requested bounds are guaranteed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * to be accessible.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 *      jint pixelBitOffset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * [Requires SD_LOCK_READ or SD_LOCK_WRITE]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * The number of bits offset from the beginning of the first byte
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * of a scanline to the first bit of the first pixel on that scanline.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * The bit offset must be less than 8 and it must be the same for each
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * scanline.  This field is only needed by image types which pack
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * multiple pixels into a byte, such as ByteBinary1Bit et al.  For
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * image types which use whole bytes (or shorts or ints) to store
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 * their pixels, this field will always be 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 *      jint pixelStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * [Requires SD_LOCK_READ or SD_LOCK_WRITE]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * The pixel stride is the distance in bytes from the data for one pixel
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * to the data for the pixel at the next x coordinate (x, y) => (x+1, y).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * For data types that pack multiple pixels into a byte, such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * ByteBinary1Bit et al, this field will be 0 and the loops which
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * render to and from such data need to calculate their own offset
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * from the beginning of the scanline using the absolute x coordinate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * combined with the pixelBitOffset field.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * Bugfix 6220829 - this field used to be unsigned int, but some
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * primitives used negative pixel offsets and the corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * unsigned stride values caused the resulting pixel offset to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 * to always be a positive 32-bit quantity - causing problems on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * 64-bit architectures.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 *      jint scanStride;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * [Requires SD_LOCK_READ or SD_LOCK_WRITE]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * The scan stride is the distance in bytes from the data for one pixel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * to the data for the pixel at the next y coordinate (x, y) => (x, y+1).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * Bugfix 6220829 - this field used to be unsigned int, but some
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * primitives used negative pixel offsets and the corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * unsigned stride values caused the resulting pixel offset to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * to always be a positive 32-bit quantity - causing problems on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * 64-bit architectures.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 *      unsigned int lutSize;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 * [Requires SD_LOCK_LUT]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 * The number of entries in the color lookup table.  The data beyond the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * end of the map will be undefined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 *      jint *lutBase;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * [Requires SD_LOCK_LUT]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 * A pointer to the beginning of the color lookup table for the colormap.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * The color lookup table is formatted as an array of jint values each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * representing the 32-bit ARGB color for the pixel representing by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 * corresponding index.  The table is guaranteed to contain at least 256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 * valid memory locations even if the size of the map is smaller than 256.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 *      unsigned char *invColorTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * [Requires SD_LOCK_INVCOLOR]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 * A pointer to the beginning of the inverse color lookup table for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 * colormap.  The inverse color lookup table is formatted as a 32x32x32
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * array of bytes indexed by RxGxB where each component is reduced to 5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 * bits of precision before indexing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 *      char *redErrTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 *      char *grnErrTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
 *      char *bluErrTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
 * [Requires SD_LOCK_INVCOLOR]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 * Pointers to the beginning of the ordered dither color error tables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 * for the colormap.  The error tables are formatted as an 8x8 array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 * of bytes indexed by coordinates using the formula [y & 7][x & 7].
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 *      int *invGrayTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 * [Requires SD_LOCK_INVGRAY]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * A pointer to the beginning of the inverse gray lookup table for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * colormap.  The inverse color lookup table is formatted as an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * of 256 integers indexed by a byte gray level and storing an index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 * into the colormap of the closest matching gray pixel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 *      union priv {};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 * A buffer of private data for the SurfaceData implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
 * This field is a union of a data block of the desired default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 * size (SD_RASINFO_PRIVATE_SIZE) and a (void *) pointer that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 * ensures proper "strictest" alignment on all platforms.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
typedef struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    SurfaceDataBounds   bounds;                 /* bounds of raster array */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    void                *rasBase;               /* Pointer to (0, 0) pixel */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    jint                pixelBitOffset;         /* bit offset to (0, *) pixel */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    jint                pixelStride;            /* bytes to next X pixel */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    jint                scanStride;             /* bytes to next Y pixel */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    unsigned int        lutSize;                /* # colors in colormap */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    jint                *lutBase;               /* Pointer to colormap[0] */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    unsigned char       *invColorTable;         /* Inverse color table */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    char                *redErrTable;           /* Red ordered dither table */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    char                *grnErrTable;           /* Green ordered dither table */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    char                *bluErrTable;           /* Blue ordered dither table */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    int                 *invGrayTable;          /* Inverse gray table */
37798
e1de34b6475c 7116979: Unexpected pixel colour when converting images to TYPE_BYTE_INDEXED
jdv
parents: 26751
diff changeset
   166
    int                 representsPrimaries;    /* whether cmap represents primary colors */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    union {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        void            *align;                 /* ensures strict alignment */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        char            data[SD_RASINFO_PRIVATE_SIZE];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    } priv;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
} SurfaceDataRasInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
typedef struct _SurfaceDataOps SurfaceDataOps;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
 * This function is used to lock a particular region of a particular
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
 * destination.  Once this method is called, no changes of any of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
 * data returned by any of the other SurfaceData vectored functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 * may change until a corresponding call to Release is made.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
 * The env parameter should be the JNIEnv of the surrounding JNI context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
 * The ops parameter should be a pointer to the ops object upon which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 * this function is being invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 * The rasInfo parameter should be a pointer to a SurfaceDataRasInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 * structure in which the bounds have been initialized to the maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
 * bounds of the raster data that will need to be accessed later.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
 * The lockflags parameter should indicate which information will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
 * needed by the caller.  The various flags which may be OR'd together
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
 * may consist of any of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
 *      SD_LOCK_READ            The caller needs to read pixels from the dest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
 *      SD_LOCK_WRITE           The caller needs to write pixels to the dest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
 *      SD_LOCK_RD_WR           A combination of (SD_LOCK_READ | SD_LOCK_WRITE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
 *      SD_LOCK_LUT             The caller needs the colormap (Lut)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
 *      SD_LOCK_INVCOLOR        The caller needs the inverse color table
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
 *      SD_LOCK_INVGRAY         The caller needs the inverse gray table
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
 *      SD_LOCK_FASTEST         The caller only wants direct pixel access
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
 * Note that the SD_LOCK_LUT, SD_LOCK_INVCOLOR, and SD_LOCK_INVGRAY flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
 * are only valid for destinations with IndexColorModels.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 * Also note that SD_LOCK_FASTEST will only succeed if the access to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 * pixels will occur just as fast regardless of the size of the bounds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 * This flag is used by the Text rendering routines to determine if it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 * matters whether or not they have calculated a tight bounding box for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
 * the pixels they will be touching.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
 * Return value:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
 * If this function succeeds, it will return SD_SUCCESS (0).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
 * If this function is unable to honor the SD_LOCK_FASTEST flag,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
 * it will return SD_SLOWLOCK.  The bounds parameter of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
 * SurfaceDataRasInfo object should be intersected with a tighter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
 * bounding rectangle before calling the GetRasInfo function so
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
 * as to minimize the amount pixel copying or conversion.  Note
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
 * that the Lock function may have already intersected the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
 * bounds with a tighter rectangle as it tried to honor the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
 * SD_SLOWLOCK flag and so the caller should only use intersection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
 * operations to further restrict the bounds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
 * If this function fails for any reason that is not recoverable,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
 * it will throw an appropriate Java exception and return SD_FAILED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
 * Operation:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
 * This function will intersect the bounds specified in the rasInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
 * parameter with the available raster data in the destination drawable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
 * and modify the contents of the bounds field to represent the maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
 * available raster data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
 * If the available raster data in the destination drawable consists of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
 * a non-rectangular region of pixels, this method may throw an InvalidPipe
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
 * exception (optionally the object may decide to provide a copy of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
 * destination pixel data with undefined data in the inaccessible portions).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
 * Further processing by the caller may discover that a smaller region of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
 * data is actually needed and the call to GetRasData can be made with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
 * still smaller bounds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
 *      This function may use JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
 * Note to implementers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
 *      The caller may also continue to use JNI methods after this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
 *      is called so it is important that implementations of SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
 *      not return from this function with any outstanding JNI Critical
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
 *      locks that have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
typedef jint LockFunc(JNIEnv *env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
                      SurfaceDataOps *ops,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
                      SurfaceDataRasInfo *rasInfo,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                      jint lockflags);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
 * This function returns information about the raster data for the drawable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
 * The function will fill in or modify the contents of the SurfaceDataRasInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
 * structure that is passed in with various pieces of information depending
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
 * on what was requested in the lockflags parameter that was handed into
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
 * the LockFunc.  For more information on which pieces of information are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
 * returned based upon the lock flags see the documentation for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
 * RasInfo structure above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
 * The env parameter should be the JNIEnv of the surrounding JNI context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
 * The ops parameter should be a pointer to the ops object upon which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
 * this function is being invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
 * The pRasInfo parameter should be a pointer to the same structure of type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
 * SurfaceDataRasInfo.  The bounds member of that structure should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
 * initialized to the bounding box of the raster data that is actually
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
 * needed for reading or writing before calling this function.  These
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
 * bounds must be a subset of the raster bounds that were given to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
 * LockFunc or the results will be undefined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
 * If the surface was locked with the flag SD_LOCK_FASTEST then this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
 * function may reevaluate the bounds in the RasInfo structure and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
 * return a subset of what was requested.  Callers that use that flag
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
 * should be prepared to reevaluate their clipping after GetRasInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
 * returns.  If the SD_LOCK_FASTEST flag was not specified, then this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
 * function will return a buffer containing all of the pixels in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
 * requested bounds without reevaluating them.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
 * Any information that was requested in the lockflags of the LockFunc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
 * will be returned and NULL pointers will be returned for all other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
 * information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
 *      This function may use JNI Critical methods so it is important
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
 *      that the caller not call any other JNI methods after this function
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
 *      returns until the Release function is called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
typedef void GetRasInfoFunc(JNIEnv *env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
                            SurfaceDataOps *ops,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                            SurfaceDataRasInfo *pRasInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
 * This function releases all of the Critical data for the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
 * drawable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
 * This function vector is allowed to be NULL if a given SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
 * implementation does not require the use of JNI Critical array locks.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
 * Callers should use the "SurfaceData_InvokeRelease(env, ops)" macro
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
 * to handle the conditional invocation of this function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
 * In particular, this function will release any outstanding JNI Critical
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
 * locks that the SurfaceData implementation may have used so that it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
 * will be safe for the caller to start using arbitrary JNI calls or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
 * return from its calling JNI function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
 * The env parameter should be the JNIEnv of the surrounding JNI context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
 * The ops parameter should be a pointer to the ops object upon which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
 * this function is being invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
 * The pRasInfo parameter should be a pointer to the same structure of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
 * type SurfaceDataRasInfo that was passed to the GetRasInfo function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
 * The bounds should be unchanged since that call.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
 *      This function will release any outstanding JNI Critical locks so
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
 *      it will once again be safe to use arbitrary JNI calls or return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
 *      to the enclosing JNI native context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
 * Note to implementers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
 *      This function may not use any JNI methods other than to release
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
 *      outstanding JNI Critical array locks since there may be other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
 *      nested SurfacData objects holding locks with their own outstanding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
 *      JNI Critical locks.  This restriction includes the use of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
 *      JNI monitor calls so that all MonitorExit invocations must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
 *      done in the Unlock function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
typedef void ReleaseFunc(JNIEnv *env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
                         SurfaceDataOps *ops,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                         SurfaceDataRasInfo *pRasInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
 * This function unlocks the specified drawable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
 * This function vector is allowed to be NULL if a given SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
 * implementation does not require any unlocking of the destination.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
 * Callers should use the "SurfaceData_InvokeUnlock(env, ops)" macro
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
 * to handle the conditional invocation of this function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
 * The env parameter should be the JNIEnv of the surrounding JNI context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
 * The ops parameter should be a pointer to the ops object upon which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
 * this function is being invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
 * The pRasInfo parameter should be a pointer to the same structure of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
 * type SurfaceDataRasInfo that was passed to the GetRasInfo function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
 * The bounds should be unchanged since that call.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
 *      This function may use JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
 * Note to implementers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
 *      This function may be used to release any JNI monitors used to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
 *      prevent the destination from being modified.  It may also be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
 *      used to perform operations which may require blocking (such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
 *      executing X11 operations which may need to flush data).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
typedef void UnlockFunc(JNIEnv *env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
                        SurfaceDataOps *ops,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
                        SurfaceDataRasInfo *pRasInfo);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
 * This function sets up the specified drawable.  Some surfaces may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
 * need to perform certain operations during Setup that cannot be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
 * done after later operations such as Lock.  For example, on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
 * win9x systems, when any surface is locked we cannot make a call to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
 * the message-handling thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
 * This function vector is allowed to be NULL if a given SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
 * implementation does not require any setup.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
 * The env parameter should be the JNIEnv of the surrounding JNI context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
 * The ops parameter should be a pointer to the ops object upon which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
 * this function is being invoked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
 *      This function may use JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
typedef void SetupFunc(JNIEnv *env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
                       SurfaceDataOps *ops);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
 * This function disposes the specified SurfaceDataOps structure
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
 * and associated native resources.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
 * The implementation is SurfaceData-type specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
typedef void DisposeFunc(JNIEnv *env,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                         SurfaceDataOps *ops);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
 * Constants used for return values.  Constants less than 0 are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
 * unrecoverable failures and indicate that a Java exception has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
 * already been thrown.  Constants greater than 0 are conditional
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
 * successes which warn the caller that various optional features
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
 * were not available so that workarounds can be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
#define SD_FAILURE              -1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
#define SD_SUCCESS              0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
#define SD_SLOWLOCK             1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
 * Constants for the flags used in the Lock function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
#define SD_LOCK_READ            (1 << 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
#define SD_LOCK_WRITE           (1 << 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
#define SD_LOCK_RD_WR           (SD_LOCK_READ | SD_LOCK_WRITE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
#define SD_LOCK_LUT             (1 << 2)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
#define SD_LOCK_INVCOLOR        (1 << 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
#define SD_LOCK_INVGRAY         (1 << 4)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
#define SD_LOCK_FASTEST         (1 << 5)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
#define SD_LOCK_PARTIAL         (1 << 6)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
#define SD_LOCK_PARTIAL_WRITE   (SD_LOCK_WRITE | SD_LOCK_PARTIAL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
#define SD_LOCK_NEED_PIXELS     (SD_LOCK_READ | SD_LOCK_PARTIAL)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
 * This structure provides the function vectors for manipulating
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
 * and retrieving information about the destination drawable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
 * There are also variables for the surface data object used by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
 * native code to track the state of the surface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
 * The sdObject is a pointer to the Java SurfaceData object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
 * this is set in SurfaceData_InitOps() and used by any object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
 * using the ops structure to refer to elements in the Java object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
 * (such as fields that we need to set from native code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
struct _SurfaceDataOps {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    LockFunc            *Lock;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    GetRasInfoFunc      *GetRasInfo;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    ReleaseFunc         *Release;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    UnlockFunc          *Unlock;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    SetupFunc           *Setup;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    DisposeFunc         *Dispose;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    jobject             sdObject;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
#define _ClrReduce(c)   (((unsigned char) c) >> 3)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
 * This macro performs a lookup in an inverse color table given 3 8-bit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
 * RGB primaries.  It automates the process of reducing the primaries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
 * to 5-bits of precision and using them to index into the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
 * inverse color lookup table.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
#define SurfaceData_InvColorMap(invcolortbl, r, g, b) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
    (invcolortbl)[(_ClrReduce(r)<<10) + (_ClrReduce(g)<<5) + _ClrReduce(b)]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
 * This macro invokes the SurfaceData Release function only if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
 * function vector is not NULL.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
#define SurfaceData_InvokeRelease(env, ops, pRI)        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
    do {                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
        if ((ops)->Release != NULL) {                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
            (ops)->Release(env, ops, pRI);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
        }                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
    } while(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
 * This macro invokes the SurfaceData Unlock function only if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
 * function vector is not NULL.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
#define SurfaceData_InvokeUnlock(env, ops, pRI)         \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
    do {                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
        if ((ops)->Unlock != NULL) {                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
            (ops)->Unlock(env, ops, pRI);               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        }                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
    } while(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
 * This macro invokes both the SurfaceData Release and Unlock functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
 * only if the function vectors are not NULL.  It can be used in cases
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
 * where only one surface has been accessed and where no other JNI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
 * Critical locks (which would need to be released after Release and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
 * before Unlock) are held by the calling function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
#define SurfaceData_InvokeReleaseUnlock(env, ops, pRI)  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
    do {                                                \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
        if ((ops)->Release != NULL) {                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
            (ops)->Release(env, ops, pRI);              \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
        }                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
        if ((ops)->Unlock != NULL) {                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
            (ops)->Unlock(env, ops, pRI);               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
        }                                               \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
    } while(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
 * This macro invokes both the SurfaceData Release and Unlock functions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
 * on two nested drawables only if the function vectors are not NULL.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
 * It can be used in cases where two surfaces have been accessed and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
 * where no other JNI Critical locks (which would need to be released
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
 * after Release and before Unlock) are held by the calling function.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
 * two ops vectors should be specified in the same order that they were
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
 * locked.  Both surfaces will be released and then both unlocked.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
#define SurfaceData_InvokeReleaseUnlock2(env, ops1, pRI1, ops2, pRI2)   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
    do {                                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
        if ((ops2)->Release != NULL) {                          \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
            (ops2)->Release(env, ops2, pRI2);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
        }                                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
        if ((ops1)->Release != NULL) {                          \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
            (ops1)->Release(env, ops1, pRI1);                   \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
        }                                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
        if ((ops2)->Unlock != NULL) {                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
            (ops2)->Unlock(env, ops2, pRI2);                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
        }                                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
        if ((ops1)->Unlock != NULL) {                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
            (ops1)->Unlock(env, ops1, pRI1);                    \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
        }                                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
    } while(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
#define SurfaceData_InvokeDispose(env, ops)                     \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
    do {                                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
        if ((ops)->Dispose != NULL) {                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
            (ops)->Dispose(env, ops);                           \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
        }                                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    } while(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
#define SurfaceData_InvokeSetup(env, ops)                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
    do {                                                        \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
        if ((ops)->Setup != NULL) {                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
            (ops)->Setup(env, ops);                             \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
        }                                                       \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
    } while(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
 * This function returns a pointer to a native SurfaceDataOps
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
 * structure for accessing the indicated SurfaceData Java object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
 *      This function uses JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
 *      The caller may continue to use JNI methods after this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
 *      is called since this function will not leave any outstanding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
 *      JNI Critical locks unreleased.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
JNIEXPORT SurfaceDataOps * JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
SurfaceData_GetOps(JNIEnv *env, jobject sData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
 * Does the same as the above, but doesn't call Setup function
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
 * even if it's set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
JNIEXPORT SurfaceDataOps * JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
SurfaceData_GetOpsNoSetup(JNIEnv *env, jobject sData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
 * This function stores a pointer to a native SurfaceDataOps
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
 * structure into the indicated Java SurfaceData object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
 *      This function uses JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
 *      The caller may continue to use JNI methods after this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
 *      is called since this function will not leave any outstanding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
 *      JNI Critical locks unreleased.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
SurfaceData_SetOps(JNIEnv *env, jobject sData, SurfaceDataOps *ops);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
 * This function throws an InvalidPipeException which will cause the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
 * calling SunGraphics2D object to revalidate its pipelines and call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
 * again.  This utility method should be called from the SurfaceData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
 * native Lock routine when some attribute of the surface has changed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
 * that requires pipeline revalidation, including:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
 *      The bit depth or pixel format of the surface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
 *      The surface (window) has been disposed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
 *      The device clip of the surface has been changed (resize, visibility, etc.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
 * Note to callers:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
 *      This function uses JNI methods so it is important that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
 *      caller not have any outstanding GetPrimitiveArrayCritical or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
 *      GetStringCritical locks which have not been released.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
 *      The caller may continue to use JNI methods after this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
 *      is called since this function will not leave any outstanding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
 *      JNI Critical locks unreleased.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
SurfaceData_ThrowInvalidPipeException(JNIEnv *env, const char *msg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
 * This function intersects two bounds objects which exist in the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
 * coordinate space.  The contents of the first parameter (dst) are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
 * modified to contain the intersection of the two bounds while the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
 * contents of the second parameter (src) are untouched.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
SurfaceData_IntersectBounds(SurfaceDataBounds *dst, SurfaceDataBounds *src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
 * This function intersects a bounds object with a rectangle specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
 * in lox, loy, hix, hiy format in the same coordinate space.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
 * contents of the first parameter (bounds) are modified to contain
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
 * the intersection of the two rectangular regions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
SurfaceData_IntersectBoundsXYXY(SurfaceDataBounds *bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
                                jint lox, jint loy, jint hix, jint hiy);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
 * This function intersects a bounds object with a rectangle specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
 * in XYWH format in the same coordinate space.  The contents of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
 * first parameter (bounds) are modified to contain the intersection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
 * of the two rectangular regions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
SurfaceData_IntersectBoundsXYWH(SurfaceDataBounds *bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
                                jint x, jint y, jint w, jint h);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
 * This function intersects two bounds objects which exist in different
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
 * coordinate spaces.  The coordinate spaces of the two objects are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
 * related such that a given coordinate in the space of the A bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
 * is related to the analogous coordinate in the space of the B bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
 * by the formula: (AX + BXminusAX, AY + BYminusAY) == (BX, BY).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
 * The contents of both bounds objects are modified to represent their
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
 * mutual intersection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
SurfaceData_IntersectBlitBounds(SurfaceDataBounds *Abounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
                                SurfaceDataBounds *Bbounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
                                jint BXminusAX, jint BYminusAY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
 * This function creates and initializes the ops structure.  The function
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
 * is called by "subclasses" of SurfaceData (e.g., BufImgSurfaceData)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
 * which pass in the size of the structure to allocate (subclasses generally
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
 * need additional fields in the ops structure particular to their usage
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
 * of the structure).  The structure is allocated and initialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
 * and is stored in the SurfaceData java object for later retrieval.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
 * Subclasses of SurfaceData should call this function instead of allocating
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
 * the memory directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
 */
49440
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   652
JNIEXPORT SurfaceDataOps * JNICALL
396ea30afbd5 8200178: Remove mapfiles for JDK native libraries
ihse
parents: 47216
diff changeset
   653
SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
 * This function invokes the ops-specific disposal function.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
 * It is a part of the finalizers-free disposal mechanism.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
 * (see Disposer and DefaultDisposerRecord classes for more information)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
 * It also destroys the ops structure created in SurfaceData_InitOps.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
void SurfaceData_DisposeOps(JNIEnv *env, jlong ops);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
#endif