src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 33653 jdk/src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c@c1ee09fe3274
child 50471 f0aeede1b855
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
33653
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32427
diff changeset
     2
 * Copyright (c) 2005, 2015, 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
#include "splashscreen_impl.h"
23320
fa1a77a296fc 8033573: [parfait] warning from b128 for share/native/sun/awt/splashscreen/java_awt_SplashScreen.c: JNI exception pending
serb
parents: 18232
diff changeset
    27
#include <jlong_md.h>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include <jni.h>
23320
fa1a77a296fc 8033573: [parfait] warning from b128 for share/native/sun/awt/splashscreen/java_awt_SplashScreen.c: JNI exception pending
serb
parents: 18232
diff changeset
    29
#include <jni_util.h>
18232
b538b71fb429 8009071: Improve shape handling
anthony
parents: 5506
diff changeset
    30
#include <sizecalc.h>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
JNIEXPORT jint JNICALL
33653
c1ee09fe3274 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32427
diff changeset
    33
DEF_JNI_OnLoad(JavaVM * vm, void *reserved)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
    return JNI_VERSION_1_2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
/* FIXME: safe_ExceptionOccured, why and how? */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
* Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
* Method:    _update
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
* Signature: (J[IIIIII)V
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
Java_java_awt_SplashScreen__1update(JNIEnv * env, jclass thisClass,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
                                    jlong jsplash, jintArray data,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
                                    jint x, jint y, jint width, jint height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
                                    jint stride)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    int dataSize;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    if (!splash) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    SplashLock(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    dataSize = (*env)->GetArrayLength(env, data);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    if (splash->overlayData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        free(splash->overlayData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    }
18232
b538b71fb429 8009071: Improve shape handling
anthony
parents: 5506
diff changeset
    62
    splash->overlayData = SAFE_SIZE_ARRAY_ALLOC(malloc, dataSize, sizeof(rgbquad_t));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    if (splash->overlayData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        /* we need a copy anyway, so we'll be using GetIntArrayRegion */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        (*env)->GetIntArrayRegion(env, data, 0, dataSize,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            (jint *) splash->overlayData);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        initFormat(&splash->overlayFormat, 0xFF0000, 0xFF00, 0xFF, 0xFF000000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        initRect(&splash->overlayRect, x, y, width, height, 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            stride * sizeof(rgbquad_t), splash->overlayData,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            &splash->overlayFormat);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        SplashUpdate(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    SplashUnlock(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
* Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
* Method:    _isVisible
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
* Signature: (J)Z
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
JNIEXPORT jboolean JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
Java_java_awt_SplashScreen__1isVisible(JNIEnv * env, jclass thisClass,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                                       jlong jsplash)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    if (!splash) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        return JNI_FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    return splash->isVisible>0 ? JNI_TRUE : JNI_FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
* Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
* Method:    _getBounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
* Signature: (J)Ljava/awt/Rectangle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
JNIEXPORT jobject JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
Java_java_awt_SplashScreen__1getBounds(JNIEnv * env, jclass thisClass,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                                       jlong jsplash)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    static jclass clazz = NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    static jmethodID mid = NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    jobject bounds = NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    if (!splash) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        return NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    SplashLock(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    if (!clazz) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        clazz = (*env)->FindClass(env, "java/awt/Rectangle");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        if (clazz) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            clazz = (*env)->NewGlobalRef(env, clazz);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    if (clazz && !mid) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        mid = (*env)->GetMethodID(env, clazz, "<init>", "(IIII)V");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    if (clazz && mid) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        bounds = (*env)->NewObject(env, clazz, mid, splash->x, splash->y,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
            splash->width, splash->height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        if ((*env)->ExceptionOccurred(env)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            bounds = NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            (*env)->ExceptionDescribe(env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            (*env)->ExceptionClear(env);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    SplashUnlock(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    return bounds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
* Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
* Method:    _getInstance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
* Signature: ()J
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
JNIEXPORT jlong JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
Java_java_awt_SplashScreen__1getInstance(JNIEnv * env, jclass thisClass)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    return ptr_to_jlong(SplashGetInstance());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
* Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
* Method:    _close
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
* Signature: (J)V
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
JNIEXPORT void JNICALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
Java_java_awt_SplashScreen__1close(JNIEnv * env, jclass thisClass,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                                   jlong jsplash)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    if (!splash) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    SplashLock(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    SplashClosePlatform(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    SplashUnlock(splash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
 * Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
 * Method:    _getImageFileName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
 * Signature: (J)Ljava/lang/String;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
JNIEXPORT jstring JNICALL Java_java_awt_SplashScreen__1getImageFileName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    (JNIEnv * env, jclass thisClass, jlong jsplash)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    if (!splash || !splash->fileName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        return NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /* splash->fileName is of type char*, but in fact it contains jchars */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    return (*env)->NewString(env, (const jchar*)splash->fileName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                             splash->fileNameLen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 * Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
 * Method:    _getImageJarName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
 * Signature: (J)Ljava/lang/String;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
JNIEXPORT jstring JNICALL Java_java_awt_SplashScreen__1getImageJarName
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
  (JNIEnv * env, jclass thisClass, jlong jsplash)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    if (!splash || !splash->jarName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        return NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    /* splash->jarName is of type char*, but in fact it contains jchars */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    return (*env)->NewString(env, (const jchar*)splash->jarName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                             splash->jarNameLen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 * Class:     java_awt_SplashScreen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 * Method:    _setImageData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
 * Signature: (J[B)Z
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
JNIEXPORT jboolean JNICALL Java_java_awt_SplashScreen__1setImageData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
  (JNIEnv * env, jclass thisClass, jlong jsplash, jbyteArray data)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    int size, rc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    jbyte* pBytes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    if (!splash) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        return JNI_FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    }
23320
fa1a77a296fc 8033573: [parfait] warning from b128 for share/native/sun/awt/splashscreen/java_awt_SplashScreen.c: JNI exception pending
serb
parents: 18232
diff changeset
   216
    pBytes = (*env)->GetByteArrayElements(env, data, NULL);
fa1a77a296fc 8033573: [parfait] warning from b128 for share/native/sun/awt/splashscreen/java_awt_SplashScreen.c: JNI exception pending
serb
parents: 18232
diff changeset
   217
    CHECK_NULL_RETURN(pBytes, JNI_FALSE);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    size = (*env)->GetArrayLength(env, data);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    rc = SplashLoadMemory(pBytes, size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    (*env)->ReleaseByteArrayElements(env, data, pBytes, JNI_ABORT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    return rc ? JNI_TRUE : JNI_FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
}
25552
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   223
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   224
/*
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   225
 * Class:     java_awt_SplashScreen
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   226
 * Method:    _getScaleFactor
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   227
 * Signature: (J)F
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   228
 */
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   229
JNIEXPORT jfloat JNICALL Java_java_awt_SplashScreen__1getScaleFactor
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   230
(JNIEnv *env, jclass thisClass, jlong jsplash)
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   231
{
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   232
    Splash *splash = (Splash *) jlong_to_ptr(jsplash);
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   233
    if (!splash) {
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   234
        return 1;
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   235
    }
96abb01815f6 8043869: [macosx] java -splash does not honor @2x hi dpi notation for retina support
alexsch
parents: 23328
diff changeset
   236
    return splash->scaleFactor;
32427
c22b7e41adf3 8134984: Text files should end in exactly one newline
martin
parents: 25859
diff changeset
   237
}