diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index b48bf1b1dcd3..1302b96f1392 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -952,7 +952,7 @@ void nsNPAPIPluginInstance::ReleaseContentTexture(nsNPAPIPluginInstance::Texture mContentTexture->Release(aTextureInfo); } -nsSurfaceTexture* nsNPAPIPluginInstance::CreateSurfaceTexture() +AndroidSurfaceTexture* nsNPAPIPluginInstance::CreateSurfaceTexture() { if (!EnsureGLContext()) return nullptr; @@ -961,7 +961,7 @@ nsSurfaceTexture* nsNPAPIPluginInstance::CreateSurfaceTexture() if (!texture) return nullptr; - nsSurfaceTexture* surface = nsSurfaceTexture::Create(texture); + AndroidSurfaceTexture* surface = AndroidSurfaceTexture::Create(texture); if (!surface) return nullptr; @@ -985,7 +985,7 @@ void* nsNPAPIPluginInstance::AcquireContentWindow() return nullptr; } - return mContentSurface->GetNativeWindow(); + return mContentSurface->NativeWindow()->Handle(); } EGLImage @@ -997,7 +997,7 @@ nsNPAPIPluginInstance::AsEGLImage() return mContentTexture->CreateEGLImage(); } -nsSurfaceTexture* +AndroidSurfaceTexture* nsNPAPIPluginInstance::AsSurfaceTexture() { if (!mContentSurface) @@ -1008,13 +1008,13 @@ nsNPAPIPluginInstance::AsSurfaceTexture() void* nsNPAPIPluginInstance::AcquireVideoWindow() { - nsSurfaceTexture* surface = CreateSurfaceTexture(); + AndroidSurfaceTexture* surface = CreateSurfaceTexture(); if (!surface) return nullptr; VideoInfo* info = new VideoInfo(surface); - void* window = info->mSurfaceTexture->GetNativeWindow(); + void* window = info->mSurfaceTexture->NativeWindow()->Handle(); mVideos.insert(std::pair(window, info)); return window; diff --git a/dom/plugins/base/nsNPAPIPluginInstance.h b/dom/plugins/base/nsNPAPIPluginInstance.h index 0910ed5fd618..ea71348b855f 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.h +++ b/dom/plugins/base/nsNPAPIPluginInstance.h @@ -21,7 +21,7 @@ #include "nsAutoPtr.h" #include "nsIRunnable.h" #include "GLContextTypes.h" -#include "nsSurfaceTexture.h" +#include "AndroidSurfaceTexture.h" #include "AndroidBridge.h" #include class PluginEventRunnable; @@ -192,12 +192,12 @@ public: void* AcquireContentWindow(); EGLImage AsEGLImage(); - nsSurfaceTexture* AsSurfaceTexture(); + mozilla::gl::AndroidSurfaceTexture* AsSurfaceTexture(); // For ANPVideo class VideoInfo { public: - VideoInfo(nsSurfaceTexture* aSurfaceTexture) : + VideoInfo(mozilla::gl::AndroidSurfaceTexture* aSurfaceTexture) : mSurfaceTexture(aSurfaceTexture) { } @@ -207,7 +207,7 @@ public: mSurfaceTexture = nullptr; } - nsRefPtr mSurfaceTexture; + nsRefPtr mSurfaceTexture; gfxRect mDimensions; }; @@ -334,7 +334,7 @@ protected: bool mInverted; nsRefPtr mContentTexture; - nsRefPtr mContentSurface; + nsRefPtr mContentSurface; #endif enum { @@ -383,7 +383,7 @@ private: #ifdef MOZ_WIDGET_ANDROID void EnsureSharedTexture(); - nsSurfaceTexture* CreateSurfaceTexture(); + mozilla::gl::AndroidSurfaceTexture* CreateSurfaceTexture(); std::map mVideos; bool mOnScreen; diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index a2acea5884ec..4fb96355ab99 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -185,7 +185,7 @@ AttachToContainerAsSurfaceTexture(ImageContainer* container, MOZ_ASSERT(out_image); MOZ_ASSERT(!*out_image); - nsSurfaceTexture* surfTex = instance->AsSurfaceTexture(); + mozilla::gl::AndroidSurfaceTexture* surfTex = instance->AsSurfaceTexture(); if (!surfTex) { return; } diff --git a/gfx/thebes/nsSurfaceTexture.cpp b/gfx/gl/AndroidSurfaceTexture.cpp similarity index 65% rename from gfx/thebes/nsSurfaceTexture.cpp rename to gfx/gl/AndroidSurfaceTexture.cpp index b9eb106864e1..63ffdb22abd7 100644 --- a/gfx/thebes/nsSurfaceTexture.cpp +++ b/gfx/gl/AndroidSurfaceTexture.cpp @@ -9,15 +9,18 @@ #include #include #include -#include "nsSurfaceTexture.h" +#include "AndroidSurfaceTexture.h" +#include "gfxImageSurface.h" #include "AndroidBridge.h" #include "nsThreadUtils.h" #include "mozilla/gfx/Matrix.h" +#include "GeneratedJNIWrappers.h" using namespace mozilla; +using namespace mozilla::widget::android; // UGH -static std::map sInstances; +static std::map sInstances; static int sNextID = 0; static class JNIFunctions { @@ -41,6 +44,9 @@ public: jSurfaceTexture_updateTexImage = env->GetMethodID(jSurfaceTextureClass, "updateTexImage", "()V"); jSurfaceTexture_getTransformMatrix = env->GetMethodID(jSurfaceTextureClass, "getTransformMatrix", "([F)V"); + jSurfaceClass = (jclass)env->NewGlobalRef(env->FindClass("android/view/Surface")); + jSurface_Ctor = env->GetMethodID(jSurfaceClass, "", "(Landroid/graphics/SurfaceTexture;)V"); + mInitialized = true; return true; } @@ -57,6 +63,16 @@ public: return env->NewGlobalRef(env->NewObject(jSurfaceTextureClass, jSurfaceTexture_Ctor, (int) aTexture)); } + jobject CreateSurface(jobject aSurfaceTexture) + { + if (!EnsureInitialized()) + return nullptr; + + JNIEnv* env = GetJNIForThread(); + AutoLocalJNIFrame jniFrame(env); + return env->NewGlobalRef(env->NewObject(jSurfaceClass, jSurface_Ctor, aSurfaceTexture)); + } + void ReleaseSurfaceTexture(jobject aSurfaceTexture) { JNIEnv* env = GetJNIForThread(); @@ -116,19 +132,21 @@ private: jmethodID jSurfaceTexture_updateTexImage; jmethodID jSurfaceTexture_getTransformMatrix; + jclass jSurfaceClass; + jmethodID jSurface_Ctor; + } sJNIFunctions; -nsSurfaceTexture* -nsSurfaceTexture::Create(GLuint aTexture) +AndroidSurfaceTexture* +AndroidSurfaceTexture::Create(GLuint aTexture) { - // Right now we only support creating this on the main thread because - // of the JNIEnv assumptions in JNIHelper and elsewhere - if (!NS_IsMainThread()) + if (AndroidBridge::Bridge()->GetAPIVersion() < 14 /* Ice Cream Sandwich */) { return nullptr; + } - nsSurfaceTexture* st = new nsSurfaceTexture(); + AndroidSurfaceTexture* st = new AndroidSurfaceTexture(); if (!st->Init(aTexture)) { - printf_stderr("Failed to initialize nsSurfaceTexture"); + printf_stderr("Failed to initialize AndroidSurfaceTexture"); delete st; st = nullptr; } @@ -136,10 +154,10 @@ nsSurfaceTexture::Create(GLuint aTexture) return st; } -nsSurfaceTexture* -nsSurfaceTexture::Find(int id) +AndroidSurfaceTexture* +AndroidSurfaceTexture::Find(int id) { - std::map::iterator it; + std::map::iterator it; it = sInstances.find(id); if (it == sInstances.end()) @@ -149,13 +167,13 @@ nsSurfaceTexture::Find(int id) } bool -nsSurfaceTexture::Check() +AndroidSurfaceTexture::Check() { return sJNIFunctions.EnsureInitialized(); } bool -nsSurfaceTexture::Init(GLuint aTexture) +AndroidSurfaceTexture::Init(GLuint aTexture) { if (!sJNIFunctions.EnsureInitialized()) return false; @@ -163,80 +181,80 @@ nsSurfaceTexture::Init(GLuint aTexture) JNIEnv* env = GetJNIForThread(); mSurfaceTexture = sJNIFunctions.CreateSurfaceTexture(aTexture); - if (!mSurfaceTexture) + if (!mSurfaceTexture) { return false; + } - mNativeWindow = AndroidBridge::Bridge()->AcquireNativeWindowFromSurfaceTexture(env, mSurfaceTexture); + mSurface = sJNIFunctions.CreateSurface(mSurfaceTexture); + if (!mSurface) { + return false; + } mID = ++sNextID; - sInstances.insert(std::pair(mID, this)); + sInstances.insert(std::pair(mID, this)); + + mTexture = aTexture; return true; } -nsSurfaceTexture::nsSurfaceTexture() - : mSurfaceTexture(nullptr), mNativeWindow(nullptr) +AndroidSurfaceTexture::AndroidSurfaceTexture() + : mTexture(0), mSurfaceTexture(nullptr), mSurface(nullptr) { } -nsSurfaceTexture::~nsSurfaceTexture() +AndroidSurfaceTexture::~AndroidSurfaceTexture() { sInstances.erase(mID); mFrameAvailableCallback = nullptr; - if (mNativeWindow) { - AndroidBridge::Bridge()->ReleaseNativeWindowForSurfaceTexture(mSurfaceTexture); - mNativeWindow = nullptr; - } - JNIEnv* env = GetJNIForThread(); if (mSurfaceTexture) { - mozilla::widget::android::GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); + GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); env->DeleteGlobalRef(mSurfaceTexture); mSurfaceTexture = nullptr; } -} -void* -nsSurfaceTexture::GetNativeWindow() -{ - return mNativeWindow; + if (mSurface) { + env->DeleteGlobalRef(mSurface); + mSurface = nullptr; + } } void -nsSurfaceTexture::UpdateTexImage() +AndroidSurfaceTexture::UpdateTexImage() { sJNIFunctions.UpdateTexImage(mSurfaceTexture); } bool -nsSurfaceTexture::GetTransformMatrix(gfx::Matrix4x4& aMatrix) +AndroidSurfaceTexture::GetTransformMatrix(gfx::Matrix4x4& aMatrix) { return sJNIFunctions.GetTransformMatrix(mSurfaceTexture, aMatrix); } void -nsSurfaceTexture::SetFrameAvailableCallback(nsIRunnable* aRunnable) +AndroidSurfaceTexture::SetFrameAvailableCallback(nsIRunnable* aRunnable) { if (aRunnable) - mozilla::widget::android::GeckoAppShell::RegisterSurfaceTextureFrameListener(mSurfaceTexture, mID); + GeckoAppShell::RegisterSurfaceTextureFrameListener(mSurfaceTexture, mID); else - mozilla::widget::android::GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); + GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture); mFrameAvailableCallback = aRunnable; } void -nsSurfaceTexture::NotifyFrameAvailable() +AndroidSurfaceTexture::NotifyFrameAvailable() { if (mFrameAvailableCallback) { // Proxy to main thread if we aren't on it if (!NS_IsMainThread()) { - // Proxy to main thread - nsCOMPtr event = NS_NewRunnableMethod(this, &nsSurfaceTexture::NotifyFrameAvailable); + // Proxy to main thread + nsCOMPtr event = NS_NewRunnableMethod(this, &AndroidSurfaceTexture::NotifyFrameAvailable); NS_DispatchToCurrentThread(event); } else { mFrameAvailableCallback->Run(); diff --git a/gfx/thebes/nsSurfaceTexture.h b/gfx/gl/AndroidSurfaceTexture.h similarity index 74% rename from gfx/thebes/nsSurfaceTexture.h rename to gfx/gl/AndroidSurfaceTexture.h index 6eee4ed722cb..4dde7097c53a 100644 --- a/gfx/thebes/nsSurfaceTexture.h +++ b/gfx/gl/AndroidSurfaceTexture.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef nsSurfaceTexture_h__ -#define nsSurfaceTexture_h__ +#ifndef AndroidSurfaceTexture_h__ +#define AndroidSurfaceTexture_h__ #ifdef MOZ_WIDGET_ANDROID #include @@ -13,31 +13,36 @@ #include "gfxPlatform.h" #include "GLDefs.h" +#include "AndroidNativeWindow.h" + +class gfxASurface; + namespace mozilla { namespace gfx { class Matrix4x4; } } +namespace mozilla { +namespace gl { + /** * This class is a wrapper around Android's SurfaceTexture class. * Usage is pretty much exactly like the Java class, so see * the Android documentation for details. */ -class nsSurfaceTexture MOZ_FINAL { - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsSurfaceTexture) +class AndroidSurfaceTexture { + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AndroidSurfaceTexture) public: - static nsSurfaceTexture* Create(GLuint aTexture); - static nsSurfaceTexture* Find(int id); + static AndroidSurfaceTexture* Create(GLuint aTexture); + static AndroidSurfaceTexture* Find(int id); // Returns with reasonable certainty whether or not we'll // be able to create and use a SurfaceTexture static bool Check(); - - // This is an ANativeWindow. Use AndroidBridge::LockWindow and - // friends for manipulating it. - void* GetNativeWindow(); + + ~AndroidSurfaceTexture(); // This attaches the updated data to the TEXTURE_EXTERNAL target void UpdateTexImage(); @@ -52,19 +57,24 @@ public: // Only should be called by AndroidJNI when we get a // callback from the underlying SurfaceTexture instance void NotifyFrameAvailable(); -private: - nsSurfaceTexture(); - // Private destructor, to discourage deletion outside of Release(): - ~nsSurfaceTexture(); + GLuint Texture() { return mTexture; } +private: + AndroidSurfaceTexture(); bool Init(GLuint aTexture); + GLuint mTexture; jobject mSurfaceTexture; - void* mNativeWindow; + jobject mSurface; + int mID; nsRefPtr mFrameAvailableCallback; }; + +} +} + #endif #endif diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index a706763e9e18..db6687f7fce3 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -25,7 +25,6 @@ /* from widget */ #if defined(MOZ_WIDGET_ANDROID) #include "AndroidBridge.h" -#include "nsSurfaceTexture.h" #endif #include diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build index 698e046c2e64..e1c6bc83c735 100644 --- a/gfx/gl/moz.build +++ b/gfx/gl/moz.build @@ -26,6 +26,7 @@ if CONFIG['MOZ_GL_PROVIDER']: gl_provider = CONFIG['MOZ_GL_PROVIDER'] EXPORTS += [ + 'AndroidSurfaceTexture.h', 'DecomposeIntoNoRepeatTriangles.h', 'EGLUtils.h', 'ForceDiscreteGPUHelperCGL.h', @@ -114,6 +115,7 @@ else: ] UNIFIED_SOURCES += [ + 'AndroidSurfaceTexture.cpp', 'DecomposeIntoNoRepeatTriangles.cpp', 'EGLUtils.cpp', 'GfxTexturesReporter.cpp', diff --git a/gfx/layers/GLImages.h b/gfx/layers/GLImages.h index 0b24c451e164..60fefc759931 100644 --- a/gfx/layers/GLImages.h +++ b/gfx/layers/GLImages.h @@ -12,9 +12,10 @@ #include "nsCOMPtr.h" // for already_AddRefed #include "mozilla/gfx/Point.h" // for IntSize -class nsSurfaceTexture; - namespace mozilla { +namespace gl { +class AndroidSurfaceTexture; +} namespace layers { class EGLImageImage : public Image { @@ -46,7 +47,7 @@ private: class SurfaceTextureImage : public Image { public: struct Data { - nsSurfaceTexture* mSurfTex; + mozilla::gl::AndroidSurfaceTexture* mSurfTex; gfx::IntSize mSize; bool mInverted; }; diff --git a/gfx/layers/opengl/TextureClientOGL.cpp b/gfx/layers/opengl/TextureClientOGL.cpp index 4bf4b0fbb6a0..12ef1c0dba3e 100644 --- a/gfx/layers/opengl/TextureClientOGL.cpp +++ b/gfx/layers/opengl/TextureClientOGL.cpp @@ -78,7 +78,7 @@ EGLImageTextureClient::Unlock() #ifdef MOZ_WIDGET_ANDROID SurfaceTextureClient::SurfaceTextureClient(TextureFlags aFlags, - nsSurfaceTexture* aSurfTex, + AndroidSurfaceTexture* aSurfTex, gfx::IntSize aSize, bool aInverted) : TextureClient(aFlags) diff --git a/gfx/layers/opengl/TextureClientOGL.h b/gfx/layers/opengl/TextureClientOGL.h index 1324fe5a20af..8eae11999337 100644 --- a/gfx/layers/opengl/TextureClientOGL.h +++ b/gfx/layers/opengl/TextureClientOGL.h @@ -13,7 +13,7 @@ #include "mozilla/layers/CompositorTypes.h" #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor #include "mozilla/layers/TextureClient.h" // for TextureClient, etc -#include "nsSurfaceTexture.h" +#include "AndroidSurfaceTexture.h" namespace mozilla { namespace layers { @@ -74,7 +74,7 @@ class SurfaceTextureClient : public TextureClient { public: SurfaceTextureClient(TextureFlags aFlags, - nsSurfaceTexture* aSurfTex, + AndroidSurfaceTexture* aSurfTex, gfx::IntSize aSize, bool aInverted); @@ -113,7 +113,7 @@ public: } protected: - const nsRefPtr mSurfTex; + const RefPtr mSurfTex; const gfx::IntSize mSize; bool mIsLocked; }; diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 4fa926f1891f..da44363dcb66 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -23,7 +23,7 @@ #include "mozilla/layers/GrallocTextureHost.h" #include "nsPoint.h" // for nsIntPoint #include "nsRegion.h" // for nsIntRegion -#include "nsSurfaceTexture.h" +#include "AndroidSurfaceTexture.h" #include "GfxTexturesReporter.h" // for GfxTexturesReporter #include "GLBlitTextureImageHelper.h" #ifdef XP_MACOSX @@ -58,7 +58,7 @@ CreateTextureHostOGL(const SurfaceDescriptor& aDesc, case SurfaceDescriptor::TSurfaceTextureDescriptor: { const SurfaceTextureDescriptor& desc = aDesc.get_SurfaceTextureDescriptor(); result = new SurfaceTextureHost(aFlags, - (nsSurfaceTexture*)desc.surfTex(), + (AndroidSurfaceTexture*)desc.surfTex(), desc.size()); break; } @@ -429,7 +429,7 @@ GLTextureSource::gl() const #ifdef MOZ_WIDGET_ANDROID SurfaceTextureSource::SurfaceTextureSource(CompositorOGL* aCompositor, - nsSurfaceTexture* aSurfTex, + AndroidSurfaceTexture* aSurfTex, gfx::SurfaceFormat aFormat, GLenum aTarget, GLenum aWrapMode, @@ -498,7 +498,7 @@ SurfaceTextureSource::GetTextureTransform() //////////////////////////////////////////////////////////////////////// SurfaceTextureHost::SurfaceTextureHost(TextureFlags aFlags, - nsSurfaceTexture* aSurfTex, + AndroidSurfaceTexture* aSurfTex, gfx::IntSize aSize) : TextureHost(aFlags) , mSurfTex(aSurfTex) diff --git a/gfx/layers/opengl/TextureHostOGL.h b/gfx/layers/opengl/TextureHostOGL.h index 1b9eb9a24246..ca2b19a15855 100644 --- a/gfx/layers/opengl/TextureHostOGL.h +++ b/gfx/layers/opengl/TextureHostOGL.h @@ -39,7 +39,6 @@ class gfxReusableSurfaceWrapper; class nsIntRegion; -class nsSurfaceTexture; struct nsIntPoint; struct nsIntRect; struct nsIntSize; @@ -49,6 +48,10 @@ namespace gfx { class DataSourceSurface; } +namespace gl { +class AndroidSurfaceTexture; +} + namespace layers { class Compositor; @@ -339,7 +342,7 @@ class SurfaceTextureSource : public TextureSource { public: SurfaceTextureSource(CompositorOGL* aCompositor, - nsSurfaceTexture* aSurfTex, + mozilla::gl::AndroidSurfaceTexture* aSurfTex, gfx::SurfaceFormat aFormat, GLenum aTarget, GLenum aWrapMode, @@ -370,7 +373,7 @@ public: protected: RefPtr mCompositor; - nsSurfaceTexture* const mSurfTex; + mozilla::gl::AndroidSurfaceTexture* const mSurfTex; const gfx::SurfaceFormat mFormat; const GLenum mTextureTarget; const GLenum mWrapMode; @@ -381,7 +384,7 @@ class SurfaceTextureHost : public TextureHost { public: SurfaceTextureHost(TextureFlags aFlags, - nsSurfaceTexture* aSurfTex, + mozilla::gl::AndroidSurfaceTexture* aSurfTex, gfx::IntSize aSize); virtual ~SurfaceTextureHost(); @@ -414,7 +417,7 @@ public: virtual const char* Name() { return "SurfaceTextureHost"; } protected: - nsSurfaceTexture* const mSurfTex; + mozilla::gl::AndroidSurfaceTexture* const mSurfTex; const gfx::IntSize mSize; RefPtr mCompositor; RefPtr mTextureSource; diff --git a/gfx/layers/opengl/TexturePoolOGL.h b/gfx/layers/opengl/TexturePoolOGL.h index 33270a60e1d8..8d913df6b2be 100644 --- a/gfx/layers/opengl/TexturePoolOGL.h +++ b/gfx/layers/opengl/TexturePoolOGL.h @@ -12,7 +12,7 @@ namespace gl { // A texture pool for for the on-screen GLContext. The main purpose of this class // is to provide the ability to easily allocate an on-screen texture from the -// content thread. The unfortunate nature of the SurfaceTexture API (see nsSurfaceTexture) +// content thread. The unfortunate nature of the SurfaceTexture API (see AndroidSurfaceTexture) // necessitates this. class TexturePoolOGL { diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build index 88d82ffaaa84..9ab8142cd7a8 100644 --- a/gfx/thebes/moz.build +++ b/gfx/thebes/moz.build @@ -49,7 +49,6 @@ EXPORTS += [ 'gfxUserFontSet.h', 'gfxUtils.h', 'GraphicsFilter.h', - 'nsSurfaceTexture.h', 'RoundedRect.h', ] @@ -242,7 +241,6 @@ UNIFIED_SOURCES += [ 'gfxTextRun.cpp', 'gfxUserFontSet.cpp', 'gfxUtils.cpp', - 'nsSurfaceTexture.cpp', 'nsUnicodeRange.cpp', ] diff --git a/widget/android/AndroidJNI.cpp b/widget/android/AndroidJNI.cpp index 75accb2524e6..bad1765a294b 100644 --- a/widget/android/AndroidJNI.cpp +++ b/widget/android/AndroidJNI.cpp @@ -40,7 +40,7 @@ #include "mozilla/layers/APZCTreeManager.h" #include "nsIMobileMessageDatabaseService.h" #include "nsPluginInstanceOwner.h" -#include "nsSurfaceTexture.h" +#include "AndroidSurfaceTexture.h" #include "GeckoProfiler.h" #include "nsMemoryPressure.h" @@ -862,9 +862,9 @@ Java_org_mozilla_gecko_GeckoAppShell_getNextMessageFromQueue(JNIEnv* jenv, jclas NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onSurfaceTextureFrameAvailable(JNIEnv* jenv, jclass, jobject surfaceTexture, jint id) { - nsSurfaceTexture* st = nsSurfaceTexture::Find(id); + mozilla::gl::AndroidSurfaceTexture* st = mozilla::gl::AndroidSurfaceTexture::Find(id); if (!st) { - __android_log_print(ANDROID_LOG_ERROR, "GeckoJNI", "Failed to find nsSurfaceTexture with id %d", id); + __android_log_print(ANDROID_LOG_ERROR, "GeckoJNI", "Failed to find AndroidSurfaceTexture with id %d", id); return; }