From 4ccc75ddae4c70e092c55a4d086f9e408aa5f64b Mon Sep 17 00:00:00 2001 From: James Willcox Date: Tue, 21 Oct 2014 08:53:00 -0500 Subject: [PATCH] Bug 1014614 - Rename nsSurfaceTexture to AndroidSurfaceTexture r=jgilbert --HG-- extra : rebase_source : 4f148d8a0c2f9ec2d939f9d9939dab897b435bef --- dom/plugins/base/nsNPAPIPluginInstance.cpp | 12 +-- dom/plugins/base/nsNPAPIPluginInstance.h | 12 +-- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 +- .../AndroidSurfaceTexture.cpp} | 102 +++++++++++------- .../AndroidSurfaceTexture.h} | 40 ++++--- gfx/gl/GLContextProviderEGL.cpp | 1 - gfx/gl/moz.build | 2 + gfx/layers/GLImages.h | 7 +- gfx/layers/opengl/TextureClientOGL.cpp | 2 +- gfx/layers/opengl/TextureClientOGL.h | 7 +- gfx/layers/opengl/TextureHostOGL.cpp | 8 +- gfx/layers/opengl/TextureHostOGL.h | 13 ++- gfx/layers/opengl/TexturePoolOGL.h | 2 +- gfx/thebes/moz.build | 2 - widget/android/AndroidJNI.cpp | 6 +- 15 files changed, 128 insertions(+), 90 deletions(-) rename gfx/{thebes/nsSurfaceTexture.cpp => gl/AndroidSurfaceTexture.cpp} (65%) rename gfx/{thebes/nsSurfaceTexture.h => gl/AndroidSurfaceTexture.h} (74%) diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index ad51c9cce87..3420cd407cd 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 421220c94e0..c3a35488bd6 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; }; @@ -329,7 +329,7 @@ protected: bool mInverted; nsRefPtr mContentTexture; - nsRefPtr mContentSurface; + nsRefPtr mContentSurface; #endif enum { @@ -378,7 +378,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 13885592e8d..c9d041fdeec 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 b9eb106864e..d31cc5b42e6 100644 --- a/gfx/thebes/nsSurfaceTexture.cpp +++ b/gfx/gl/AndroidSurfaceTexture.cpp @@ -9,15 +9,21 @@ #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; + +namespace mozilla { +namespace gl { // UGH -static std::map sInstances; +static std::map sInstances; static int sNextID = 0; static class JNIFunctions { @@ -41,6 +47,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 +66,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 +135,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 +157,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 +170,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 +184,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(); @@ -244,4 +265,7 @@ nsSurfaceTexture::NotifyFrameAvailable() } } +} // gl +} // mozilla + #endif // MOZ_WIDGET_ANDROID 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 6eee4ed722c..4dde7097c53 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 a706763e9e1..db6687f7fce 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 698e046c2e6..e1c6bc83c73 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 0b24c451e16..60fefc75993 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 4bf4b0fbb6a..12ef1c0dba3 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 1324fe5a20a..cde0580a6dd 100644 --- a/gfx/layers/opengl/TextureClientOGL.h +++ b/gfx/layers/opengl/TextureClientOGL.h @@ -13,9 +13,10 @@ #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 { class CompositableForwarder; @@ -74,7 +75,7 @@ class SurfaceTextureClient : public TextureClient { public: SurfaceTextureClient(TextureFlags aFlags, - nsSurfaceTexture* aSurfTex, + gl::AndroidSurfaceTexture* aSurfTex, gfx::IntSize aSize, bool aInverted); @@ -113,7 +114,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 0094d3f0107..ebd38b58c45 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 @@ -68,7 +68,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; } @@ -578,7 +578,7 @@ GLTextureSource::gl() const #ifdef MOZ_WIDGET_ANDROID SurfaceTextureSource::SurfaceTextureSource(CompositorOGL* aCompositor, - nsSurfaceTexture* aSurfTex, + AndroidSurfaceTexture* aSurfTex, gfx::SurfaceFormat aFormat, GLenum aTarget, GLenum aWrapMode, @@ -643,7 +643,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 7dc3eef0b7b..7407002eff4 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; @@ -413,7 +416,7 @@ class SurfaceTextureSource : public TextureSource { public: SurfaceTextureSource(CompositorOGL* aCompositor, - nsSurfaceTexture* aSurfTex, + mozilla::gl::AndroidSurfaceTexture* aSurfTex, gfx::SurfaceFormat aFormat, GLenum aTarget, GLenum aWrapMode, @@ -444,7 +447,7 @@ public: protected: RefPtr mCompositor; - nsSurfaceTexture* const mSurfTex; + mozilla::gl::AndroidSurfaceTexture* const mSurfTex; const gfx::SurfaceFormat mFormat; const GLenum mTextureTarget; const GLenum mWrapMode; @@ -455,7 +458,7 @@ class SurfaceTextureHost : public TextureHost { public: SurfaceTextureHost(TextureFlags aFlags, - nsSurfaceTexture* aSurfTex, + mozilla::gl::AndroidSurfaceTexture* aSurfTex, gfx::IntSize aSize); virtual ~SurfaceTextureHost(); @@ -488,7 +491,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 33270a60e1d..8d913df6b2b 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 88d82ffaaa8..9ab8142cd7a 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 75accb2524e..bad1765a294 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; }