From 3bc0066b704eefc1df8d8ec19cfe169a2b9cda95 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 31 Oct 2017 12:02:32 -0700 Subject: [PATCH] When similar draw targets are requested from capturing DTs, always return a new capturing DT instead of an actual surface. (bug 1395478 part 9, r=mchang) --HG-- extra : rebase_source : 9957e68435e69d65e3f4fa82bc870e37b21392dd --- gfx/2d/DrawTargetCapture.cpp | 6 ++++++ gfx/2d/DrawTargetCapture.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gfx/2d/DrawTargetCapture.cpp b/gfx/2d/DrawTargetCapture.cpp index 5f48174420b7..a172b0e9495f 100644 --- a/gfx/2d/DrawTargetCapture.cpp +++ b/gfx/2d/DrawTargetCapture.cpp @@ -399,5 +399,11 @@ DrawTargetCaptureImpl::MarkChanged() mSnapshot = nullptr; } +already_AddRefed +DrawTargetCaptureImpl::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const +{ + return MakeAndAddRef(GetBackendType(), aSize, aFormat); +} + } // namespace gfx } // namespace mozilla diff --git a/gfx/2d/DrawTargetCapture.h b/gfx/2d/DrawTargetCapture.h index 60cd6939a316..355031516acc 100644 --- a/gfx/2d/DrawTargetCapture.h +++ b/gfx/2d/DrawTargetCapture.h @@ -127,10 +127,7 @@ public: } virtual already_AddRefed - CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override - { - return mRefDT->CreateSimilarDrawTarget(aSize, aFormat); - } + CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override; virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override {