зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1209022 - Fix AA handling in EGL's CreateOffscreen. - r=jrmuizel
This commit is contained in:
Родитель
62706101ab
Коммит
bc525759f2
|
@ -1039,15 +1039,15 @@ GLContextProviderEGL::CreateOffscreen(const mozilla::gfx::IntSize& size,
|
|||
}
|
||||
|
||||
RefPtr<GLContext> gl;
|
||||
SurfaceCaps offscreenCaps = minCaps;
|
||||
SurfaceCaps minOffscreenCaps = minCaps;
|
||||
|
||||
if (canOffscreenUseHeadless) {
|
||||
gl = CreateHeadless(flags);
|
||||
if (!gl)
|
||||
return nullptr;
|
||||
} else {
|
||||
SurfaceCaps minBackbufferCaps = minCaps;
|
||||
if (minCaps.antialias) {
|
||||
SurfaceCaps minBackbufferCaps = minOffscreenCaps;
|
||||
if (minOffscreenCaps.antialias) {
|
||||
minBackbufferCaps.antialias = false;
|
||||
minBackbufferCaps.depth = false;
|
||||
minBackbufferCaps.stencil = false;
|
||||
|
@ -1057,14 +1057,19 @@ GLContextProviderEGL::CreateOffscreen(const mozilla::gfx::IntSize& size,
|
|||
if (!gl)
|
||||
return nullptr;
|
||||
|
||||
offscreenCaps = gl->Caps();
|
||||
if (minCaps.antialias) {
|
||||
offscreenCaps.depth = minCaps.depth;
|
||||
offscreenCaps.stencil = minCaps.stencil;
|
||||
// Pull the actual resulting caps to ensure that our offscreen matches our
|
||||
// backbuffer.
|
||||
minOffscreenCaps.alpha = gl->Caps().alpha;
|
||||
if (!minOffscreenCaps.antialias) {
|
||||
// Only update these if we don't have AA. If we do have AA, we ignore
|
||||
// backbuffer depth/stencil.
|
||||
minOffscreenCaps.depth = gl->Caps().depth;
|
||||
minOffscreenCaps.stencil = gl->Caps().stencil;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gl->InitOffscreen(size, offscreenCaps))
|
||||
// Init the offscreen with the updated offscreen caps.
|
||||
if (!gl->InitOffscreen(size, minOffscreenCaps))
|
||||
return nullptr;
|
||||
|
||||
return gl.forget();
|
||||
|
|
Загрузка…
Ссылка в новой задаче