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

This commit is contained in:
Markus Stange 2014-10-16 12:35:58 +02:00
parent e35b08796b
commit bd3bc2c6e3

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,22 @@ FilterNodeTransformSoftware::Render(const IntRect& aRect)
return input.forget();
}
RefPtr<DataSourceSurface> surf =
Factory::CreateDataSourceSurface(aRect.Size(), input->GetFormat(), true);
if (!surf) {
return nullptr;
}
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 +1192,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