Backed out changeset 7134018d3724 (bug 1340627)

This commit is contained in:
Carsten "Tomcat" Book 2017-05-11 12:51:56 +02:00
Родитель ac258e9322
Коммит 52cc9e6849
2 изменённых файлов: 6 добавлений и 8 удалений

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

@ -67,7 +67,7 @@ PrintTargetSkPDF::BeginPrinting(const nsAString& aTitle,
nsresult
PrintTargetSkPDF::BeginPage()
{
mPageCanvas = mPDFDoc->beginPage(mSize.width, mSize.height);
mPageCanvas = sk_ref_sp(mPDFDoc->beginPage(mSize.width, mSize.height));
return !mPageCanvas ? NS_ERROR_FAILURE : PrintTarget::BeginPage();
}
@ -113,7 +113,7 @@ PrintTargetSkPDF::MakeDrawTarget(const IntSize& aSize,
if (!mPageCanvas) {
return nullptr;
}
mPageDT = Factory::CreateDrawTargetWithSkCanvas(mPageCanvas);
mPageDT = Factory::CreateDrawTargetWithSkCanvas(mPageCanvas.get());
if (!mPageDT) {
mPageCanvas = nullptr;
return nullptr;
@ -133,12 +133,12 @@ PrintTargetSkPDF::GetReferenceDrawTarget(DrawEventRecorder* aRecorder)
if (!mRefPDFDoc) {
return nullptr;
}
mRefCanvas = mRefPDFDoc->beginPage(mSize.width, mSize.height);
mRefCanvas = sk_ref_sp(mRefPDFDoc->beginPage(mSize.width, mSize.height));
if (!mRefCanvas) {
return nullptr;
}
RefPtr<DrawTarget> dt =
Factory::CreateDrawTargetWithSkCanvas(mRefCanvas);
Factory::CreateDrawTargetWithSkCanvas(mRefCanvas.get());
if (!dt) {
return nullptr;
}

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

@ -59,14 +59,12 @@ private:
UniquePtr<SkWStream> mOStream;
// The current page's SkCanvas and its wrapping DrawTarget:
// Canvas is owned by mPDFDoc, which handles its deletion.
SkCanvas* mPageCanvas;
sk_sp<SkCanvas> mPageCanvas;
RefPtr<DrawTarget> mPageDT;
// Members needed to provide a reference DrawTarget:
sk_sp<SkDocument> mRefPDFDoc;
// Canvas owned by mRefPDFDoc, which handles its deletion.
SkCanvas* mRefCanvas;
sk_sp<SkCanvas> mRefCanvas;
SkDynamicMemoryWStream mRefOStream;
};