From 866f97145d5513ad2b8549903b9e6cb38603b550 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Wed, 21 Jan 2015 18:00:31 +0100 Subject: [PATCH] Bug 1117925: Make sure to invalidate the entire window when the size changes. r=jrmuizel --- gfx/layers/d3d11/CompositorD3D11.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 63e1d3e6046..28b1bb8778e 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -1050,6 +1050,7 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion, return; } + nsIntSize oldSize = mSize; UpdateRenderTarget(); // Failed to create a render target or the view. @@ -1069,7 +1070,13 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion, nsIntRect intRect = nsIntRect(nsIntPoint(0, 0), mSize); // Sometimes the invalid region is larger than we want to draw. nsIntRegion invalidRegionSafe; - invalidRegionSafe.And(aInvalidRegion, intRect); + + if (mSize != oldSize) { + invalidRegionSafe = intRect; + } else { + invalidRegionSafe.And(aInvalidRegion, intRect); + } + nsIntRect invalidRect = invalidRegionSafe.GetBounds(); mInvalidRect = IntRect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height); mInvalidRegion = invalidRegionSafe;