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