b=811115 - remove MOZ_EGL_XRENDER_COMPOSITE dead code. r=jgilbert

This commit is contained in:
Nicolas Silva 2012-11-18 16:47:57 +01:00
parent 50c3ff83d2
commit 499651a424
7 changed files with 0 additions and 274 deletions

View File

@ -6689,20 +6689,6 @@ if test $MOZ_PLATFORM_MAEMO; then
AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
fi
dnl ========================================================
dnl = XRender Composite
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(egl-xrender-composite,
[ --enable-egl-xrender-composite
Enable EGL xrender composite optimizations],
MOZ_EGL_XRENDER_COMPOSITE=1)
if test -n "$MOZ_EGL_XRENDER_COMPOSITE"; then
AC_DEFINE(MOZ_EGL_XRENDER_COMPOSITE)
fi
AC_SUBST(MOZ_EGL_XRENDER_COMPOSITE)
dnl ========================================================
dnl GL provider
dnl ========================================================

View File

@ -422,11 +422,9 @@ _cairo_xlib_device_create (Display *dpy)
if (VendorRelease (dpy) < 10400000)
display->buggy_repeat = TRUE;
#ifndef MOZ_EGL_XRENDER_COMPOSITE
/* Too many bugs in the early drivers */
if (VendorRelease (dpy) < 10699000)
display->buggy_pad_reflect = TRUE;
#endif
}
} else if (strstr (ServerVendor (dpy), "XFree86") != NULL) {
if (VendorRelease (dpy) <= 40500000)

View File

@ -1399,15 +1399,6 @@ public:
AfterGLDrawCall();
}
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
virtual gfxASurface* GetOffscreenPixmapSurface()
{
return 0;
};
virtual bool WaitNative() { return false; }
#endif
virtual bool TextureImageSupportsGetBackingSurface() {
return false;
}

View File

@ -49,15 +49,6 @@ namespace gl {
#endif
#endif
// X11, with XRender optimizations and no GL layer support
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE) && !defined(GL_CONTEXT_PROVIDER_DEFAULT)
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
#include "GLContextProviderImpl.h"
#undef GL_CONTEXT_PROVIDER_NAME
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
#endif
// X11, but only if we didn't use EGL above
#if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT)
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
#include "GLContextProviderImpl.h"

View File

