Bug 1573343 - Apply the translation in CreateRenderTargetForWindow instead of in BeginFrame. r=mattwoodrow

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-08-19 22:39:12 +00:00
Родитель 19c25b1d89
Коммит a829cf1409
1 изменённых файлов: 5 добавлений и 7 удалений

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

@ -322,8 +322,11 @@ BasicCompositor::CreateRenderTargetForWindow(
} }
rt = new BasicCompositingRenderTarget(mDrawTarget, windowRect); rt = new BasicCompositingRenderTarget(mDrawTarget, windowRect);
} }
rt->mDrawTarget->SetTransform(Matrix::Translation(-rt->GetOrigin()));
if (!aClearRect.IsEmpty() && !isCleared) { if (!aClearRect.IsEmpty() && !isCleared) {
gfx::IntRect clearRect = aClearRect.ToUnknownRect() - rt->GetOrigin(); gfx::IntRect clearRect = aClearRect.ToUnknownRect();
rt->mDrawTarget->ClearRect(gfx::Rect(clearRect)); rt->mDrawTarget->ClearRect(gfx::Rect(clearRect));
} }
@ -973,11 +976,6 @@ void BasicCompositor::BeginFrame(
} }
SetRenderTarget(target); SetRenderTarget(target);
// We only allocate a surface sized to the invalidated region, so we need to
// translate future coordinates.
mRenderTarget->mDrawTarget->SetTransform(
Matrix::Translation(-mRenderTarget->GetOrigin()));
if (ShouldRecordFrames()) { if (ShouldRecordFrames()) {
IntSize windowSize = rect.ToUnknownRect().Size(); IntSize windowSize = rect.ToUnknownRect().Size();
@ -1034,7 +1032,7 @@ void BasicCompositor::EndFrame() {
// Pop aInvalidregion // Pop aInvalidregion
mRenderTarget->mDrawTarget->PopClip(); mRenderTarget->mDrawTarget->PopClip();
// Reset the translation that was applied in BeginFrame. // Reset the translation that was applied in CreateRenderTargetForWindow.
mRenderTarget->mDrawTarget->SetTransform(gfx::Matrix()); mRenderTarget->mDrawTarget->SetTransform(gfx::Matrix());
TryToEndRemoteDrawing(); TryToEndRemoteDrawing();