Bug 1231564 - Don't trigger new composites just to repaint debug overlays. r=BenWa

This commit is contained in:
Matt Woodrow 2016-01-11 15:12:05 +13:00
Родитель e767cc440a
Коммит 0728cd334f
2 изменённых файлов: 5 добавлений и 10 удалений

Просмотреть файл

@ -430,7 +430,7 @@ LayerManagerComposite::UpdateAndRender()
// We don't want our debug overlay to cause more frames to happen
// so we will invalidate after we've decided if something changed.
InvalidateDebugOverlay(mRenderBounds);
InvalidateDebugOverlay(invalid, mRenderBounds);
if (!didEffectiveTransforms) {
// The results of our drawing always go directly into a pixel buffer,
@ -521,23 +521,18 @@ LayerManagerComposite::RootLayer() const
#endif
void
LayerManagerComposite::InvalidateDebugOverlay(const IntRect& aBounds)
LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion, const IntRect& aBounds)
{
bool drawFps = gfxPrefs::LayersDrawFPS();
bool drawFrameCounter = gfxPrefs::DrawFrameCounter();
bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars();
if (drawFps || drawFrameCounter) {
AddInvalidRegion(nsIntRect(0, 0, 256, 256));
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 256, 256));
}
if (drawFrameColorBars) {
AddInvalidRegion(nsIntRect(0, 0, 10, aBounds.height));
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 10, aBounds.height));
}
if (drawFrameColorBars) {
AddInvalidRegion(nsIntRect(0, 0, 10, aBounds.height));
}
}
static uint16_t sFrameCount = 0;

Просмотреть файл

@ -328,7 +328,7 @@ private:
/**
* We need to know our invalid region before we're ready to render.
*/
void InvalidateDebugOverlay(const gfx::IntRect& aBounds);
void InvalidateDebugOverlay(nsIntRegion& aInvalidRegion, const gfx::IntRect& aBounds);
/**
* Render debug overlays such as the FPS/FrameCounter above the frame.