@ -155,11 +155,6 @@ static bool
CreateConfig(EGLConfig* aConfig);
#ifdef MOZ_X11
#ifdef MOZ_EGL_XRENDER_COMPOSITE
static EGLSurface
CreateBasicEGLSurfaceForXSurface(gfxASurface* aSurface, EGLConfig* aConfig);
#endif
static EGLConfig
CreateEGLSurfaceForXSurface(gfxASurface* aSurface, EGLConfig* aConfig = nullptr);
#endif
@ -376,17 +371,6 @@ public:
return sEGLLibrary.IsANGLE();
}
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
gfxASurface* GetOffscreenPixmapSurface()
{
return mThebesSurface;
}
virtual bool WaitNative() {
return sEGLLibrary.fWaitNative(LOCAL_EGL_CORE_NATIVE_ENGINE);
}
#endif
bool BindTexImage()
{
if (!mSurface)
@ -624,14 +608,6 @@ public:
const ContextFormat& aFormat,
bool aShare);
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
static already_AddRefed<GLContextEGL>
CreateBasicEGLPixmapOffscreenContext(const gfxIntSize& aSize,
const ContextFormat& aFormat);
bool ResizeOffscreenPixmapSurface(const gfxIntSize& aNewSize);
#endif
static already_AddRefed<GLContextEGL>
CreateEGLPBufferOffscreenContext(const gfxIntSize& aSize,
const ContextFormat& aFormat,
@ -1179,13 +1155,6 @@ GLContextEGL::ResizeOffscreen(const gfxIntSize& aNewSize)
return true;
}
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
if (ResizeOffscreenPixmapSurface(aNewSize)) {
if (ResizeOffscreenFBOs(aNewSize, true))
return true;
}
#endif
return ResizeOffscreenFBOs(aNewSize, true);
}
@ -2610,17 +2579,6 @@ GLContextProviderEGL::CreateOffscreen(const gfxIntSize& aSize,
if (!(aFlags & GLContext::ContextFlagsGlobal) && !glContext->ResizeOffscreenFBOs(fboSize, !usePBuffers))
return nullptr;
return glContext.forget();
#elif defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
nsRefPtr<GLContextEGL> glContext =
GLContextEGL::CreateBasicEGLPixmapOffscreenContext(aSize, aFormat);
if (!glContext)
return nullptr;
if (!(aFlags & GLContext::ContextFlagsGlobal) && !glContext->ResizeOffscreenFBOs(glContext->OffscreenActualSize(), true))
return nullptr;
return glContext.forget();
#elif defined(MOZ_X11)
nsRefPtr<GLContextEGL> glContext =
@ -2680,177 +2638,6 @@ GLContextProviderEGL::Shutdown()
gGlobalContext = nullptr;
}
//------------------------------------------------------------------------------
// The following methods exist to support an accelerated WebGL XRender composite
// path for BasicLayers. This is a potentially temporary change that can be
// removed when performance of GL layers is superior on mobile linux platforms.
//------------------------------------------------------------------------------
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
EGLSurface
CreateBasicEGLSurfaceForXSurface(gfxASurface* aSurface, EGLConfig* aConfig)
{
gfxXlibSurface* xsurface = static_cast<gfxXlibSurface*>(aSurface);
bool opaque =
aSurface->GetContentType() == gfxASurface::CONTENT_COLOR;
EGLSurface surface = nullptr;
if (aConfig && *aConfig) {
surface = sEGLLibrary.fCreatePixmapSurface(EGL_DISPLAY(), *aConfig,
xsurface->XDrawable(),
0);
if (surface != EGL_NO_SURFACE)
return surface;
}
EGLConfig configs[32];
int numConfigs = 32;
static EGLint pixmap_config[] = {
LOCAL_EGL_SURFACE_TYPE, LOCAL_EGL_PIXMAP_BIT,
LOCAL_EGL_RENDERABLE_TYPE, LOCAL_EGL_OPENGL_ES2_BIT,
0x30E2, 0x30E3,
LOCAL_EGL_DEPTH_SIZE, 16,
LOCAL_EGL_NONE
};
if (!sEGLLibrary.fChooseConfig(EGL_DISPLAY(),
pixmap_config,
configs, numConfigs, &numConfigs))
return nullptr;
if (numConfigs == 0)
return nullptr;
int i = 0;
for (i = 0; i < numConfigs; ++i) {
surface = sEGLLibrary.fCreatePixmapSurface(EGL_DISPLAY(), configs[i],
xsurface->XDrawable(),
0);
if (surface != EGL_NO_SURFACE)
break;
}
if (!surface) {
return nullptr;
}
if (aConfig)
{
*aConfig = configs[i];
}
return surface;
}
already_AddRefed<GLContextEGL>
GLContextEGL::CreateBasicEGLPixmapOffscreenContext(const gfxIntSize& aSize,
const ContextFormat& aFormat)
{
gfxASurface *thebesSurface = nullptr;
EGLNativePixmapType pixmap = 0;
XRenderPictFormat* format = gfxXlibSurface::FindRenderFormat(DefaultXDisplay(), gfxASurface::ImageFormatARGB32);
nsRefPtr<gfxXlibSurface> xsurface =
gfxXlibSurface::Create(DefaultScreenOfDisplay(DefaultXDisplay()), format, aSize);
// XSync required after gfxXlibSurface::Create, otherwise EGL will fail with BadDrawable error
XSync(DefaultXDisplay(), False);
if (xsurface->CairoStatus() != 0)
{
return nullptr;
}
thebesSurface = xsurface;
pixmap = xsurface->XDrawable();
if (!pixmap) {
return nullptr;
}
EGLSurface surface = 0;
EGLConfig config = 0;
surface = CreateBasicEGLSurfaceForXSurface(xsurface, &config);
if (!config) {
return nullptr;
}
EGLContext context = sEGLLibrary.fCreateContext(EGL_DISPLAY(),
config,
EGL_NO_CONTEXT,
sEGLLibrary.HasRobustness() ? gContextAttribsRobustness
: gContextAttribs);
if (!context) {
sEGLLibrary.fDestroySurface(EGL_DISPLAY(), surface);
return nullptr;
}
nsRefPtr<GLContextEGL> glContext = new GLContextEGL(aFormat, nullptr,
config, surface, context,
true);
if (!glContext->Init())
{
return nullptr;
}
glContext->HoldSurface(thebesSurface);
return glContext.forget();
}
bool GLContextEGL::ResizeOffscreenPixmapSurface(const gfxIntSize& aNewSize)
{
gfxASurface *thebesSurface = nullptr;
EGLNativePixmapType pixmap = 0;
XRenderPictFormat* format = gfxXlibSurface::FindRenderFormat(DefaultXDisplay(), gfxASurface::ImageFormatARGB32);
nsRefPtr<gfxXlibSurface> xsurface =
gfxXlibSurface::Create(DefaultScreenOfDisplay(DefaultXDisplay()),
format,
aNewSize);
// XSync required after gfxXlibSurface::Create, otherwise EGL will fail with BadDrawable error
XSync(DefaultXDisplay(), False);
if (xsurface->CairoStatus() != 0)
return nullptr;
thebesSurface = xsurface;
pixmap = xsurface->XDrawable();
if (!pixmap) {
return nullptr;
}
EGLSurface surface = 0;
EGLConfig config = 0;
surface = CreateBasicEGLSurfaceForXSurface(xsurface, &config);
if (!surface) {
NS_WARNING("Failed to resize pbuffer");
return nullptr;
}
sEGLLibrary.fDestroySurface(EGL_DISPLAY(), mSurface);
mSurface = surface;
HoldSurface(thebesSurface);
SetOffscreenSize(aNewSize, aNewSize);
MakeCurrent(true);
return true;
}
#endif
} /* namespace gl */
} /* namespace mozilla */

