Bug 1491442 - Don't handle null render targets in this method. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Fri, 16 Aug 2019 01:15:59 +0000
changeset 488416 ae86a277bd72b7a3c9b5e2ae40fcb74c33b796da
parent 488415 706ff8a1badcd0c796e151b9e015bbfed0b20ddf
child 488417 0822612163d60c8c8deb17f0ab5c59de79b05a66
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 - Don't handle null render targets in this method. r=mattwoodrow There's only one caller and it always passes a non-null render target. Differential Revision: https://phabricator.services.mozilla.com/D40550
gfx/layers/opengl/CompositorOGL.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -635,35 +635,32 @@ already_AddRefed<CompositingRenderTarget
 }
 
 already_AddRefed<CompositingRenderTarget>
 CompositorOGL::CreateRenderTargetFromSource(
     const IntRect& aRect, const CompositingRenderTarget* aSource,
     const IntPoint& aSourcePoint) {
   MOZ_ASSERT(!aRect.IsZeroArea(),
              "Trying to create a render target of invalid size");
+  MOZ_RELEASE_ASSERT(aSource, "Source needs to be non-null");
 
   if (aRect.IsZeroArea()) {
     return nullptr;
   }
 
   if (!gl()) {
     return nullptr;
   }
 
   GLuint tex = 0;
   GLuint fbo = 0;
   const CompositingRenderTargetOGL* sourceSurface =
       static_cast<const CompositingRenderTargetOGL*>(aSource);
   IntRect sourceRect(aSourcePoint, aRect.Size());
-  if (aSource) {
-    CreateFBOWithTexture(sourceRect, true, sourceSurface->GetFBO(), &fbo, &tex);
-  } else {
-    CreateFBOWithTexture(sourceRect, true, 0, &fbo, &tex);
-  }
+  CreateFBOWithTexture(sourceRect, true, sourceSurface->GetFBO(), &fbo, &tex);
 
   RefPtr<CompositingRenderTargetOGL> surface =
       new CompositingRenderTargetOGL(this, aRect.TopLeft(), tex, fbo);
   surface->Initialize(aRect.Size(), sourceRect.Size(), mFBOTextureTarget,
                       INIT_MODE_NONE);
   return surface.forget();
 }