mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout f6aff596b0ff (bug 779287). r=me
--HG-- extra : rebase_source : 38526eac16b3eef5fd0e006784fa61a3d37598f6
This commit is contained in:
parent
3e13f9d15d
commit
5c1ea56db9
@ -131,7 +131,7 @@ AudioRunnable::Run()
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
jbyte *byte = jenv->GetByteArrayElements(bytearray, nullptr);
|
||||
jbyte *byte = jenv->GetByteArrayElements(bytearray, NULL);
|
||||
if (!byte) {
|
||||
LOG("AudioRunnable:: Run. Could not create bytearray");
|
||||
return NS_ERROR_FAILURE;
|
||||
@ -193,13 +193,13 @@ anp_audio_newTrack(uint32_t sampleRate, // sampling rate in Hz
|
||||
void* user)
|
||||
{
|
||||
ANPAudioTrack *s = (ANPAudioTrack*) malloc(sizeof(ANPAudioTrack));
|
||||
if (s == nullptr) {
|
||||
return nullptr;
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JNIEnv *jenv = GetJNIForThread();
|
||||
if (!jenv)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
s->at_class = init_jni_bindings(jenv);
|
||||
s->rate = sampleRate;
|
||||
@ -250,10 +250,10 @@ anp_audio_newTrack(uint32_t sampleRate, // sampling rate in Hz
|
||||
s->bufferSize,
|
||||
MODE_STREAM);
|
||||
|
||||
if (autoFrame.CheckForException() || obj == nullptr) {
|
||||
if (autoFrame.CheckForException() || obj == NULL) {
|
||||
jenv->DeleteGlobalRef(s->at_class);
|
||||
free(s);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
jint state = jenv->CallIntMethod(obj, at.getstate);
|
||||
@ -261,7 +261,7 @@ anp_audio_newTrack(uint32_t sampleRate, // sampling rate in Hz
|
||||
if (autoFrame.CheckForException() || state == STATE_UNINITIALIZED) {
|
||||
jenv->DeleteGlobalRef(s->at_class);
|
||||
free(s);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s->output_unit = jenv->NewGlobalRef(obj);
|
||||
@ -271,7 +271,7 @@ anp_audio_newTrack(uint32_t sampleRate, // sampling rate in Hz
|
||||
void
|
||||
anp_audio_deleteTrack(ANPAudioTrack* s)
|
||||
{
|
||||
if (s == nullptr) {
|
||||
if (s == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ anp_audio_deleteTrack(ANPAudioTrack* s)
|
||||
void
|
||||
anp_audio_start(ANPAudioTrack* s)
|
||||
{
|
||||
if (s == nullptr || s->output_unit == nullptr) {
|
||||
if (s == NULL || s->output_unit == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ anp_audio_start(ANPAudioTrack* s)
|
||||
void
|
||||
anp_audio_pause(ANPAudioTrack* s)
|
||||
{
|
||||
if (s == nullptr || s->output_unit == nullptr) {
|
||||
if (s == NULL || s->output_unit == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -335,7 +335,7 @@ anp_audio_pause(ANPAudioTrack* s)
|
||||
void
|
||||
anp_audio_stop(ANPAudioTrack* s)
|
||||
{
|
||||
if (s == nullptr || s->output_unit == nullptr) {
|
||||
if (s == NULL || s->output_unit == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ static ANPEGLContext anp_opengl_acquireContext(NPP instance) {
|
||||
|
||||
GLContext* context = pinst->GLContext();
|
||||
if (!context)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
context->MakeCurrent();
|
||||
return context->GetNativeData(GLContext::NativeGLContext);
|
||||
|
@ -56,9 +56,9 @@ static struct ANPSurfaceFunctions {
|
||||
} gSurfaceFunctions;
|
||||
|
||||
|
||||
static void* getSurface(JNIEnv* env, jobject view) {
|
||||
static inline void* getSurface(JNIEnv* env, jobject view) {
|
||||
if (!env || !view) {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!gSurfaceJavaGlue.initialized) {
|
||||
@ -93,14 +93,14 @@ static void* getSurface(JNIEnv* env, jobject view) {
|
||||
|
||||
if (!gSurfaceJavaGlue.surfacePointer) {
|
||||
LOG("Failed to acquire surface pointer");
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
env->DeleteLocalRef(surfaceClass);
|
||||
env->DeleteLocalRef(surfaceViewClass);
|
||||
env->DeleteLocalRef(surfaceHolderClass);
|
||||
|
||||
gSurfaceJavaGlue.initialized = (gSurfaceJavaGlue.surfacePointer != nullptr);
|
||||
gSurfaceJavaGlue.initialized = (gSurfaceJavaGlue.surfacePointer != NULL);
|
||||
}
|
||||
|
||||
jobject holder = env->CallObjectMethod(view, gSurfaceJavaGlue.getSurfaceHolder);
|
||||
@ -182,7 +182,7 @@ static bool anp_surface_lock(JNIEnv* env, jobject surfaceView, ANPBitmap* bitmap
|
||||
return false;
|
||||
}
|
||||
|
||||
void* region = nullptr;
|
||||
void* region = NULL;
|
||||
if (dirtyRect) {
|
||||
region = malloc(ANDROID_REGION_SIZE);
|
||||
gSurfaceFunctions.regionConstructor(region);
|
||||
@ -227,7 +227,7 @@ static bool anp_surface_lock(JNIEnv* env, jobject surfaceView, ANPBitmap* bitmap
|
||||
if (info.w > 0 && info.h > 0) {
|
||||
bitmap->baseAddr = info.bits;
|
||||
} else {
|
||||
bitmap->baseAddr = nullptr;
|
||||
bitmap->baseAddr = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
const char*
|
||||
anp_system_getApplicationDataDirectory()
|
||||
{
|
||||
static char *dir;
|
||||
static char *dir = NULL;
|
||||
|
||||
if (!dir) {
|
||||
dir = getenv("ANDROID_PLUGIN_DATADIR");
|
||||
|
@ -46,7 +46,7 @@ using namespace mozilla;
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS0(nsFilePickerCallback)
|
||||
|
||||
AndroidBridge *AndroidBridge::sBridge = nullptr;
|
||||
AndroidBridge *AndroidBridge::sBridge = 0;
|
||||
static PRUintn sJavaEnvThreadIndex = 0;
|
||||
static void JavaThreadDetachFunc(void *arg);
|
||||
|
||||
@ -254,11 +254,10 @@ AndroidBridge::NotifyIME(int aType, int aState)
|
||||
sBridge->jNotifyIME, aType, aState);
|
||||
}
|
||||
|
||||
static jstring NewJavaString(AutoLocalJNIFrame* frame, const PRUnichar* string,
|
||||
PRUint32 len) {
|
||||
jstring NewJavaString(AutoLocalJNIFrame* frame, const PRUnichar* string, PRUint32 len) {
|
||||
jstring ret = frame->GetEnv()->NewString( string, len);
|
||||
if (frame->CheckForException())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1111,13 +1110,13 @@ AndroidBridge::SetLayerClient(JNIEnv* env, jobject jobj)
|
||||
// and we had to recreate it, but all the Gecko-side things were not destroyed.
|
||||
// We therefore need to link up the new java objects to Gecko, and that's what
|
||||
// we do here.
|
||||
bool resetting = (mLayerClient != nullptr);
|
||||
bool resetting = (mLayerClient != NULL);
|
||||
|
||||
if (resetting) {
|
||||
// clear out the old layer client
|
||||
env->DeleteGlobalRef(mLayerClient->wrappedObject());
|
||||
delete mLayerClient;
|
||||
mLayerClient = nullptr;
|
||||
mLayerClient = NULL;
|
||||
}
|
||||
|
||||
AndroidGeckoLayerClient *client = new AndroidGeckoLayerClient();
|
||||
@ -1149,7 +1148,7 @@ AndroidBridge::CallEglCreateWindowSurface(void *dpy, void *config, AndroidGeckoS
|
||||
|
||||
JNIEnv *env = GetJNIForThread(); // called on the compositor thread
|
||||
if (!env)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
AutoLocalJNIFrame jniFrame(env);
|
||||
|
||||
@ -1183,8 +1182,7 @@ AndroidBridge::CallEglCreateWindowSurface(void *dpy, void *config, AndroidGeckoS
|
||||
jobject jconf = env->NewObject(jEGLConfigImplClass, constructConfig, (int) config);
|
||||
|
||||
// make the call
|
||||
jobject surf = env->CallObjectMethod(egl, createWindowSurface, jdpy, jconf, surfaceHolder,
|
||||
nullptr);
|
||||
jobject surf = env->CallObjectMethod(egl, createWindowSurface, jdpy, jconf, surfaceHolder, NULL);
|
||||
if (jniFrame.CheckForException() || !surf)
|
||||
return nullptr;
|
||||
|
||||
@ -2047,13 +2045,13 @@ AndroidBridge::LockWindow(void *window, unsigned char **bits, int *width, int *h
|
||||
};
|
||||
|
||||
int err;
|
||||
*bits = nullptr;
|
||||
*bits = NULL;
|
||||
*width = *height = *format = 0;
|
||||
|
||||
if (mHasNativeWindowAccess) {
|
||||
ANativeWindow_Buffer buffer;
|
||||
|
||||
if ((err = ANativeWindow_lock(window, (void*)&buffer, nullptr)) != 0) {
|
||||
if ((err = ANativeWindow_lock(window, (void*)&buffer, NULL)) != 0) {
|
||||
ALOG_BRIDGE("ANativeWindow_lock failed! (error %d)", err);
|
||||
return false;
|
||||
}
|
||||
@ -2066,7 +2064,7 @@ AndroidBridge::LockWindow(void *window, unsigned char **bits, int *width, int *h
|
||||
} else if (mHasNativeWindowFallback) {
|
||||
SurfaceInfo info;
|
||||
|
||||
if ((err = Surface_lock(window, &info, nullptr, true)) != 0) {
|
||||
if ((err = Surface_lock(window, &info, NULL, true)) != 0) {
|
||||
ALOG_BRIDGE("Surface_lock failed! (error %d)", err);
|
||||
return false;
|
||||
}
|
||||
@ -2148,7 +2146,7 @@ AndroidBridge::SyncViewportInfo(const nsIntRect& aDisplayPort, float aDisplayRes
|
||||
}
|
||||
|
||||
AndroidBridge::AndroidBridge()
|
||||
: mLayerClient(nullptr)
|
||||
: mLayerClient(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -2194,7 +2192,7 @@ static void
|
||||
JavaThreadDetachFunc(void *arg)
|
||||
{
|
||||
JNIEnv *env = (JNIEnv*) arg;
|
||||
JavaVM *vm = nullptr;
|
||||
JavaVM *vm = NULL;
|
||||
env->GetJavaVM(&vm);
|
||||
vm->DetachCurrentThread();
|
||||
}
|
||||
@ -2203,11 +2201,11 @@ extern "C" {
|
||||
__attribute__ ((visibility("default")))
|
||||
JNIEnv * GetJNIForThread()
|
||||
{
|
||||
JNIEnv *jEnv = nullptr;
|
||||
JNIEnv *jEnv = NULL;
|
||||
JavaVM *jVm = mozilla::AndroidBridge::GetVM();
|
||||
if (!jVm) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Returned a null VM");
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
jEnv = static_cast<JNIEnv*>(PR_GetThreadPrivate(sJavaEnvThreadIndex));
|
||||
|
||||
@ -2217,16 +2215,16 @@ extern "C" {
|
||||
int status = jVm->GetEnv((void**) &jEnv, JNI_VERSION_1_2);
|
||||
if (status) {
|
||||
|
||||
status = jVm->AttachCurrentThread(&jEnv, nullptr);
|
||||
status = jVm->AttachCurrentThread(&jEnv, NULL);
|
||||
if (status) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "Could not attach");
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PR_SetThreadPrivate(sJavaEnvThreadIndex, jEnv);
|
||||
}
|
||||
if (!jEnv) {
|
||||
__android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "returning nullptr");
|
||||
__android_log_print(ANDROID_LOG_INFO, "GetJNIForThread", "returning NULL");
|
||||
}
|
||||
return jEnv;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ public:
|
||||
void *CallEglCreateWindowSurface(void *dpy, void *config, AndroidGeckoSurfaceView& surfaceView);
|
||||
|
||||
// Switch Java to composite with the Gecko Compositor thread
|
||||
void RegisterCompositor(JNIEnv* env = nullptr, bool resetting = false);
|
||||
void RegisterCompositor(JNIEnv* env = NULL, bool resetting = false);
|
||||
EGLSurface ProvideEGLSurface();
|
||||
|
||||
bool GetStaticStringField(const char *classID, const char *field, nsAString &result, JNIEnv* env = nullptr);
|
||||
@ -551,7 +551,7 @@ public:
|
||||
void Purge() {
|
||||
if (mJNIEnv) {
|
||||
if (mHasFrameBeenPushed)
|
||||
mJNIEnv->PopLocalFrame(nullptr);
|
||||
mJNIEnv->PopLocalFrame(NULL);
|
||||
Push();
|
||||
}
|
||||
}
|
||||
@ -577,7 +577,7 @@ public:
|
||||
CheckForException();
|
||||
|
||||
if (mHasFrameBeenPushed)
|
||||
mJNIEnv->PopLocalFrame(nullptr);
|
||||
mJNIEnv->PopLocalFrame(NULL);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -18,7 +18,7 @@ AndroidDirectTexture::AndroidDirectTexture(PRUint32 width, PRUint32 height, PRUi
|
||||
, mWidth(width)
|
||||
, mHeight(height)
|
||||
, mFormat(format)
|
||||
, mPendingReallocBuffer(nullptr)
|
||||
, mPendingReallocBuffer(NULL)
|
||||
{
|
||||
mFrontBuffer = new AndroidGraphicBuffer(width, height, usage, format);
|
||||
mBackBuffer = new AndroidGraphicBuffer(width, height, usage, format);
|
||||
@ -26,8 +26,15 @@ AndroidDirectTexture::AndroidDirectTexture(PRUint32 width, PRUint32 height, PRUi
|
||||
|
||||
AndroidDirectTexture::~AndroidDirectTexture()
|
||||
{
|
||||
if (mFrontBuffer) {
|
||||
delete mFrontBuffer;
|
||||
mFrontBuffer = NULL;
|
||||
}
|
||||
|
||||
if (mBackBuffer) {
|
||||
delete mBackBuffer;
|
||||
mBackBuffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -40,7 +47,7 @@ AndroidDirectTexture::ReallocPendingBuffer()
|
||||
// It is assumed that mLock is already acquired
|
||||
if (mPendingReallocBuffer == mBackBuffer) {
|
||||
mBackBuffer->Reallocate(mWidth, mHeight, mFormat);
|
||||
mPendingReallocBuffer = nullptr;
|
||||
mPendingReallocBuffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -253,19 +253,20 @@ AndroidGraphicBuffer::DestroyBuffer()
|
||||
if (mEGLImage) {
|
||||
if (sGLFunctions.EnsureInitialized()) {
|
||||
sGLFunctions.fDestroyImageKHR(sGLFunctions.fGetDisplay(EGL_DEFAULT_DISPLAY), mEGLImage);
|
||||
mEGLImage = nullptr;
|
||||
mEGLImage = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mEGLImage = nullptr;
|
||||
mEGLImage = NULL;
|
||||
|
||||
if (mHandle) {
|
||||
if (sGLFunctions.EnsureInitialized()) {
|
||||
sGLFunctions.fGraphicBufferDtor(mHandle);
|
||||
}
|
||||
free(mHandle);
|
||||
mHandle = nullptr;
|
||||
mHandle = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
@ -400,7 +401,7 @@ AndroidGraphicBuffer::EnsureEGLImage()
|
||||
void* nativeBuffer = sGLFunctions.fGraphicBufferGetNativeBuffer(mHandle);
|
||||
|
||||
mEGLImage = sGLFunctions.fCreateImageKHR(sGLFunctions.fGetDisplay(EGL_DEFAULT_DISPLAY), EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)nativeBuffer, eglImgAttrs);
|
||||
return (mEGLImage != nullptr);
|
||||
return mEGLImage != NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -432,7 +433,7 @@ static const char* const sAllowedBoards[] = {
|
||||
"sgh-i997", // Samsung Infuse 4G
|
||||
"herring", // Samsung Nexus S
|
||||
"sgh-t839", // Samsung Sidekick 4G
|
||||
nullptr
|
||||
NULL
|
||||
};
|
||||
|
||||
bool
|
||||
|
@ -120,7 +120,7 @@ Java_org_mozilla_gecko_GeckoAppShell_removeObserver(JNIEnv *jenv, jclass, jstrin
|
||||
if (!nsAppShell::gAppShell)
|
||||
return;
|
||||
|
||||
const jchar *observerKey = jenv->GetStringChars(jObserverKey, nullptr);
|
||||
const jchar *observerKey = jenv->GetStringChars(jObserverKey, NULL);
|
||||
nsString sObserverKey(observerKey);
|
||||
sObserverKey.SetLength(jenv->GetStringLength(jObserverKey));
|
||||
jenv->ReleaseStringChars(jObserverKey, observerKey);
|
||||
@ -906,7 +906,7 @@ NS_EXPORT jobject JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_getSurfaceBits(JNIEnv* jenv, jclass, jobject surface)
|
||||
{
|
||||
static jclass jSurfaceBitsClass = nullptr;
|
||||
static jmethodID jSurfaceBitsCtor = nullptr;
|
||||
static jmethodID jSurfaceBitsCtor = 0;
|
||||
static jfieldID jSurfaceBitsWidth, jSurfaceBitsHeight, jSurfaceBitsFormat, jSurfaceBitsBuffer;
|
||||
|
||||
jobject surfaceBits = nullptr;
|
||||
@ -1015,7 +1015,7 @@ Java_org_mozilla_gecko_GeckoAppShell_getNextMessageFromQueue(JNIEnv* jenv, jclas
|
||||
jNextMethod = jenv->GetMethodID(jMessageQueueCls, "next", "()Landroid/os/Message;");
|
||||
}
|
||||
if (!jMessageQueueCls || !jMessagesField || !jNextMethod)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
jobject msg = jenv->GetObjectField(queue, jMessagesField);
|
||||
// if queue.mMessages is null, queue.next() will block, which we don't want
|
||||
if (!msg)
|
||||
|
@ -8,89 +8,89 @@
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
jclass AndroidGeckoEvent::jGeckoEventClass = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jActionField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jTypeField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jTimeField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jPoints = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jPointIndicies = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jPressures = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jPointRadii = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jOrientations = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jXField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jYField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jZField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jDistanceField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jRectField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jNativeWindowField = nullptr;
|
||||
jclass AndroidGeckoEvent::jGeckoEventClass = 0;
|
||||
jfieldID AndroidGeckoEvent::jActionField = 0;
|
||||
jfieldID AndroidGeckoEvent::jTypeField = 0;
|
||||
jfieldID AndroidGeckoEvent::jTimeField = 0;
|
||||
jfieldID AndroidGeckoEvent::jPoints = 0;
|
||||
jfieldID AndroidGeckoEvent::jPointIndicies = 0;
|
||||
jfieldID AndroidGeckoEvent::jPressures = 0;
|
||||
jfieldID AndroidGeckoEvent::jPointRadii = 0;
|
||||
jfieldID AndroidGeckoEvent::jOrientations = 0;
|
||||
jfieldID AndroidGeckoEvent::jXField = 0;
|
||||
jfieldID AndroidGeckoEvent::jYField = 0;
|
||||
jfieldID AndroidGeckoEvent::jZField = 0;
|
||||
jfieldID AndroidGeckoEvent::jDistanceField = 0;
|
||||
jfieldID AndroidGeckoEvent::jRectField = 0;
|
||||
jfieldID AndroidGeckoEvent::jNativeWindowField = 0;
|
||||
|
||||
jfieldID AndroidGeckoEvent::jCharactersField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jCharactersExtraField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jKeyCodeField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jMetaStateField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jFlagsField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jUnicodeCharField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jRepeatCountField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jOffsetField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jCountField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jPointerIndexField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jRangeTypeField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jRangeStylesField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jRangeForeColorField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jRangeBackColorField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jLocationField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jBandwidthField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jCanBeMeteredField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jScreenOrientationField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jByteBufferField = nullptr;
|
||||
jfieldID AndroidGeckoEvent::jCharactersField = 0;
|
||||
jfieldID AndroidGeckoEvent::jCharactersExtraField = 0;
|
||||
jfieldID AndroidGeckoEvent::jKeyCodeField = 0;
|
||||
jfieldID AndroidGeckoEvent::jMetaStateField = 0;
|
||||
jfieldID AndroidGeckoEvent::jFlagsField = 0;
|
||||
jfieldID AndroidGeckoEvent::jUnicodeCharField = 0;
|
||||
jfieldID AndroidGeckoEvent::jRepeatCountField = 0;
|
||||
jfieldID AndroidGeckoEvent::jOffsetField = 0;
|
||||
jfieldID AndroidGeckoEvent::jCountField = 0;
|
||||
jfieldID AndroidGeckoEvent::jPointerIndexField = 0;
|
||||
jfieldID AndroidGeckoEvent::jRangeTypeField = 0;
|
||||
jfieldID AndroidGeckoEvent::jRangeStylesField = 0;
|
||||
jfieldID AndroidGeckoEvent::jRangeForeColorField = 0;
|
||||
jfieldID AndroidGeckoEvent::jRangeBackColorField = 0;
|
||||
jfieldID AndroidGeckoEvent::jLocationField = 0;
|
||||
jfieldID AndroidGeckoEvent::jBandwidthField = 0;
|
||||
jfieldID AndroidGeckoEvent::jCanBeMeteredField = 0;
|
||||
jfieldID AndroidGeckoEvent::jScreenOrientationField = 0;
|
||||
jfieldID AndroidGeckoEvent::jByteBufferField = 0;
|
||||
|
||||
jclass AndroidPoint::jPointClass = nullptr;
|
||||
jfieldID AndroidPoint::jXField = nullptr;
|
||||
jfieldID AndroidPoint::jYField = nullptr;
|
||||
jclass AndroidPoint::jPointClass = 0;
|
||||
jfieldID AndroidPoint::jXField = 0;
|
||||
jfieldID AndroidPoint::jYField = 0;
|
||||
|
||||
jclass AndroidRect::jRectClass = nullptr;
|
||||
jfieldID AndroidRect::jBottomField = nullptr;
|
||||
jfieldID AndroidRect::jLeftField = nullptr;
|
||||
jfieldID AndroidRect::jRightField = nullptr;
|
||||
jfieldID AndroidRect::jTopField = nullptr;
|
||||
jclass AndroidRect::jRectClass = 0;
|
||||
jfieldID AndroidRect::jBottomField = 0;
|
||||
jfieldID AndroidRect::jLeftField = 0;
|
||||
jfieldID AndroidRect::jRightField = 0;
|
||||
jfieldID AndroidRect::jTopField = 0;
|
||||
|
||||
jclass AndroidLocation::jLocationClass = nullptr;
|
||||
jmethodID AndroidLocation::jGetLatitudeMethod = nullptr;
|
||||
jmethodID AndroidLocation::jGetLongitudeMethod = nullptr;
|
||||
jmethodID AndroidLocation::jGetAltitudeMethod = nullptr;
|
||||
jmethodID AndroidLocation::jGetAccuracyMethod = nullptr;
|
||||
jmethodID AndroidLocation::jGetBearingMethod = nullptr;
|
||||
jmethodID AndroidLocation::jGetSpeedMethod = nullptr;
|
||||
jmethodID AndroidLocation::jGetTimeMethod = nullptr;
|
||||
jclass AndroidLocation::jLocationClass = 0;
|
||||
jmethodID AndroidLocation::jGetLatitudeMethod = 0;
|
||||
jmethodID AndroidLocation::jGetLongitudeMethod = 0;
|
||||
jmethodID AndroidLocation::jGetAltitudeMethod = 0;
|
||||
jmethodID AndroidLocation::jGetAccuracyMethod = 0;
|
||||
jmethodID AndroidLocation::jGetBearingMethod = 0;
|
||||
jmethodID AndroidLocation::jGetSpeedMethod = 0;
|
||||
jmethodID AndroidLocation::jGetTimeMethod = 0;
|
||||
|
||||
jclass AndroidGeckoLayerClient::jGeckoLayerClientClass = nullptr;
|
||||
jmethodID AndroidGeckoLayerClient::jSetFirstPaintViewport = nullptr;
|
||||
jmethodID AndroidGeckoLayerClient::jSetPageRect = nullptr;
|
||||
jmethodID AndroidGeckoLayerClient::jSyncViewportInfoMethod = nullptr;
|
||||
jmethodID AndroidGeckoLayerClient::jCreateFrameMethod = nullptr;
|
||||
jmethodID AndroidGeckoLayerClient::jActivateProgramMethod = nullptr;
|
||||
jmethodID AndroidGeckoLayerClient::jDeactivateProgramMethod = nullptr;
|
||||
jclass AndroidGeckoLayerClient::jGeckoLayerClientClass = 0;
|
||||
jmethodID AndroidGeckoLayerClient::jSetFirstPaintViewport = 0;
|
||||
jmethodID AndroidGeckoLayerClient::jSetPageRect = 0;
|
||||
jmethodID AndroidGeckoLayerClient::jSyncViewportInfoMethod = 0;
|
||||
jmethodID AndroidGeckoLayerClient::jCreateFrameMethod = 0;
|
||||
jmethodID AndroidGeckoLayerClient::jActivateProgramMethod = 0;
|
||||
jmethodID AndroidGeckoLayerClient::jDeactivateProgramMethod = 0;
|
||||
|
||||
jclass AndroidLayerRendererFrame::jLayerRendererFrameClass = nullptr;
|
||||
jmethodID AndroidLayerRendererFrame::jBeginDrawingMethod = nullptr;
|
||||
jmethodID AndroidLayerRendererFrame::jDrawBackgroundMethod = nullptr;
|
||||
jmethodID AndroidLayerRendererFrame::jDrawForegroundMethod = nullptr;
|
||||
jmethodID AndroidLayerRendererFrame::jEndDrawingMethod = nullptr;
|
||||
jclass AndroidLayerRendererFrame::jLayerRendererFrameClass = 0;
|
||||
jmethodID AndroidLayerRendererFrame::jBeginDrawingMethod = 0;
|
||||
jmethodID AndroidLayerRendererFrame::jDrawBackgroundMethod = 0;
|
||||
jmethodID AndroidLayerRendererFrame::jDrawForegroundMethod = 0;
|
||||
jmethodID AndroidLayerRendererFrame::jEndDrawingMethod = 0;
|
||||
|
||||
jclass AndroidViewTransform::jViewTransformClass = nullptr;
|
||||
jfieldID AndroidViewTransform::jXField = nullptr;
|
||||
jfieldID AndroidViewTransform::jYField = nullptr;
|
||||
jfieldID AndroidViewTransform::jScaleField = nullptr;
|
||||
jclass AndroidViewTransform::jViewTransformClass = 0;
|
||||
jfieldID AndroidViewTransform::jXField = 0;
|
||||
jfieldID AndroidViewTransform::jYField = 0;
|
||||
jfieldID AndroidViewTransform::jScaleField = 0;
|
||||
|
||||
jclass AndroidGeckoSurfaceView::jGeckoSurfaceViewClass = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jBeginDrawingMethod = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jEndDrawingMethod = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jDraw2DBitmapMethod = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jDraw2DBufferMethod = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetSoftwareDrawBitmapMethod = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetSoftwareDrawBufferMethod = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetSurfaceMethod = nullptr;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetHolderMethod = nullptr;
|
||||
jclass AndroidGeckoSurfaceView::jGeckoSurfaceViewClass = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jBeginDrawingMethod = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jEndDrawingMethod = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jDraw2DBitmapMethod = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jDraw2DBufferMethod = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetSoftwareDrawBitmapMethod = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetSoftwareDrawBufferMethod = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetSurfaceMethod = 0;
|
||||
jmethodID AndroidGeckoSurfaceView::jGetHolderMethod = 0;
|
||||
|
||||
static jclass GetClassGlobalRef(JNIEnv* env, const char* className)
|
||||
{
|
||||
@ -110,7 +110,7 @@ static jclass GetClassGlobalRef(JNIEnv* env, const char* className)
|
||||
|
||||
// Local ref no longer necessary because we have a global ref.
|
||||
env->DeleteLocalRef(classLocalRef);
|
||||
classLocalRef = nullptr;
|
||||
classLocalRef = NULL;
|
||||
|
||||
return static_cast<jclass>(classGlobalRef);
|
||||
}
|
||||
@ -158,7 +158,7 @@ static jmethodID GetMethodID(JNIEnv* env, jclass jClass,
|
||||
RefCountedJavaObject::~RefCountedJavaObject() {
|
||||
if (mObject)
|
||||
GetJNIForThread()->DeleteGlobalRef(mObject);
|
||||
mObject = nullptr;
|
||||
mObject = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@ -255,19 +255,19 @@ AndroidLocation::CreateGeoPosition(JNIEnv *jenv, jobject jobj)
|
||||
AutoLocalJNIFrame jniFrame(jenv);
|
||||
|
||||
double latitude = jenv->CallDoubleMethod(jobj, jGetLatitudeMethod);
|
||||
if (jniFrame.CheckForException()) return nullptr;
|
||||
if (jniFrame.CheckForException()) return NULL;
|
||||
double longitude = jenv->CallDoubleMethod(jobj, jGetLongitudeMethod);
|
||||
if (jniFrame.CheckForException()) return nullptr;
|
||||
if (jniFrame.CheckForException()) return NULL;
|
||||
double altitude = jenv->CallDoubleMethod(jobj, jGetAltitudeMethod);
|
||||
if (jniFrame.CheckForException()) return nullptr;
|
||||
if (jniFrame.CheckForException()) return NULL;
|
||||
float accuracy = jenv->CallFloatMethod (jobj, jGetAccuracyMethod);
|
||||
if (jniFrame.CheckForException()) return nullptr;
|
||||
if (jniFrame.CheckForException()) return NULL;
|
||||
float bearing = jenv->CallFloatMethod (jobj, jGetBearingMethod);
|
||||
if (jniFrame.CheckForException()) return nullptr;
|
||||
if (jniFrame.CheckForException()) return NULL;
|
||||
float speed = jenv->CallFloatMethod (jobj, jGetSpeedMethod);
|
||||
if (jniFrame.CheckForException()) return nullptr;
|
||||
if (jniFrame.CheckForException()) return NULL;
|
||||
long long time = jenv->CallLongMethod (jobj, jGetTimeMethod);
|
||||
if (jniFrame.CheckForException()) return nullptr;
|
||||
if (jniFrame.CheckForException()) return NULL;
|
||||
|
||||
return new nsGeoPosition(latitude, longitude,
|
||||
altitude, accuracy,
|
||||
@ -641,7 +641,7 @@ AndroidLayerRendererFrame::Dispose(JNIEnv *env)
|
||||
}
|
||||
|
||||
env->DeleteGlobalRef(wrapped_obj);
|
||||
wrapped_obj = nullptr;
|
||||
wrapped_obj = 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -967,7 +967,7 @@ nsJNIString::nsJNIString(jstring jstr, JNIEnv *jenv)
|
||||
return;
|
||||
}
|
||||
}
|
||||
const jchar* jCharPtr = jni->GetStringChars(jstr, nullptr);
|
||||
const jchar* jCharPtr = jni->GetStringChars(jstr, NULL);
|
||||
|
||||
if (!jCharPtr) {
|
||||
SetIsVoid(true);
|
||||
|
@ -12,7 +12,7 @@ using namespace mozilla;
|
||||
#define ASSERT_THREAD() \
|
||||
NS_ASSERTION(pthread_self() == mThread, "Something is calling AndroidGLController from the wrong thread!")
|
||||
|
||||
static jfieldID jEGLSurfacePointerField = nullptr;
|
||||
static jfieldID jEGLSurfacePointerField = 0;
|
||||
|
||||
void AndroidEGLObject::Init(JNIEnv* aJEnv) {
|
||||
jclass jClass;
|
||||
@ -21,10 +21,10 @@ void AndroidEGLObject::Init(JNIEnv* aJEnv) {
|
||||
jEGLSurfacePointerField = aJEnv->GetFieldID(jClass, "mEGLSurface", "I");
|
||||
}
|
||||
|
||||
jmethodID AndroidGLController::jSetGLVersionMethod = nullptr;
|
||||
jmethodID AndroidGLController::jWaitForValidSurfaceMethod = nullptr;
|
||||
jmethodID AndroidGLController::jProvideEGLSurfaceMethod = nullptr;
|
||||
jmethodID AndroidGLController::jResumeCompositorIfValidMethod = nullptr;
|
||||
jmethodID AndroidGLController::jSetGLVersionMethod = 0;
|
||||
jmethodID AndroidGLController::jWaitForValidSurfaceMethod = 0;
|
||||
jmethodID AndroidGLController::jProvideEGLSurfaceMethod = 0;
|
||||
jmethodID AndroidGLController::jResumeCompositorIfValidMethod = 0;
|
||||
|
||||
void
|
||||
AndroidGLController::Init(JNIEnv* aJEnv)
|
||||
@ -71,7 +71,7 @@ AndroidGLController::ProvideEGLSurface()
|
||||
AutoLocalJNIFrame jniFrame(mJEnv);
|
||||
jobject jObj = mJEnv->CallObjectMethod(mJObj, jProvideEGLSurfaceMethod);
|
||||
if (jniFrame.CheckForException())
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
return reinterpret_cast<EGLSurface>(mJEnv->GetIntField(jObj, jEGLSurfacePointerField));
|
||||
}
|
||||
|
@ -85,23 +85,23 @@ NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_ANDROIDBRIDGE_CID);
|
||||
|
||||
static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
|
||||
{ &kNS_WINDOW_CID, false, nullptr, nsWindowConstructor },
|
||||
{ &kNS_CHILD_CID, false, nullptr, nsWindowConstructor },
|
||||
{ &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor },
|
||||
{ &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerAndroidConstructor },
|
||||
{ &kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceAndroidConstructor },
|
||||
{ &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor },
|
||||
{ &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor },
|
||||
{ &kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor },
|
||||
{ &kNS_PRINTSETTINGSSERVICE_CID, false, nullptr, nsPrintOptionsAndroidConstructor },
|
||||
{ &kNS_PRINTSESSION_CID, false, nullptr, nsPrintSessionConstructor },
|
||||
{ &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecAndroidConstructor },
|
||||
{ &kNS_FILEPICKER_CID, false, nullptr, nsFilePickerConstructor },
|
||||
{ &kNS_HTMLFORMATCONVERTER_CID, false, nullptr, nsHTMLFormatConverterConstructor },
|
||||
{ &kNS_IMEPICKER_CID, false, nullptr, nsIMEPickerConstructor },
|
||||
{ &kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor },
|
||||
{ &kNS_ANDROIDBRIDGE_CID, false, nullptr, nsAndroidBridgeConstructor },
|
||||
{ nullptr }
|
||||
{ &kNS_WINDOW_CID, false, NULL, nsWindowConstructor },
|
||||
{ &kNS_CHILD_CID, false, NULL, nsWindowConstructor },
|
||||
{ &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
|
||||
{ &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerAndroidConstructor },
|
||||
{ &kNS_IDLE_SERVICE_CID, false, NULL, nsIdleServiceAndroidConstructor },
|
||||
{ &kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor },
|
||||
{ &kNS_CLIPBOARD_CID, false, NULL, nsClipboardConstructor },
|
||||
{ &kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor },
|
||||
{ &kNS_PRINTSETTINGSSERVICE_CID, false, NULL, nsPrintOptionsAndroidConstructor },
|
||||
{ &kNS_PRINTSESSION_CID, false, NULL, nsPrintSessionConstructor },
|
||||
{ &kNS_DEVICE_CONTEXT_SPEC_CID, false, NULL, nsDeviceContextSpecAndroidConstructor },
|
||||
{ &kNS_FILEPICKER_CID, false, NULL, nsFilePickerConstructor },
|
||||
{ &kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor },
|
||||
{ &kNS_IMEPICKER_CID, false, NULL, nsIMEPickerConstructor },
|
||||
{ &kNS_GFXINFO_CID, false, NULL, mozilla::widget::GfxInfoConstructor },
|
||||
{ &kNS_ANDROIDBRIDGE_CID, false, NULL, nsAndroidBridgeConstructor },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
|
||||
@ -121,7 +121,7 @@ static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
|
||||
{ "@mozilla.org/imepicker;1", &kNS_IMEPICKER_CID },
|
||||
{ "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID },
|
||||
{ "@mozilla.org/android/bridge;1", &kNS_ANDROIDBRIDGE_CID },
|
||||
{ nullptr }
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static void
|
||||
@ -135,8 +135,8 @@ static const mozilla::Module kWidgetModule = {
|
||||
mozilla::Module::kVersion,
|
||||
kWidgetCIDs,
|
||||
kWidgetContracts,
|
||||
nullptr,
|
||||
nullptr,
|
||||
NULL,
|
||||
NULL,
|
||||
nsAppShellInit,
|
||||
nsWidgetAndroidModuleDtor
|
||||
};
|
||||
|
@ -171,7 +171,7 @@ nsWindow::~nsWindow()
|
||||
top->mFocus = nullptr;
|
||||
ALOG("nsWindow %p destructor", (void*)this);
|
||||
#ifdef MOZ_JAVA_COMPOSITOR
|
||||
SetCompositor(nullptr, nullptr);
|
||||
SetCompositor(NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1274,9 +1274,9 @@ void *
|
||||
nsWindow::GetNativeData(PRUint32 aDataType)
|
||||
{
|
||||
switch (aDataType) {
|
||||
// used by GLContextProviderEGL, nullptr is EGL_DEFAULT_DISPLAY
|
||||
// used by GLContextProviderEGL, NULL is EGL_DEFAULT_DISPLAY
|
||||
case NS_NATIVE_DISPLAY:
|
||||
return nullptr;
|
||||
return NULL;
|
||||
|
||||
case NS_NATIVE_WIDGET:
|
||||
return (void *) this;
|
||||
@ -1694,7 +1694,7 @@ nsWindow::InitKeyEvent(nsKeyEvent& event, AndroidGeckoEvent& key,
|
||||
event.isChar = (key.UnicodeChar() >= ' ');
|
||||
event.charCode = event.isChar ? key.UnicodeChar() : 0;
|
||||
event.keyCode = (event.charCode > 0) ? 0 : domKeyCode;
|
||||
event.pluginEvent = nullptr;
|
||||
event.pluginEvent = NULL;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
if (event.message != NS_KEY_DOWN && event.message != NS_KEY_UP) {
|
||||
@ -2276,8 +2276,8 @@ nsWindow::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect)
|
||||
|
||||
// off-main-thread compositor fields and functions
|
||||
|
||||
nsRefPtr<mozilla::layers::CompositorParent> nsWindow::sCompositorParent = nullptr;
|
||||
nsRefPtr<mozilla::layers::CompositorChild> nsWindow::sCompositorChild = nullptr;
|
||||
nsRefPtr<mozilla::layers::CompositorParent> nsWindow::sCompositorParent = 0;
|
||||
nsRefPtr<mozilla::layers::CompositorChild> nsWindow::sCompositorChild = 0;
|
||||
bool nsWindow::sCompositorPaused = false;
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user