Bug 1491442 - Make reftest readback read from the current render target. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Fri, 16 Aug 2019 01:09:03 +0000
changeset 488399 fb949ba38402edbe1decc678c5a8ee65f446a5a5
parent 488398 1cca4f1af964c1214bc04bd9d5b34fee4023ed87
child 488400 38705780d7f8cb91622359df841cf2549529c445
push id36443
push userccoroiu@mozilla.com
push dateFri, 16 Aug 2019 09:48:15 +0000
treeherdermozilla-central@5d4cbfe103bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1491442
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1491442 - Make reftest readback read from the current render target. r=mattwoodrow This removes the assumption that there is a default framebuffer to read from, in order to prepare for a world in which all rendering goes into non-default framebuffers. The current render target's framebuffer is already bound when this function is called. Differential Revision: https://phabricator.services.mozilla.com/D40513
gfx/layers/opengl/CompositorOGL.cpp
gfx/layers/opengl/CompositorOGL.h
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -1822,18 +1822,16 @@ void CompositorOGL::CopyToTarget(DrawTar
   GLint width = rect.Width();
   GLint height = rect.Height();
 
   if ((int64_t(width) * int64_t(height) * int64_t(4)) > INT32_MAX) {
     NS_ERROR("Widget size too big - integer overflow!");
     return;
   }
 
-  mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
-
   if (!mGLContext->IsGLES()) {
     // GLES2 promises that binding to any custom FBO will attach
     // to GL_COLOR_ATTACHMENT0 attachment point.
     mGLContext->fReadBuffer(LOCAL_GL_BACK);
   }
 
   RefPtr<DataSourceSurface> source = Factory::CreateDataSourceSurface(
       rect.Size(), gfx::SurfaceFormat::B8G8R8A8);
--- a/gfx/layers/opengl/CompositorOGL.h
+++ b/gfx/layers/opengl/CompositorOGL.h
@@ -429,18 +429,18 @@ class CompositorOGL final : public Compo
   /**
    * Bind the texture behind the current render target as the backdrop for a
    * mix-blend shader.
    */
   void BindBackdrop(ShaderProgramOGL* aProgram, GLuint aBackdrop,
                     GLenum aTexUnit);
 
   /**
-   * Copies the content of our backbuffer to the set transaction target.
-   * Does not restore the target FBO, so only call from EndFrame.
+   * Copies the content of the current render target to the set transaction
+   * target.
    */
   void CopyToTarget(gfx::DrawTarget* aTarget, const nsIntPoint& aTopLeft,
                     const gfx::Matrix& aWorldMatrix);
 
   /**
    * Implements the flipping of the y-axis to convert from layers/compositor
    * coordinates to OpenGL coordinates.
    *