зеркало из https://github.com/mozilla/gecko-dev.git
Bug 788319, fixups to make EGL work with gtk. r=bjacob
This commit is contained in:
Родитель
5b5ef6fcc7
Коммит
05710d2e22
|
@ -44,19 +44,11 @@ namespace gl {
|
|||
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
|
||||
#include "GLContextProviderImpl.h"
|
||||
#undef GL_CONTEXT_PROVIDER_NAME
|
||||
|
||||
#ifndef GL_CONTEXT_PROVIDER_DEFAULT
|
||||
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT)
|
||||
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
|
||||
#include "GLContextProviderImpl.h"
|
||||
#undef GL_CONTEXT_PROVIDER_NAME
|
||||
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_GL_PROVIDER
|
||||
#define GL_CONTEXT_PROVIDER_NAME MOZ_GL_PROVIDER
|
||||
#include "GLContextProviderImpl.h"
|
||||
|
@ -64,6 +56,13 @@ namespace gl {
|
|||
#define GL_CONTEXT_PROVIDER_DEFAULT MOZ_GL_PROVIDER
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_X11) && !defined(GL_CONTEXT_PROVIDER_DEFAULT)
|
||||
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderGLX
|
||||
#include "GLContextProviderImpl.h"
|
||||
#undef GL_CONTEXT_PROVIDER_NAME
|
||||
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderGLX
|
||||
#endif
|
||||
|
||||
#ifdef GL_CONTEXT_PROVIDER_DEFAULT
|
||||
typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
|
||||
#else
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <OpenGL/OpenGL.h>
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_X11
|
||||
#ifdef GL_PROVIDER_GLX
|
||||
#include "gfxXlibSurface.h"
|
||||
#endif
|
||||
|
||||
|
@ -126,7 +126,7 @@ CanvasLayerOGL::Initialize(const Data& aData)
|
|||
} else if (aData.mSurface) {
|
||||
mCanvasSurface = aData.mSurface;
|
||||
mNeedsYFlip = false;
|
||||
#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
|
||||
#if defined(GL_PROVIDER_GLX)
|
||||
if (aData.mSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
|
||||
gfxXlibSurface *xsurf = static_cast<gfxXlibSurface*>(aData.mSurface);
|
||||
mPixmap = xsurf->GetGLXPixmap();
|
||||
|
@ -197,7 +197,7 @@ CanvasLayerOGL::UpdateSurface()
|
|||
return;
|
||||
}
|
||||
|
||||
#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
|
||||
#if defined(GL_PROVIDER_GLX)
|
||||
if (mPixmap) {
|
||||
return;
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination,
|
|||
program = mOGLManager->GetProgram(mLayerProgram, GetMaskLayer());
|
||||
}
|
||||
|
||||
#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
|
||||
#if defined(GL_PROVIDER_GLX)
|
||||
if (mPixmap && !mDelayedUpdates) {
|
||||
sDefGLXLib.BindTexImage(mPixmap);
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ CanvasLayerOGL::RenderLayer(int aPreviousDestination,
|
|||
mOGLManager->BindAndDrawQuadWithTextureRect(program, drawRect, drawRect.Size());
|
||||
}
|
||||
|
||||
#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
|
||||
#if defined(GL_PROVIDER_GLX)
|
||||
if (mPixmap && !mDelayedUpdates) {
|
||||
sDefGLXLib.ReleaseTexImage(mPixmap);
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ ImageLayerOGL::AllocateTexturesCairo(CairoImage *aImage)
|
|||
|
||||
SetClamping(gl, tex);
|
||||
|
||||
#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
|
||||
#if defined(GL_PROVIDER_GLX)
|
||||
if (aImage->mSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
|
||||
gfxXlibSurface *xsurf =
|
||||
static_cast<gfxXlibSurface*>(aImage->mSurface.get());
|
||||
|
|
|
@ -480,6 +480,24 @@ gfxPlatformGtk::GetOffscreenFormat()
|
|||
return gfxASurface::ImageFormatRGB24;
|
||||
}
|
||||
|
||||
static int sDepth = 0;
|
||||
|
||||
int
|
||||
gfxPlatformGtk::GetScreenDepth() const
|
||||
{
|
||||
if (!sDepth) {
|
||||
GdkScreen *screen = gdk_screen_get_default();
|
||||
if (screen) {
|
||||
sDepth = gdk_visual_get_depth(gdk_visual_get_system());
|
||||
} else {
|
||||
sDepth = 24;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return sDepth;
|
||||
}
|
||||
|
||||
qcms_profile *
|
||||
gfxPlatformGtk::GetPlatformCMSOutputProfile()
|
||||
{
|
||||
|
|
|
@ -123,6 +123,8 @@ public:
|
|||
|
||||
virtual gfxImageFormat GetOffscreenFormat();
|
||||
|
||||
virtual int GetScreenDepth() const;
|
||||
|
||||
protected:
|
||||
static gfxFontconfigUtils *sFontconfigUtils;
|
||||
|
||||
|
|
|
@ -864,7 +864,9 @@ nsBaseWidget::ComputeShouldAccelerate(bool aDefault)
|
|||
CompositorParent* nsBaseWidget::NewCompositorParent(int aSurfaceWidth,
|
||||
int aSurfaceHeight)
|
||||
{
|
||||
return new CompositorParent(this, false, aSurfaceWidth, aSurfaceHeight);
|
||||
// Even if we are using EGL, unless we are on Android, we don't want
|
||||
// CompositorParent to think we are, so we pass aRenderToEGLSurface = false.
|
||||
return new CompositorParent(this, false, aSurfaceWidth, aSurfaceHeight);
|
||||
}
|
||||
|
||||
void nsBaseWidget::CreateCompositor()
|
||||
|
|
Загрузка…
Ссылка в новой задаче