mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Don't cache DrawTargetCaptures in nsCanvasFrame. (bug 1395478 part 10, r=mattwoodrow)
--HG-- extra : rebase_source : fc0746099e910f1e46842f292f60b2f00ee25f38
This commit is contained in:
parent
3bc0066b70
commit
997c7019bc
12
gfx/2d/2D.h
12
gfx/2d/2D.h
@ -1273,6 +1273,18 @@ public:
|
||||
return CreateSimilarDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a similar draw target, but if the draw target is not backed by a
|
||||
* raster backend (for example, it is capturing or recording), force it to
|
||||
* create a raster target instead. This is intended for code that wants to
|
||||
* cache pixels, and would have no effect if it were caching a recording.
|
||||
*/
|
||||
virtual RefPtr<DrawTarget>
|
||||
CreateSimilarRasterTarget(const IntSize& aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
return CreateSimilarDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a path builder with the specified fillmode.
|
||||
*
|
||||
|
@ -405,5 +405,12 @@ DrawTargetCaptureImpl::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceForm
|
||||
return MakeAndAddRef<DrawTargetCaptureImpl>(GetBackendType(), aSize, aFormat);
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget>
|
||||
DrawTargetCaptureImpl::CreateSimilarRasterTarget(const IntSize& aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
MOZ_ASSERT(!mRefDT->IsCaptureDT());
|
||||
return mRefDT->CreateSimilarDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
||||
|
@ -128,6 +128,8 @@ public:
|
||||
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override;
|
||||
virtual RefPtr<DrawTarget>
|
||||
CreateSimilarRasterTarget(const IntSize& aSize, SurfaceFormat aFormat) const override;
|
||||
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override
|
||||
{
|
||||
|
@ -383,9 +383,9 @@ nsDisplayCanvasBackgroundImage::Paint(nsDisplayListBuilder* aBuilder,
|
||||
return;
|
||||
}
|
||||
|
||||
dt = destDT->CreateSimilarDrawTarget(IntSize::Ceil(destRect.width,
|
||||
destRect.height),
|
||||
SurfaceFormat::B8G8R8A8);
|
||||
dt = destDT->CreateSimilarRasterTarget(IntSize::Ceil(destRect.width,
|
||||
destRect.height),
|
||||
SurfaceFormat::B8G8R8A8);
|
||||
if (dt && dt->IsValid()) {
|
||||
RefPtr<gfxContext> ctx = gfxContext::CreateOrNull(dt);
|
||||
MOZ_ASSERT(ctx); // already checked draw target above
|
||||
|
Loading…
Reference in New Issue
Block a user