mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
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:
parent
d057c6f505
commit
2bb7fc2c35
@ -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(
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user