Bug 1347646 Part 1: Backout 4849ef8c9a34 for causing OOM issues when printing PDFs. r=jwatt, r=lsalzman, r=tobytailor

This commit is contained in:
Bob Owen
2017-04-08 22:47:51 +01:00
parent 3d56b33ce2
commit 38ef1e1caa
9 changed files with 29 additions and 331 deletions

View File

@@ -12,8 +12,6 @@
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/ISurfaceAllocator.h"
#include "AutoMaskData.h"
#include "mozilla/gfx/InlineTranslator.h"
#include "mozilla/gfx/DrawTargetRecording.h"
namespace mozilla {
namespace layers {
@@ -124,9 +122,6 @@ FillRectWithMask(DrawTarget* aDT,
const Matrix* aMaskTransform,
const Matrix* aSurfaceTransform)
{
MOZ_ASSERT(!aMaskSource || (aMaskSource && aMaskTransform),
"aMaskSource must not be passed without a transform");
if (aMaskSource && aMaskTransform) {
aDT->PushClipRect(aRect);
Matrix oldTransform = aDT->GetTransform();
@@ -149,29 +144,6 @@ FillRectWithMask(DrawTarget* aDT,
return;
}
if (aSurface->GetType() == SurfaceType::RECORDING) {
MOZ_ASSERT(aOptions.mAlpha == 1.0 &&
aOptions.mCompositionOp == CompositionOp::OP_OVER);
aDT->PushClipRect(aRect);
Matrix oldTransform = aDT->GetTransform();
Matrix transform = oldTransform;
if (aSurfaceTransform) {
transform = (*aSurfaceTransform) * transform;
}
InlineTranslator* translator = new InlineTranslator(aDT, transform);
SourceSurfaceRecording* ss = static_cast<SourceSurfaceRecording*>(aSurface);
DrawEventRecorderMemory* mr = static_cast<DrawEventRecorderMemory*>(ss->mRecorder.get());
translator->TranslateRecording(mr->GetInputStream());
aDT->SetTransform(oldTransform);
aDT->PopClip();
return;
}
aDT->FillRect(aRect,
SurfacePattern(aSurface, aExtendMode,
aSurfaceTransform ? (*aSurfaceTransform) : Matrix(),