View File

@ -186,11 +186,7 @@ GLLibraryEGL::EnsureInitialized()
return false;
}
#if defined(MOZ_X11) && defined(MOZ_EGL_XRENDER_COMPOSITE)
mEGLDisplay = fGetDisplay((EGLNativeDisplayType) gdk_x11_get_default_xdisplay());
#else
mEGLDisplay = fGetDisplay(EGL_DEFAULT_DISPLAY);
#endif
if (!fInitialize(mEGLDisplay, NULL, NULL))
return false;

View File

@ -154,21 +154,6 @@ BasicCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
// We need to read from the GLContext
mGLContext->MakeCurrent();
#if defined (MOZ_X11) && defined (MOZ_EGL_XRENDER_COMPOSITE)
if (!mForceReadback) {
mGLContext->GuaranteeResolve();
gfxASurface* offscreenSurface = mGLContext->GetOffscreenPixmapSurface();
// XRender can only blend premuliplied alpha, so only allow xrender
// path if we have premultiplied alpha or opaque content.
if (offscreenSurface && (mGLBufferIsPremultiplied || (GetContentFlags() & CONTENT_OPAQUE))) {
mSurface = offscreenSurface;
mNeedsYFlip = false;
return;
}
}
#endif
gfxIntSize readSize(mBounds.width, mBounds.height);
gfxImageFormat format = (GetContentFlags() & CONTENT_OPAQUE)
? gfxASurface::ImageFormatRGB24
@ -285,14 +270,6 @@ BasicCanvasLayer::PaintWithOpacity(gfxContext* aContext,
FillWithMask(aContext, aOpacity, aMaskLayer);
#if defined (MOZ_X11) && defined (MOZ_EGL_XRENDER_COMPOSITE)
if (mGLContext && !mForceReadback) {
// Wait for X to complete all operations before continuing
// Otherwise gl context could get cleared before X is done.
mGLContext->WaitNative();
}
#endif
// Restore surface operator
if (GetContentFlags() & CONTENT_OPAQUE) {
aContext->SetOperator(savedOp);