Bug 1076695 - Don't convert alpha surfaces into RGBA surfaces for FilterNodeTransformSoftware. r=Bas

This commit is contained in:
Markus Stange 2014-10-07 16:18:01 +02:00
parent 8306207e4e
commit 8a27e8adbc

View File

@ -1156,7 +1156,7 @@ FilterNodeTransformSoftware::Render(const IntRect& aRect)
IntRect srcRect = SourceRectForOutputRect(aRect);
RefPtr<DataSourceSurface> input =
GetInputDataSourceSurface(IN_TRANSFORM_IN, srcRect, NEED_COLOR_CHANNELS);
GetInputDataSourceSurface(IN_TRANSFORM_IN, srcRect);
if (!input) {
return nullptr;
@ -1168,8 +1168,18 @@ FilterNodeTransformSoftware::Render(const IntRect& aRect)
return input.forget();
}
RefPtr<DataSourceSurface> surf =
Factory::CreateDataSourceSurface(aRect.Size(), input->GetFormat());
DataSourceSurface::MappedSurface mapping;
surf->Map(DataSourceSurface::MapType::WRITE, &mapping);
RefPtr<DrawTarget> dt =
Factory::CreateDrawTarget(BackendType::CAIRO, aRect.Size(), input->GetFormat());
Factory::CreateDrawTargetForData(BackendType::CAIRO,
mapping.mData,
surf->GetSize(),
mapping.mStride,
surf->GetFormat());
if (!dt) {
return nullptr;
}
@ -1178,9 +1188,9 @@ FilterNodeTransformSoftware::Render(const IntRect& aRect)
dt->SetTransform(transform);
dt->DrawSurface(input, r, r, DrawSurfaceOptions(mFilter));
RefPtr<SourceSurface> result = dt->Snapshot();
RefPtr<DataSourceSurface> resultData = result->GetDataSurface();
return resultData.forget();
dt->Flush();
surf->Unmap();
return surf.forget();
}
void