Bug 1407356. Use CreateSimiliarDrawTarget for Filters instead of CreateOffscreenTarget. r=mstange

This lets us record and playback filters on the webrender side.
This commit is contained in:
Jeff Muizelaar 2017-10-10 14:33:16 -04:00
parent d057c6f505
commit 2bb7fc2c35
2 changed files with 4 additions and 5 deletions

View File

@ -444,7 +444,7 @@ nsFilterInstance::BuildSourcePaints(imgDrawingParams& aImgParams)
}
void
nsFilterInstance::BuildSourceImage(imgDrawingParams& aImgParams)
nsFilterInstance::BuildSourceImage(DrawTarget *aDest, imgDrawingParams& aImgParams)
{
MOZ_ASSERT(mTargetFrame);
@ -454,8 +454,7 @@ nsFilterInstance::BuildSourceImage(imgDrawingParams& aImgParams)
}
RefPtr<DrawTarget> offscreenDT =
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
neededRect.Size(), SurfaceFormat::B8G8R8A8);
aDest->CreateSimilarDrawTarget(neededRect.Size(), SurfaceFormat::B8G8R8A8);
if (!offscreenDT || !offscreenDT->IsValid()) {
return;
}
@ -513,7 +512,7 @@ nsFilterInstance::Render(gfxContext* aCtx, imgDrawingParams& aImgParams)
ComputeNeededBoxes();
BuildSourceImage(aImgParams);
BuildSourceImage(aCtx->GetDrawTarget(), aImgParams);
BuildSourcePaints(aImgParams);
FilterSupport::RenderFilterDescription(

View File

@ -233,7 +233,7 @@ private:
* Creates the SourceSurface for the SourceGraphic graph node, paints its
* contents, and assigns it to mSourceGraphic.mSourceSurface.
*/
void BuildSourceImage(imgDrawingParams& aImgParams);
void BuildSourceImage(DrawTarget *aDest, imgDrawingParams& aImgParams);
/**
* Build the list of FilterPrimitiveDescriptions that describes the filter's