зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1753349 (2/9): refactor: inline `size` argument to `GLContextEGL::CreateEGLPBufferOffscreenContext` r=jgilbert
This is basically an implementation detail that the existing callers doesn't really need to know. Factor it out. Split out from @jgilbert's D164308. Differential Revision: https://phabricator.services.mozilla.com/D166707
This commit is contained in:
Родитель
2d888dbae4
Коммит
5ae49e0bf7
|
@ -102,7 +102,7 @@ class GLContextEGL final : public GLContext {
|
||||||
|
|
||||||
static RefPtr<GLContextEGL> CreateEGLPBufferOffscreenContext(
|
static RefPtr<GLContextEGL> CreateEGLPBufferOffscreenContext(
|
||||||
std::shared_ptr<EglDisplay>, const GLContextCreateDesc&,
|
std::shared_ptr<EglDisplay>, const GLContextCreateDesc&,
|
||||||
const gfx::IntSize& size, nsACString* const out_FailureId);
|
nsACString* const out_FailureId);
|
||||||
static RefPtr<GLContextEGL> CreateEGLSurfacelessContext(
|
static RefPtr<GLContextEGL> CreateEGLSurfacelessContext(
|
||||||
const std::shared_ptr<EglDisplay> display,
|
const std::shared_ptr<EglDisplay> display,
|
||||||
const GLContextCreateDesc& desc, nsACString* const out_failureId);
|
const GLContextCreateDesc& desc, nsACString* const out_failureId);
|
||||||
|
|
|
@ -1127,7 +1127,7 @@ bool GLContextEGL::FindVisual(int* const out_visualId) {
|
||||||
/*static*/
|
/*static*/
|
||||||
RefPtr<GLContextEGL> GLContextEGL::CreateEGLPBufferOffscreenContext(
|
RefPtr<GLContextEGL> GLContextEGL::CreateEGLPBufferOffscreenContext(
|
||||||
const std::shared_ptr<EglDisplay> egl, const GLContextCreateDesc& desc,
|
const std::shared_ptr<EglDisplay> egl, const GLContextCreateDesc& desc,
|
||||||
const mozilla::gfx::IntSize& size, nsACString* const out_failureId) {
|
nsACString* const out_failureId) {
|
||||||
const auto WithUseGles = [&](const bool useGles) -> RefPtr<GLContextEGL> {
|
const auto WithUseGles = [&](const bool useGles) -> RefPtr<GLContextEGL> {
|
||||||
const EGLConfig config = ChooseConfig(*egl, desc, useGles);
|
const EGLConfig config = ChooseConfig(*egl, desc, useGles);
|
||||||
if (config == EGL_NO_CONFIG) {
|
if (config == EGL_NO_CONFIG) {
|
||||||
|
@ -1140,16 +1140,17 @@ RefPtr<GLContextEGL> GLContextEGL::CreateEGLPBufferOffscreenContext(
|
||||||
egl->DumpEGLConfig(config);
|
egl->DumpEGLConfig(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::gfx::IntSize pbSize(size);
|
auto dummySize = mozilla::gfx::IntSize{16, 16};
|
||||||
EGLSurface surface = nullptr;
|
EGLSurface surface = nullptr;
|
||||||
#ifdef MOZ_WAYLAND
|
#ifdef MOZ_WAYLAND
|
||||||
if (GdkIsWaylandDisplay()) {
|
if (GdkIsWaylandDisplay()) {
|
||||||
surface = GLContextEGL::CreateWaylandBufferSurface(*egl, config, pbSize);
|
surface =
|
||||||
|
GLContextEGL::CreateWaylandBufferSurface(*egl, config, dummySize);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
surface = GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(
|
surface = GLContextEGL::CreatePBufferSurfaceTryingPowerOfTwo(
|
||||||
*egl, config, LOCAL_EGL_NONE, pbSize);
|
*egl, config, LOCAL_EGL_NONE, dummySize);
|
||||||
}
|
}
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
*out_failureId = "FEATURE_FAILURE_EGL_POT"_ns;
|
*out_failureId = "FEATURE_FAILURE_EGL_POT"_ns;
|
||||||
|
@ -1195,9 +1196,8 @@ already_AddRefed<GLContext> GLContextProviderEGL::CreateHeadless(
|
||||||
if (!display) {
|
if (!display) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16);
|
auto ret = GLContextEGL::CreateEGLPBufferOffscreenContext(display, desc,
|
||||||
auto ret = GLContextEGL::CreateEGLPBufferOffscreenContext(
|
out_failureId);
|
||||||
display, desc, dummySize, out_failureId);
|
|
||||||
return ret.forget();
|
return ret.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1267,9 +1267,8 @@ static already_AddRefed<gl::GLContext> CreateGLContextANGLE(
|
||||||
// Create GLContext with dummy EGLSurface, the EGLSurface is not used.
|
// Create GLContext with dummy EGLSurface, the EGLSurface is not used.
|
||||||
// Instread we override it with EGLSurface of SwapChain's back buffer.
|
// Instread we override it with EGLSurface of SwapChain's back buffer.
|
||||||
|
|
||||||
const auto dummySize = mozilla::gfx::IntSize(16, 16);
|
auto gl = gl::GLContextEGL::CreateEGLPBufferOffscreenContext(egl, {flags},
|
||||||
auto gl = gl::GLContextEGL::CreateEGLPBufferOffscreenContext(
|
&failureId);
|
||||||
egl, {flags}, dummySize, &failureId);
|
|
||||||
if (!gl || !gl->IsANGLE()) {
|
if (!gl || !gl->IsANGLE()) {
|
||||||
aError.Assign(nsPrintfCString("RcANGLE(create GL context failed: %p, %s)",
|
aError.Assign(nsPrintfCString("RcANGLE(create GL context failed: %p, %s)",
|
||||||
gl.get(), failureId.get()));
|
gl.get(), failureId.get()));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче