Bug 1301459 - In nsSVGMaskFrame::GetMaskForMaskedFrame, create surface by Factory::CreateDataSourceSurface. r=mstange

---
 layout/svg/nsSVGMaskFrame.cpp | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
This commit is contained in:
vincentliu 2016-10-04 09:33:43 +08:00
Родитель eed49d301a
Коммит 4addf0c4b3
1 изменённых файлов: 3 добавлений и 9 удалений

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

@ -283,17 +283,11 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext,
}
// Create alpha channel mask for output
RefPtr<DrawTarget> destMaskDT =
Factory::CreateDrawTarget(BackendType::CAIRO, maskSurfaceSize,
SurfaceFormat::A8);
if (!destMaskDT) {
RefPtr<DataSourceSurface> destMaskSurface =
Factory::CreateDataSourceSurface(maskSurfaceSize, SurfaceFormat::A8);
if (!destMaskSurface) {
return nullptr;
}
RefPtr<SourceSurface> destMaskSnapshot = destMaskDT->Snapshot();
if (!destMaskSnapshot) {
return nullptr;
}
RefPtr<DataSourceSurface> destMaskSurface = destMaskSnapshot->GetDataSurface();
DataSourceSurface::MappedSurface destMap;
if (!destMaskSurface->Map(DataSourceSurface::MapType::WRITE, &destMap)) {
return nullptr;