OLD | NEW |
1 /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- | 1 /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- |
2 * This Source Code Form is subject to the terms of the Mozilla Public | 2 * This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 #include "mozilla/layers/CompositorChild.h" | 6 #include "mozilla/layers/CompositorChild.h" |
7 #include "mozilla/layers/CompositorParent.h" | 7 #include "mozilla/layers/CompositorParent.h" |
8 | 8 |
9 #include <android/log.h> | 9 #include <android/log.h> |
10 #include <dlfcn.h> | 10 #include <dlfcn.h> |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 return nullptr; | 733 return nullptr; |
734 } | 734 } |
735 MOZ_ASSERT(mGLControllerObj, "AndroidBridge::CreateEGLSurfaceForCompositor c
alled with a null GL controller ref"); | 735 MOZ_ASSERT(mGLControllerObj, "AndroidBridge::CreateEGLSurfaceForCompositor c
alled with a null GL controller ref"); |
736 | 736 |
737 auto eglSurface = mGLControllerObj->CreateEGLSurfaceForCompositorWrapper(); | 737 auto eglSurface = mGLControllerObj->CreateEGLSurfaceForCompositorWrapper(); |
738 if (!eglSurface) { | 738 if (!eglSurface) { |
739 return nullptr; | 739 return nullptr; |
740 } | 740 } |
741 | 741 |
742 JNIEnv* const env = GetJNIForThread(); // called on the compositor thread | 742 JNIEnv* const env = GetJNIForThread(); // called on the compositor thread |
743 return reinterpret_cast<EGLSurface>( | 743 return reinterpret_cast<EGLSurface>(mAPIVersion >= 20 ? |
| 744 env->GetLongField(eglSurface.Get(), jEGLSurfacePointerField) : |
744 env->GetIntField(eglSurface.Get(), jEGLSurfacePointerField)); | 745 env->GetIntField(eglSurface.Get(), jEGLSurfacePointerField)); |
745 } | 746 } |
746 | 747 |
747 bool | 748 bool |
748 AndroidBridge::GetStaticIntField(const char *className, const char *fieldName, i
nt32_t* aInt, JNIEnv* jEnv /* = nullptr */) | 749 AndroidBridge::GetStaticIntField(const char *className, const char *fieldName, i
nt32_t* aInt, JNIEnv* jEnv /* = nullptr */) |
749 { | 750 { |
750 ALOG_BRIDGE("AndroidBridge::GetStaticIntField %s", fieldName); | 751 ALOG_BRIDGE("AndroidBridge::GetStaticIntField %s", fieldName); |
751 | 752 |
752 if (!jEnv) { | 753 if (!jEnv) { |
753 if (!HasEnv()) { | 754 if (!HasEnv()) { |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 } | 2182 } |
2182 | 2183 |
2183 nsresult AndroidBridge::GetExternalPublicDirectory(const nsAString& aType, nsASt
ring& aPath) { | 2184 nsresult AndroidBridge::GetExternalPublicDirectory(const nsAString& aType, nsASt
ring& aPath) { |
2184 auto path = GeckoAppShell::GetExternalPublicDirectory(aType); | 2185 auto path = GeckoAppShell::GetExternalPublicDirectory(aType); |
2185 if (!path) { | 2186 if (!path) { |
2186 return NS_ERROR_NOT_AVAILABLE; | 2187 return NS_ERROR_NOT_AVAILABLE; |
2187 } | 2188 } |
2188 aPath = nsString(path); | 2189 aPath = nsString(path); |
2189 return NS_OK; | 2190 return NS_OK; |
2190 } | 2191 } |
OLD | NEW |