Bug 1578100 - Respect the clip when calculating the number of pixels to fill. r=mattwoodrow

This makes the fill rate numbers which are displayed in the FPS overlay a lot more reasonable.
It also requires the TransformAndClipBounds fix from bug 1578045 for correct numbers.

Depends on D44337

Differential Revision: https://phabricator.services.mozilla.com/D44338

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-09-02 00:40:06 +00:00
parent d6940a6a56
commit 1ae94e638a

View File

@ -860,7 +860,6 @@ Maybe<gfx::IntRect> CompositorOGL::BeginRenderingToNativeLayer(
}
SetRenderTarget(rt);
mCurrentNativeLayer = aNativeLayer;
mPixelsPerFrame += rect.Area();
mGLContext->fClearColor(mClearColor.r, mClearColor.g, mClearColor.b,
mClearColor.a);
@ -881,8 +880,10 @@ Maybe<gfx::IntRect> CompositorOGL::BeginRenderingToNativeLayer(
clearRect.Width(), clearRect.Height());
mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
}
mPixelsPerFrame += rtClip->Area();
} else {
mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
mPixelsPerFrame += rect.Area();
}
return Some(rect);