Bug 1340627 - part 4 - fix thebes for Skia m59. r=mchang

MozReview-Commit-ID: JDlSyKeT389
This commit is contained in:
Lee Salzman 2017-05-09 22:31:07 -04:00
Родитель 836ee7f95b
Коммит 8c776dd5bc
2 изменённых файлов: 8 добавлений и 6 удалений

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

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

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

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