summaryrefslogtreecommitdiffstats
path: root/gfx/gl
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/AndroidSurfaceTexture.cpp260
-rw-r--r--gfx/gl/AndroidSurfaceTexture.h107
-rw-r--r--gfx/gl/DecomposeIntoNoRepeatTriangles.cpp1
-rw-r--r--gfx/gl/DecomposeIntoNoRepeatTriangles.h1
-rw-r--r--gfx/gl/GLBlitHelper.cpp121
-rw-r--r--gfx/gl/GLBlitHelper.h6
-rw-r--r--gfx/gl/GLContext.cpp94
-rw-r--r--gfx/gl/GLContext.h14
-rw-r--r--gfx/gl/GLContextCGL.h1
-rw-r--r--gfx/gl/GLContextEAGL.h1
-rw-r--r--gfx/gl/GLContextEGL.h1
-rw-r--r--gfx/gl/GLContextGLX.h1
-rw-r--r--gfx/gl/GLContextProviderEGL.cpp83
-rw-r--r--gfx/gl/GLContextProviderImpl.h8
-rw-r--r--gfx/gl/GLContextWGL.h1
-rw-r--r--gfx/gl/GLLibraryEGL.cpp72
-rw-r--r--gfx/gl/GLLibraryEGL.h26
-rw-r--r--gfx/gl/GLReadTexImageHelper.cpp1
-rw-r--r--gfx/gl/GLReadTexImageHelper.h1
-rw-r--r--gfx/gl/GfxTexturesReporter.cpp1
-rw-r--r--gfx/gl/GfxTexturesReporter.h1
-rw-r--r--gfx/gl/HeapCopyOfStackArray.h1
-rw-r--r--gfx/gl/TextureGarbageBin.cpp1
-rw-r--r--gfx/gl/TextureGarbageBin.h1
-rw-r--r--gfx/gl/moz.build5
25 files changed, 8 insertions, 802 deletions
diff --git a/gfx/gl/AndroidSurfaceTexture.cpp b/gfx/gl/AndroidSurfaceTexture.cpp
deleted file mode 100644
index 3c8c81974..000000000
--- a/gfx/gl/AndroidSurfaceTexture.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-// vim:set ts=2 sts=2 sw=2 et cin:
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#ifdef MOZ_WIDGET_ANDROID
-
-#include <map>
-#include <android/native_window_jni.h>
-#include <android/log.h>
-#include "AndroidSurfaceTexture.h"
-#include "gfxImageSurface.h"
-#include "gfxPrefs.h"
-#include "AndroidBridge.h"
-#include "nsThreadUtils.h"
-#include "mozilla/gfx/Matrix.h"
-#include "GeneratedJNINatives.h"
-#include "GLContext.h"
-
-using namespace mozilla;
-
-namespace mozilla {
-namespace gl {
-
-class AndroidSurfaceTexture::Listener
- : public java::SurfaceTextureListener::Natives<Listener>
-{
- using Base = java::SurfaceTextureListener::Natives<Listener>;
-
- const nsCOMPtr<nsIRunnable> mCallback;
-
-public:
- using Base::AttachNative;
- using Base::DisposeNative;
-
- Listener(nsIRunnable* aCallback) : mCallback(aCallback) {}
-
- void OnFrameAvailable()
- {
- if (NS_IsMainThread()) {
- mCallback->Run();
- return;
- }
- NS_DispatchToMainThread(mCallback);
- }
-};
-
-already_AddRefed<AndroidSurfaceTexture>
-AndroidSurfaceTexture::Create()
-{
- return Create(nullptr, 0);
-}
-
-already_AddRefed<AndroidSurfaceTexture>
-AndroidSurfaceTexture::Create(GLContext* aContext, GLuint aTexture)
-{
- RefPtr<AndroidSurfaceTexture> st = new AndroidSurfaceTexture();
- if (!st->Init(aContext, aTexture)) {
- printf_stderr("Failed to initialize AndroidSurfaceTexture");
- st = nullptr;
- }
-
- return st.forget();
-}
-
-nsresult
-AndroidSurfaceTexture::Attach(GLContext* aContext, PRIntervalTime aTimeout)
-{
- MonitorAutoLock lock(mMonitor);
-
- if (mAttachedContext == aContext) {
- NS_WARNING("Tried to attach same GLContext to AndroidSurfaceTexture");
- return NS_OK;
- }
-
- if (!CanDetach()) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- while (mAttachedContext) {
- // Wait until it's detached (or we time out)
- if (NS_FAILED(lock.Wait(aTimeout))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- }
-
- MOZ_ASSERT(aContext->IsOwningThreadCurrent(), "Trying to attach GLContext from different thread");
-
- aContext->fGenTextures(1, &mTexture);
-
- if (NS_FAILED(mSurfaceTexture->AttachToGLContext(mTexture))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- mAttachedContext = aContext;
- mAttachedContext->MakeCurrent();
-
- return NS_OK;
-}
-
-nsresult
-AndroidSurfaceTexture::Detach()
-{
- MonitorAutoLock lock(mMonitor);
-
- if (!CanDetach() ||
- !mAttachedContext ||
- !mAttachedContext->IsOwningThreadCurrent())
- {
- return NS_ERROR_FAILURE;
- }
-
- mAttachedContext->MakeCurrent();
-
- mSurfaceTexture->DetachFromGLContext();
-
- mTexture = 0;
- mAttachedContext = nullptr;
- lock.NotifyAll();
- return NS_OK;
-}
-
-bool
-AndroidSurfaceTexture::CanDetach() const
-{
- // The API for attach/detach only exists on 16+, and PowerVR has some sort of
- // fencing issue. Additionally, attach/detach seems to be busted on at least
- // some Mali adapters (400MP2 for sure, bug 1131793)
- return AndroidBridge::Bridge()->GetAPIVersion() >= 16 &&
- (!mAttachedContext || mAttachedContext->Vendor() != GLVendor::Imagination) &&
- (!mAttachedContext || mAttachedContext->Vendor() != GLVendor::ARM /* Mali */) &&
- gfxPrefs::SurfaceTextureDetachEnabled();
-}
-
-bool
-AndroidSurfaceTexture::Init(GLContext* aContext, GLuint aTexture)
-{
-
- if (!aTexture && !CanDetach()) {
- // We have no texture and cannot initialize detached, bail out
- return false;
- }
-
- if (NS_WARN_IF(NS_FAILED(
- java::sdk::SurfaceTexture::New(aTexture, ReturnTo(&mSurfaceTexture))))) {
- return false;
- }
-
- if (!aTexture) {
- mSurfaceTexture->DetachFromGLContext();
- }
-
- mAttachedContext = aContext;
-
- if (NS_WARN_IF(NS_FAILED(
- java::sdk::Surface::New(mSurfaceTexture, ReturnTo(&mSurface))))) {
- return false;
- }
-
- mNativeWindow = ANativeWindow_fromSurface(jni::GetEnvForThread(),
- mSurface.Get());
- MOZ_ASSERT(mNativeWindow, "Failed to create native window from surface");
-
- return true;
-}
-
-AndroidSurfaceTexture::AndroidSurfaceTexture()
- : mTexture(0)
- , mSurfaceTexture()
- , mSurface()
- , mAttachedContext(nullptr)
- , mMonitor("AndroidSurfaceTexture")
-{
-}
-
-AndroidSurfaceTexture::~AndroidSurfaceTexture()
-{
- if (mSurfaceTexture) {
- SetFrameAvailableCallback(nullptr);
- mSurfaceTexture = nullptr;
- }
-
- if (mNativeWindow) {
- ANativeWindow_release(mNativeWindow);
- mNativeWindow = nullptr;
- }
-}
-
-void
-AndroidSurfaceTexture::UpdateTexImage()
-{
- mSurfaceTexture->UpdateTexImage();
-}
-
-void
-AndroidSurfaceTexture::GetTransformMatrix(gfx::Matrix4x4& aMatrix) const
-{
- JNIEnv* const env = jni::GetEnvForThread();
-
- auto jarray = jni::FloatArray::LocalRef::Adopt(env, env->NewFloatArray(16));
- mSurfaceTexture->GetTransformMatrix(jarray);
-
- jfloat* array = env->GetFloatArrayElements(jarray.Get(), nullptr);
-
- aMatrix._11 = array[0];
- aMatrix._12 = array[1];
- aMatrix._13 = array[2];
- aMatrix._14 = array[3];
-
- aMatrix._21 = array[4];
- aMatrix._22 = array[5];
- aMatrix._23 = array[6];
- aMatrix._24 = array[7];
-
- aMatrix._31 = array[8];
- aMatrix._32 = array[9];
- aMatrix._33 = array[10];
- aMatrix._34 = array[11];
-
- aMatrix._41 = array[12];
- aMatrix._42 = array[13];
- aMatrix._43 = array[14];
- aMatrix._44 = array[15];
-
- env->ReleaseFloatArrayElements(jarray.Get(), array, 0);
-}
-
-void
-AndroidSurfaceTexture::SetFrameAvailableCallback(nsIRunnable* aRunnable)
-{
- java::SurfaceTextureListener::LocalRef newListener;
-
- if (aRunnable) {
- newListener = java::SurfaceTextureListener::New();
- Listener::AttachNative(newListener, MakeUnique<Listener>(aRunnable));
- }
-
- if (aRunnable || mListener) {
- MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
- mSurfaceTexture->SetOnFrameAvailableListener(newListener)));
- }
-
- if (mListener) {
- Listener::DisposeNative(java::SurfaceTextureListener::LocalRef(
- newListener.Env(), mListener));
- }
-
- mListener = newListener;
-}
-
-void
-AndroidSurfaceTexture::SetDefaultSize(mozilla::gfx::IntSize size)
-{
- mSurfaceTexture->SetDefaultBufferSize(size.width, size.height);
-}
-
-} // gl
-} // mozilla
-
-#endif // MOZ_WIDGET_ANDROID
diff --git a/gfx/gl/AndroidSurfaceTexture.h b/gfx/gl/AndroidSurfaceTexture.h
deleted file mode 100644
index 056fab326..000000000
--- a/gfx/gl/AndroidSurfaceTexture.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-// vim:set ts=2 sts=2 sw=2 et cin:
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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 AndroidSurfaceTexture_h__
-#define AndroidSurfaceTexture_h__
-#ifdef MOZ_WIDGET_ANDROID
-
-#include <jni.h>
-#include <android/native_window.h>
-#include "nsIRunnable.h"
-#include "gfxPlatform.h"
-#include "GLDefs.h"
-#include "mozilla/gfx/2D.h"
-#include "mozilla/gfx/MatrixFwd.h"
-#include "mozilla/Monitor.h"
-
-#include "GeneratedJNIWrappers.h"
-#include "SurfaceTexture.h"
-
-namespace mozilla {
-namespace gl {
-
-class GLContext;
-
-/**
- * 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 AndroidSurfaceTexture {
- NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AndroidSurfaceTexture)
-
-public:
-
- // The SurfaceTexture is created in an attached state. This method requires
- // Android Ice Cream Sandwich.
- static already_AddRefed<AndroidSurfaceTexture> Create(GLContext* aGLContext, GLuint aTexture);
-
- // Here the SurfaceTexture will be created in a detached state. You must call
- // Attach() with the GLContext you wish to composite with. It must be done
- // on the thread where that GLContext is current. This method requires
- // Android Jelly Bean.
- static already_AddRefed<AndroidSurfaceTexture> Create();
-
- // If we are on Jelly Bean, the SurfaceTexture can be detached and reattached
- // to allow consumption from different GLContexts. It is recommended to only
- // attach while you are consuming in order to allow this.
- //
- // Only one GLContext may be attached at any given time. If another is already
- // attached, we try to wait for it to become detached.
- nsresult Attach(GLContext* aContext, PRIntervalTime aTiemout = PR_INTERVAL_NO_TIMEOUT);
-
- nsresult Detach();
-
- // Ability to detach is based on API version (16+), and we also block PowerVR
- // since it has some type of fencing problem. Bug 1100126.
- bool CanDetach() const;
-
- GLContext* AttachedContext() const { return mAttachedContext; }
-
- ANativeWindow* NativeWindow() const {
- return mNativeWindow;
- }
-
- // This attaches the updated data to the TEXTURE_EXTERNAL target
- void UpdateTexImage();
-
- void GetTransformMatrix(mozilla::gfx::Matrix4x4& aMatrix) const;
-
- void SetDefaultSize(mozilla::gfx::IntSize size);
-
- // The callback is guaranteed to be called on the main thread even
- // if the upstream callback is received on a different thread
- void SetFrameAvailableCallback(nsIRunnable* aRunnable);
-
- GLuint Texture() const { return mTexture; }
- const java::sdk::Surface::Ref& JavaSurface() const { return mSurface; }
-
-private:
- class Listener;
-
- AndroidSurfaceTexture();
- ~AndroidSurfaceTexture();
-
- bool Init(GLContext* aContext, GLuint aTexture);
-
- GLuint mTexture;
- java::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
- java::sdk::Surface::GlobalRef mSurface;
- java::SurfaceTextureListener::GlobalRef mListener;
-
- GLContext* mAttachedContext;
-
- ANativeWindow* mNativeWindow;
-
- Monitor mMonitor;
-};
-
-}
-}
-
-
-#endif
-#endif
diff --git a/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp b/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
index 829c20187..1e6553604 100644
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/DecomposeIntoNoRepeatTriangles.h b/gfx/gl/DecomposeIntoNoRepeatTriangles.h
index f67d6f93e..2d79b0a33 100644
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GLBlitHelper.cpp b/gfx/gl/GLBlitHelper.cpp
index cffa5fbe5..da7f5b462 100644
--- a/gfx/gl/GLBlitHelper.cpp
+++ b/gfx/gl/GLBlitHelper.cpp
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
@@ -15,12 +14,6 @@
#include "mozilla/gfx/Matrix.h"
#include "mozilla/UniquePtr.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidSurfaceTexture.h"
-#include "GLImages.h"
-#include "GLLibraryEGL.h"
-#endif
-
#ifdef XP_MACOSX
#include "MacIOSurfaceImage.h"
#include "GLContextCGL.h"
@@ -147,26 +140,6 @@ GLBlitHelper::InitTexQuadProgram(BlitType target)
vTexCoord * uTexCoordMult); \n\
} \n\
";
-#ifdef ANDROID /* MOZ_WIDGET_ANDROID */
- const char kTexExternalBlit_FragShaderSource[] = "\
- #version 100 \n\
- #extension GL_OES_EGL_image_external : require \n\
- #ifdef GL_FRAGMENT_PRECISION_HIGH \n\
- precision highp float; \n\
- #else \n\
- precision mediump float; \n\
- #endif \n\
- varying vec2 vTexCoord; \n\
- uniform mat4 uTextureTransform; \n\
- uniform samplerExternalOES uTexUnit; \n\
- \n\
- void main() \n\
- { \n\
- gl_FragColor = texture2D(uTexUnit, \n\
- (uTextureTransform * vec4(vTexCoord, 0.0, 1.0)).xy); \n\
- } \n\
- ";
-#endif
/* From Rec601:
[R] [1.1643835616438356, 0.0, 1.5960267857142858] [ Y - 16]
[G] = [1.1643835616438358, -0.3917622900949137, -0.8129676472377708] x [Cb - 128]
@@ -258,14 +231,6 @@ GLBlitHelper::InitTexQuadProgram(BlitType target)
fragShaderPtr = &mTex2DRectBlit_FragShader;
fragShaderSource = kTex2DRectBlit_FragShaderSource;
break;
-#ifdef ANDROID
- case ConvertSurfaceTexture:
- case ConvertGralloc:
- programPtr = &mTexExternalBlit_Program;
- fragShaderPtr = &mTexExternalBlit_FragShader;
- fragShaderSource = kTexExternalBlit_FragShaderSource;
- break;
-#endif
case ConvertPlanarYCbCr:
programPtr = &mTexYUVPlanarBlit_Program;
fragShaderPtr = &mTexYUVPlanarBlit_FragShader;
@@ -399,10 +364,6 @@ GLBlitHelper::InitTexQuadProgram(BlitType target)
// Cache and set attribute and uniform
mGL->fUseProgram(program);
switch (target) {
-#ifdef ANDROID
- case ConvertSurfaceTexture:
- case ConvertGralloc:
-#endif
case BlitTex2D:
case BlitTexRect:
case ConvertEGLImage: {
@@ -679,67 +640,6 @@ GLBlitHelper::BindAndUploadEGLImage(EGLImage image, GLuint target)
mGL->fEGLImageTargetTexture2D(target, image);
}
-#ifdef MOZ_WIDGET_ANDROID
-
-#define ATTACH_WAIT_MS 50
-
-bool
-GLBlitHelper::BlitSurfaceTextureImage(layers::SurfaceTextureImage* stImage)
-{
- AndroidSurfaceTexture* surfaceTexture = stImage->GetSurfaceTexture();
-
- ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0);
-
- if (NS_FAILED(surfaceTexture->Attach(mGL, PR_MillisecondsToInterval(ATTACH_WAIT_MS))))
- return false;
-
- // UpdateTexImage() changes the EXTERNAL binding, so save it here
- // so we can restore it after.
- int oldBinding = 0;
- mGL->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_EXTERNAL, &oldBinding);
-
- surfaceTexture->UpdateTexImage();
-
- gfx::Matrix4x4 transform;
- surfaceTexture->GetTransformMatrix(transform);
-
- mGL->fUniformMatrix4fv(mTextureTransformLoc, 1, false, &transform._11);
- mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
-
- surfaceTexture->Detach();
-
- mGL->fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, oldBinding);
- return true;
-}
-
-bool
-GLBlitHelper::BlitEGLImageImage(layers::EGLImageImage* image)
-{
- EGLImage eglImage = image->GetImage();
- EGLSync eglSync = image->GetSync();
-
- if (eglSync) {
- EGLint status = sEGLLibrary.fClientWaitSync(EGL_DISPLAY(), eglSync, 0, LOCAL_EGL_FOREVER);
- if (status != LOCAL_EGL_CONDITION_SATISFIED) {
- return false;
- }
- }
-
- ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0);
-
- int oldBinding = 0;
- mGL->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_2D, &oldBinding);
-
- BindAndUploadEGLImage(eglImage, LOCAL_GL_TEXTURE_2D);
-
- mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
-
- mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, oldBinding);
- return true;
-}
-
-#endif
-
bool
GLBlitHelper::BlitPlanarYCbCrImage(layers::PlanarYCbCrImage* yuvImage)
{
@@ -836,16 +736,6 @@ GLBlitHelper::BlitImageToFramebuffer(layers::Image* srcImage,
srcOrigin = OriginPos::BottomLeft;
break;
-#ifdef MOZ_WIDGET_ANDROID
- case ImageFormat::SURFACE_TEXTURE:
- type = ConvertSurfaceTexture;
- srcOrigin = srcImage->AsSurfaceTextureImage()->GetOriginPos();
- break;
- case ImageFormat::EGLIMAGE:
- type = ConvertEGLImage;
- srcOrigin = srcImage->AsEGLImageImage()->GetOriginPos();
- break;
-#endif
#ifdef XP_MACOSX
case ImageFormat::MAC_IOSURFACE:
type = ConvertMacIOSurfaceImage;
@@ -878,14 +768,6 @@ GLBlitHelper::BlitImageToFramebuffer(layers::Image* srcImage,
return ret;
}
-#ifdef MOZ_WIDGET_ANDROID
- case ConvertSurfaceTexture:
- return BlitSurfaceTextureImage(static_cast<layers::SurfaceTextureImage*>(srcImage));
-
- case ConvertEGLImage:
- return BlitEGLImageImage(static_cast<layers::EGLImageImage*>(srcImage));
-#endif
-
#ifdef XP_MACOSX
case ConvertMacIOSurfaceImage:
return BlitMacIOSurfaceImage(srcImage->AsMacIOSurfaceImage());
@@ -984,8 +866,7 @@ GLBlitHelper::BlitFramebufferToTexture(GLuint srcFB, GLuint destTex,
GLenum destTarget,
bool internalFBs)
{
- // On the Android 4.3 emulator, IsFramebuffer may return false incorrectly.
- MOZ_ASSERT_IF(mGL->Renderer() != GLRenderer::AndroidEmulator, !srcFB || mGL->fIsFramebuffer(srcFB));
+ MOZ_ASSERT(!srcFB || mGL->fIsFramebuffer(srcFB));
MOZ_ASSERT(mGL->fIsTexture(destTex));
if (mGL->IsSupported(GLFeature::framebuffer_blit)) {
diff --git a/gfx/gl/GLBlitHelper.h b/gfx/gl/GLBlitHelper.h
index 31d6a2f5b..c2858f591 100644
--- a/gfx/gl/GLBlitHelper.h
+++ b/gfx/gl/GLBlitHelper.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
@@ -108,11 +107,6 @@ class GLBlitHelper final
void BindAndUploadEGLImage(EGLImage image, GLuint target);
bool BlitPlanarYCbCrImage(layers::PlanarYCbCrImage* yuvImage);
-#ifdef MOZ_WIDGET_ANDROID
- // Blit onto the current FB.
- bool BlitSurfaceTextureImage(layers::SurfaceTextureImage* stImage);
- bool BlitEGLImageImage(layers::EGLImageImage* eglImage);
-#endif
#ifdef XP_MACOSX
bool BlitMacIOSurfaceImage(layers::MacIOSurfaceImage* ioImage);
#endif
diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp
index 93ec040f4..72a7bea58 100644
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
@@ -11,9 +10,6 @@
#include <string.h>
#include <ctype.h>
#include <vector>
-#ifdef MOZ_WIDGET_ANDROID
-#include <sys/mman.h>
-#endif
#include "GLBlitHelper.h"
#include "GLReadTexImageHelper.h"
@@ -48,10 +44,6 @@
#include "nsCocoaFeatures.h"
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
-#endif
-
namespace mozilla {
namespace gl {
@@ -235,7 +227,7 @@ ParseGLSLVersion(GLContext* gl, uint32_t* out_version)
}
if (!versionString) {
- // This happens on the Android emulators. We'll just return 100
+ MOZ_ASSERT(false, "LOCAL_GL_SHADING_LANGUAGE_VERSION undefined, returning 100");
*out_version = 100;
return true;
}
@@ -1057,28 +1049,6 @@ GLContext::InitWithPrefixImpl(const char* prefix, bool trygl)
// prevents occasional driver crash.
mNeedsFlushBeforeDeleteFB = true;
}
-#ifdef MOZ_WIDGET_ANDROID
- if (mWorkAroundDriverBugs &&
- (Renderer() == GLRenderer::AdrenoTM305 ||
- Renderer() == GLRenderer::AdrenoTM320 ||
- Renderer() == GLRenderer::AdrenoTM330) &&
- AndroidBridge::Bridge()->GetAPIVersion() < 21) {
- // Bug 1164027. Driver crashes when functions such as
- // glTexImage2D fail due to virtual memory exhaustion.
- mTextureAllocCrashesOnMapFailure = true;
- }
-#endif
-#if MOZ_WIDGET_ANDROID
- if (mWorkAroundDriverBugs &&
- Renderer() == GLRenderer::SGX540 &&
- AndroidBridge::Bridge()->GetAPIVersion() <= 15) {
- // Bug 1288446. Driver sometimes crashes when uploading data to a
- // texture if the render target has changed since the texture was
- // rendered from. Calling glCheckFramebufferStatus after
- // glFramebufferTexture2D prevents the crash.
- mNeedsCheckAfterAttachTextureToFb = true;
- }
-#endif
mMaxTextureImageSize = mMaxTextureSize;
@@ -1811,17 +1781,6 @@ GLContext::InitExtensions()
MarkExtensionUnsupported(OES_EGL_sync);
}
-#ifdef MOZ_WIDGET_ANDROID
- if (Vendor() == GLVendor::Imagination &&
- Renderer() == GLRenderer::SGX544MP &&
- AndroidBridge::Bridge()->GetAPIVersion() < 21)
- {
- // Bug 1026404
- MarkExtensionUnsupported(OES_EGL_image);
- MarkExtensionUnsupported(OES_EGL_image_external);
- }
-#endif
-
if (Vendor() == GLVendor::ARM &&
(Renderer() == GLRenderer::Mali400MP ||
Renderer() == GLRenderer::Mali450MP))
@@ -1830,16 +1789,6 @@ GLContext::InitExtensions()
MarkExtensionUnsupported(OES_EGL_image_external);
}
- if (Renderer() == GLRenderer::AndroidEmulator) {
- // the Android emulator, which we use to run B2G reftests on,
- // doesn't expose the OES_rgb8_rgba8 extension, but it seems to
- // support it (tautologically, as it only runs on desktop GL).
- MarkExtensionSupported(OES_rgb8_rgba8);
- // there seems to be a similar issue for EXT_texture_format_BGRA8888
- // on the Android 4.3 emulator
- MarkExtensionSupported(EXT_texture_format_BGRA8888);
- }
-
if (Vendor() == GLVendor::VMware &&
Renderer() == GLRenderer::GalliumLlvmpipe)
{
@@ -2038,8 +1987,7 @@ GLContext::AttachBuffersToFB(GLuint colorTex, GLuint colorRB,
colorTex,
0);
} else if (colorRB) {
- // On the Android 4.3 emulator, IsRenderbuffer may return false incorrectly.
- MOZ_ASSERT_IF(Renderer() != GLRenderer::AndroidEmulator, fIsRenderbuffer(colorRB));
+ MOZ_ASSERT(fIsRenderbuffer(colorRB));
fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER,
LOCAL_GL_COLOR_ATTACHMENT0,
LOCAL_GL_RENDERBUFFER,
@@ -2047,7 +1995,7 @@ GLContext::AttachBuffersToFB(GLuint colorTex, GLuint colorRB,
}
if (depthRB) {
- MOZ_ASSERT_IF(Renderer() != GLRenderer::AndroidEmulator, fIsRenderbuffer(depthRB));
+ MOZ_ASSERT(fIsRenderbuffer(depthRB));
fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER,
LOCAL_GL_DEPTH_ATTACHMENT,
LOCAL_GL_RENDERBUFFER,
@@ -2055,7 +2003,7 @@ GLContext::AttachBuffersToFB(GLuint colorTex, GLuint colorRB,
}
if (stencilRB) {
- MOZ_ASSERT_IF(Renderer() != GLRenderer::AndroidEmulator, fIsRenderbuffer(stencilRB));
+ MOZ_ASSERT(fIsRenderbuffer(stencilRB));
fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER,
LOCAL_GL_STENCIL_ATTACHMENT,
LOCAL_GL_RENDERBUFFER,
@@ -2935,29 +2883,6 @@ GLContext::fDeleteFramebuffers(GLsizei n, const GLuint* names)
TRACKING_CONTEXT(DeletedFramebuffers(this, n, names));
}
-#ifdef MOZ_WIDGET_ANDROID
-/**
- * Conservatively estimate whether there is enough available
- * contiguous virtual address space to map a newly allocated texture.
- */
-static bool
-WillTextureMapSucceed(GLsizei width, GLsizei height, GLenum format, GLenum type)
-{
- bool willSucceed = false;
- // Some drivers leave large gaps between textures, so require
- // there to be double the actual size of the texture available.
- size_t size = width * height * GetBytesPerTexel(format, type) * 2;
-
- void *p = mmap(nullptr, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (p != MAP_FAILED) {
- willSucceed = true;
- munmap(p, size);
- }
-
- return willSucceed;
-}
-#endif // MOZ_WIDGET_ANDROID
-
void
GLContext::fTexImage2D(GLenum target, GLint level, GLint internalformat,
GLsizei width, GLsizei height, GLint border,
@@ -2970,17 +2895,6 @@ GLContext::fTexImage2D(GLenum target, GLint level, GLint internalformat,
height = -1;
border = -1;
}
-#if MOZ_WIDGET_ANDROID
- if (mTextureAllocCrashesOnMapFailure) {
- // We have no way of knowing whether this texture already has
- // storage allocated for it, and therefore whether this check
- // is necessary. We must therefore assume it does not and
- // always perform the check.
- if (!WillTextureMapSucceed(width, height, internalformat, type)) {
- return;
- }
- }
-#endif
raw_fTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
}
diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h
index 4c1f4f55c..5f0f5a4e8 100644
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
@@ -789,18 +788,10 @@ private:
static void AssertNotPassingStackBufferToTheGL(const void* ptr);
-#ifdef MOZ_WIDGET_ANDROID
-// Record the name of the GL call for better hang stacks on Android.
-#define BEFORE_GL_CALL \
- PROFILER_LABEL_FUNC( \
- js::ProfileEntry::Category::GRAPHICS);\
- BeforeGLCall(MOZ_FUNCTION_NAME)
-#else
#define BEFORE_GL_CALL \
do { \
BeforeGLCall(MOZ_FUNCTION_NAME); \
} while (0)
-#endif
#define AFTER_GL_CALL \
do { \
@@ -816,12 +807,7 @@ private:
#else // ifdef MOZ_GL_DEBUG
-#ifdef MOZ_WIDGET_ANDROID
-// Record the name of the GL call for better hang stacks on Android.
-#define BEFORE_GL_CALL PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS)
-#else
#define BEFORE_GL_CALL do { } while (0)
-#endif
#define AFTER_GL_CALL do { } while (0)
#define TRACKING_CONTEXT(a) do {} while (0)
#define ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(ptr) do {} while (0)
diff --git a/gfx/gl/GLContextCGL.h b/gfx/gl/GLContextCGL.h
index 23616d861..29d5d982d 100644
--- a/gfx/gl/GLContextCGL.h
+++ b/gfx/gl/GLContextCGL.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GLContextEAGL.h b/gfx/gl/GLContextEAGL.h
index df25d0f1e..f677d23d5 100644
--- a/gfx/gl/GLContextEAGL.h
+++ b/gfx/gl/GLContextEAGL.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GLContextEGL.h b/gfx/gl/GLContextEGL.h
index 64b9b13fb..3aa2c4cdc 100644
--- a/gfx/gl/GLContextEGL.h
+++ b/gfx/gl/GLContextEGL.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GLContextGLX.h b/gfx/gl/GLContextGLX.h
index 0463669e9..f7dd90c2b 100644
--- a/gfx/gl/GLContextGLX.h
+++ b/gfx/gl/GLContextGLX.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp
index e39858a92..ad515e604 100644
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -11,20 +11,7 @@
#define GET_NATIVE_WINDOW(aWidget) ((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_WINDOW))
#endif
-#ifdef MOZ_WIDGET_ANDROID
- #define GET_JAVA_SURFACE(aWidget) (aWidget->GetNativeData(NS_JAVA_SURFACE))
-#endif
-
#if defined(XP_UNIX)
- #ifdef MOZ_WIDGET_ANDROID
- #include <android/native_window.h>
- #include <android/native_window_jni.h>
- #endif
-
- #ifdef ANDROID
- #include <android/log.h>
- #define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Android" , ## args)
- #endif
#define GLES2_LIB "libGLESv2.so"
#define GLES2_LIB2 "libGLESv2.so.2"
@@ -164,22 +151,8 @@ CreateSurfaceForWindow(nsIWidget* widget, const EGLConfig& config) {
EGLSurface newSurface = nullptr;
MOZ_ASSERT(widget);
-#ifdef MOZ_WIDGET_ANDROID
- void* javaSurface = GET_JAVA_SURFACE(widget);
- if (!javaSurface) {
- MOZ_CRASH("GFX: Failed to get Java surface.\n");
- }
- JNIEnv* const env = jni::GetEnvForThread();
- ANativeWindow* const nativeWindow = ANativeWindow_fromSurface(
- env, reinterpret_cast<jobject>(javaSurface));
- newSurface = sEGLLibrary.fCreateWindowSurface(
- sEGLLibrary.fGetDisplay(EGL_DEFAULT_DISPLAY),
- config, nativeWindow, 0);
- ANativeWindow_release(nativeWindow);
-#else
newSurface = sEGLLibrary.fCreateWindowSurface(EGL_DISPLAY(), config,
GET_NATIVE_WINDOW(widget), 0);
-#endif
return newSurface;
}
@@ -229,11 +202,6 @@ GLContextEGL::~GLContextEGL()
bool
GLContextEGL::Init()
{
-#if defined(ANDROID)
- // We can't use LoadApitraceLibrary here because the GLContext
- // expects its own handle to the GL library
- if (!OpenLibrary(APITRACE_LIB))
-#endif
if (!OpenLibrary(GLES2_LIB)) {
#if defined(XP_UNIX)
if (!OpenLibrary(GLES2_LIB2)) {
@@ -432,10 +400,8 @@ GLContextEGL::GetWSIInfo(nsCString* const out) const
out->AppendLiteral("\nEGL_EXTENSIONS: ");
out->Append((const char*)sEGLLibrary.fQueryString(EGL_DISPLAY(), LOCAL_EGL_EXTENSIONS));
-#ifndef ANDROID // This query will crash some old android.
out->AppendLiteral("\nEGL_EXTENSIONS(nullptr): ");
out->Append((const char*)sEGLLibrary.fQueryString(nullptr, LOCAL_EGL_EXTENSIONS));
-#endif
}
// hold a reference to the given surface
@@ -685,18 +651,6 @@ CreateConfig(EGLConfig* aConfig, nsIWidget* aWidget)
{
int32_t depth = gfxPlatform::GetPlatform()->GetScreenDepth();
if (!CreateConfig(aConfig, depth, aWidget)) {
-#ifdef MOZ_WIDGET_ANDROID
- // Bug 736005
- // Android doesn't always support 16 bit so also try 24 bit
- if (depth == 16) {
- return CreateConfig(aConfig, 24, aWidget);
- }
- // Bug 970096
- // Some devices that have 24 bit screens only support 16 bit OpenGL?
- if (depth == 24) {
- return CreateConfig(aConfig, 16, aWidget);
- }
-#endif
return false;
} else {
return true;
@@ -771,43 +725,6 @@ GLContextProviderEGL::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated
return gl.forget();
}
-#if defined(ANDROID)
-EGLSurface
-GLContextProviderEGL::CreateEGLSurface(void* aWindow)
-{
- nsCString discardFailureId;
- if (!sEGLLibrary.EnsureInitialized(false, &discardFailureId)) {
- MOZ_CRASH("GFX: Failed to load EGL library 4!\n");
- }
-
- EGLConfig config;
- if (!CreateConfig(&config, static_cast<nsIWidget*>(aWindow))) {
- MOZ_CRASH("GFX: Failed to create EGLConfig 2!\n");
- }
-
- MOZ_ASSERT(aWindow);
-
- EGLSurface surface = sEGLLibrary.fCreateWindowSurface(EGL_DISPLAY(), config, aWindow,
- 0);
- if (surface == EGL_NO_SURFACE) {
- MOZ_CRASH("GFX: Failed to create EGLSurface 2!\n");
- }
-
- return surface;
-}
-
-void
-GLContextProviderEGL::DestroyEGLSurface(EGLSurface surface)
-{
- nsCString discardFailureId;
- if (!sEGLLibrary.EnsureInitialized(false, &discardFailureId)) {
- MOZ_CRASH("GFX: Failed to load EGL library 5!\n");
- }
-
- sEGLLibrary.fDestroySurface(EGL_DISPLAY(), surface);
-}
-#endif // defined(ANDROID)
-
static void
FillContextAttribs(bool alpha, bool depth, bool stencil, bool bpp16,
bool es3, nsTArray<EGLint>* out)
diff --git a/gfx/gl/GLContextProviderImpl.h b/gfx/gl/GLContextProviderImpl.h
index 7b63905e6..0a5d30eaa 100644
--- a/gfx/gl/GLContextProviderImpl.h
+++ b/gfx/gl/GLContextProviderImpl.h
@@ -10,9 +10,6 @@
#ifndef GL_CONTEXT_PROVIDER_NAME
#error GL_CONTEXT_PROVIDER_NAME not defined
#endif
-#if defined(ANDROID)
-typedef void* EGLSurface;
-#endif // defined(ANDROID)
class GL_CONTEXT_PROVIDER_NAME
{
@@ -111,11 +108,6 @@ public:
static already_AddRefed<GLContext>
CreateWrappingExisting(void* aContext, void* aSurface);
-#if defined(ANDROID)
- static EGLSurface CreateEGLSurface(void* aWindow);
- static void DestroyEGLSurface(EGLSurface surface);
-#endif // defined(ANDROID)
-
/**
* Get a pointer to the global context, creating it if it doesn't exist.
*/
diff --git a/gfx/gl/GLContextWGL.h b/gfx/gl/GLContextWGL.h
index 839b10aa7..52d28042c 100644
--- a/gfx/gl/GLContextWGL.h
+++ b/gfx/gl/GLContextWGL.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp
index b8b53f7c2..5b95d83b2 100644
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -54,46 +54,6 @@ static const char* sEGLExtensionNames[] = {
"EGL_ANGLE_platform_angle_d3d"
};
-#if defined(ANDROID)
-
-static PRLibrary* LoadApitraceLibrary()
-{
- // Initialization of gfx prefs here is only needed during the unit tests...
- gfxPrefs::GetSingleton();
- if (!gfxPrefs::UseApitrace()) {
- return nullptr;
- }
-
- static PRLibrary* sApitraceLibrary = nullptr;
-
- if (sApitraceLibrary)
- return sApitraceLibrary;
-
- nsCString logFile = Preferences::GetCString("gfx.apitrace.logfile");
-
- if (logFile.IsEmpty()) {
- logFile = "firefox.trace";
- }
-
- // The firefox process can't write to /data/local, but it can write
- // to $GRE_HOME/
- nsAutoCString logPath;
- logPath.AppendPrintf("%s/%s", getenv("GRE_HOME"), logFile.get());
-
- // apitrace uses the TRACE_FILE environment variable to determine where
- // to log trace output to
- printf_stderr("Logging GL tracing output to %s", logPath.get());
- setenv("TRACE_FILE", logPath.get(), false);
-
- printf_stderr("Attempting load of %s\n", APITRACE_LIB);
-
- sApitraceLibrary = PR_LoadLibrary(APITRACE_LIB);
-
- return sApitraceLibrary;
-}
-
-#endif // ANDROID
-
#ifdef XP_WIN
// see the comment in GLLibraryEGL::EnsureInitialized() for the rationale here.
static PRLibrary*
@@ -348,13 +308,8 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
#else // !Windows
- // On non-Windows (Android) we use system copies of libEGL. We look for
- // the APITrace lib, libEGL.so, and libEGL.so.1 in that order.
-
-#if defined(ANDROID)
- if (!mEGLLibrary)
- mEGLLibrary = LoadApitraceLibrary();
-#endif
+ // On non-Windows we use system copies of libEGL. We look for
+ // libEGL.so and libEGL.so.1 in that order.
if (!mEGLLibrary) {
printf_stderr("Attempting load of libEGL.so\n");
@@ -593,24 +548,6 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
MarkExtensionUnsupported(KHR_image_pixmap);
}
- if (IsExtensionSupported(ANDROID_native_fence_sync)) {
- GLLibraryLoader::SymLoadStruct nativeFenceSymbols[] = {
- { (PRFuncPtr*) &mSymbols.fDupNativeFenceFDANDROID, { "eglDupNativeFenceFDANDROID", nullptr } },
- { nullptr, { nullptr } }
- };
-
- bool success = GLLibraryLoader::LoadSymbols(mEGLLibrary,
- &nativeFenceSymbols[0],
- lookupFunction);
- if (!success) {
- NS_ERROR("EGL supports ANDROID_native_fence_sync without exposing its functions!");
-
- MarkExtensionUnsupported(ANDROID_native_fence_sync);
-
- mSymbols.fDupNativeFenceFDANDROID = nullptr;
- }
- }
-
mInitialized = true;
return true;
}
@@ -642,12 +579,7 @@ GLLibraryEGL::InitClientExtensions()
const char* rawExtString = nullptr;
-#ifndef ANDROID
- // Bug 1209612: Crashes on a number of android drivers.
- // Ideally we would only blocklist this there, but for now we don't need the client
- // extension list on ANDROID (we mostly need it on ANGLE), and we'd rather not crash.
rawExtString = (const char*)fQueryString(nullptr, LOCAL_EGL_EXTENSIONS);
-#endif
if (!rawExtString) {
if (shouldDumpExts) {
diff --git a/gfx/gl/GLLibraryEGL.h b/gfx/gl/GLLibraryEGL.h
index 88fce067e..e48f2e21b 100644
--- a/gfx/gl/GLLibraryEGL.h
+++ b/gfx/gl/GLLibraryEGL.h
@@ -33,17 +33,6 @@
typedef void* EGLNativePixmapType;
typedef void* EGLNativeWindowType;
- #ifdef ANDROID
- // We only need to explicitly dlopen egltrace
- // on android as we can use LD_PRELOAD or other tricks
- // on other platforms. We look for it in /data/local
- // as that's writeable by all users
- //
- // This should really go in GLLibraryEGL.cpp but we currently reference
- // APITRACE_LIB in GLContextProviderEGL.cpp. Further refactoring
- // will come in subsequent patches on Bug 732865
- #define APITRACE_LIB "/data/local/tmp/egltrace.so"
- #endif
#endif
#if defined(MOZ_X11)
@@ -79,28 +68,15 @@ namespace gl {
# endif
#endif
-#ifdef MOZ_WIDGET_ANDROID
-// Record the name of the GL call for better hang stacks on Android.
-#define BEFORE_GL_CALL \
- PROFILER_LABEL_FUNC( \
- js::ProfileEntry::Category::GRAPHICS);\
- BeforeGLCall(MOZ_FUNCTION_NAME)
-#else
#define BEFORE_GL_CALL do { \
BeforeGLCall(MOZ_FUNCTION_NAME); \
} while (0)
-#endif
#define AFTER_GL_CALL do { \
AfterGLCall(MOZ_FUNCTION_NAME); \
} while (0)
-#else
-#ifdef MOZ_WIDGET_ANDROID
-// Record the name of the GL call for better hang stacks on Android.
-#define BEFORE_GL_CALL PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS)
-#else
+#else // !DEBUG
#define BEFORE_GL_CALL
-#endif
#define AFTER_GL_CALL
#endif
diff --git a/gfx/gl/GLReadTexImageHelper.cpp b/gfx/gl/GLReadTexImageHelper.cpp
index 659378228..8009de74b 100644
--- a/gfx/gl/GLReadTexImageHelper.cpp
+++ b/gfx/gl/GLReadTexImageHelper.cpp
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GLReadTexImageHelper.h b/gfx/gl/GLReadTexImageHelper.h
index 20d229e53..2de33c2eb 100644
--- a/gfx/gl/GLReadTexImageHelper.h
+++ b/gfx/gl/GLReadTexImageHelper.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GfxTexturesReporter.cpp b/gfx/gl/GfxTexturesReporter.cpp
index d2ca70d27..82cc85ad4 100644
--- a/gfx/gl/GfxTexturesReporter.cpp
+++ b/gfx/gl/GfxTexturesReporter.cpp
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/GfxTexturesReporter.h b/gfx/gl/GfxTexturesReporter.h
index ed4603f0a..d2ce145d6 100644
--- a/gfx/gl/GfxTexturesReporter.h
+++ b/gfx/gl/GfxTexturesReporter.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/HeapCopyOfStackArray.h b/gfx/gl/HeapCopyOfStackArray.h
index 2fae79245..362c98451 100644
--- a/gfx/gl/HeapCopyOfStackArray.h
+++ b/gfx/gl/HeapCopyOfStackArray.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/TextureGarbageBin.cpp b/gfx/gl/TextureGarbageBin.cpp
index 89a9c8355..577b5df89 100644
--- a/gfx/gl/TextureGarbageBin.cpp
+++ b/gfx/gl/TextureGarbageBin.cpp
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/TextureGarbageBin.h b/gfx/gl/TextureGarbageBin.h
index 9218c4f26..3cd89f2a7 100644
--- a/gfx/gl/TextureGarbageBin.h
+++ b/gfx/gl/TextureGarbageBin.h
@@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build
index bfa8f9df5..c490400cb 100644
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -1,5 +1,4 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
@@ -17,14 +16,11 @@ elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
gl_provider = 'EGL'
else:
gl_provider = 'GLX'
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- gl_provider = 'EGL'
if CONFIG['MOZ_GL_PROVIDER']:
gl_provider = CONFIG['MOZ_GL_PROVIDER']
EXPORTS += [
- 'AndroidSurfaceTexture.h',
'DecomposeIntoNoRepeatTriangles.h',
'EGLUtils.h',
'ForceDiscreteGPUHelperCGL.h',
@@ -119,7 +115,6 @@ elif gl_provider == 'GLX':
]
SOURCES += [
- 'AndroidSurfaceTexture.cpp',
'DecomposeIntoNoRepeatTriangles.cpp',
'EGLUtils.cpp',
'GfxTexturesReporter.cpp',