Bug 1576499 - Clarify dest and buffer a little. r=mattwoodrow

The old code was making an autoRestoreTransform around dest and then quickly
overwriting dest with something new. I prefer creating the autoRestoreTransform
for buffer, which doesn't change over the course of this function.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-08-28 21:50:27 +00:00
Родитель 044cc84a21
Коммит 15208cabec
1 изменённых файлов: 6 добавлений и 6 удалений

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

@ -619,19 +619,19 @@ void BasicCompositor::DrawGeometry(
gfx::Float aOpacity, const gfx::Matrix4x4& aTransform,
const gfx::Rect& aVisibleRect, const bool aEnableAA) {
RefPtr<DrawTarget> buffer = mRenderTarget->mDrawTarget;
// For 2D drawing, |dest| and |buffer| are the same surface. For 3D drawing,
// |dest| is a temporary surface.
RefPtr<DrawTarget> dest = buffer;
AutoRestoreTransform autoRestoreTransform(dest);
AutoRestoreTransform autoRestoreTransform(buffer);
Matrix newTransform;
Rect transformBounds;
Matrix4x4 new3DTransform;
IntPoint offset = mRenderTarget->GetOrigin();
// For 2D drawing, |dest| and |buffer| are the same surface. For 3D drawing,
// |dest| is a temporary surface.
RefPtr<DrawTarget> dest;
if (aTransform.Is2D()) {
dest = buffer;
newTransform = aTransform.As2D();
} else {
// Create a temporary surface for the transform.