Bug 1669740 - Cleanup some WrapAndRecord usage. r=aosmond

This is a follow up from bug 1668377. It changes
some function names, comments and removes the factory
method.

The WrapAndRecord target is still used by the global recording
stuff so I've kept it for now.

Differential Revision: https://phabricator.services.mozilla.com/D92777
This commit is contained in:
Jeff Muizelaar 2020-10-21 15:09:22 +00:00
parent 00210a843e
commit 7c1391669a
6 changed files with 8 additions and 16 deletions

View File

@ -1795,9 +1795,6 @@ class GFX2D_API Factory {
BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat,
int32_t aStride, size_t aSurfaceAllocationSize);
static already_AddRefed<DrawTarget> CreateWrapAndRecordDrawTarget(
DrawEventRecorder* aRecorder, DrawTarget* aDT);
static already_AddRefed<DrawTarget> CreateRecordingDrawTarget(
DrawEventRecorder* aRecorder, DrawTarget* aDT, IntRect aRect);

View File

@ -424,11 +424,6 @@ already_AddRefed<PathBuilder> Factory::CreateSimplePathBuilder() {
return pathBuilder.forget();
}
already_AddRefed<DrawTarget> Factory::CreateWrapAndRecordDrawTarget(
DrawEventRecorder* aRecorder, DrawTarget* aDT) {
return MakeAndAddRef<DrawTargetWrapAndRecord>(aRecorder, aDT);
}
already_AddRefed<DrawTarget> Factory::CreateRecordingDrawTarget(
DrawEventRecorder* aRecorder, DrawTarget* aDT, IntRect aRect) {
return MakeAndAddRef<DrawTargetRecording>(aRecorder, aDT, aRect);

View File

@ -85,7 +85,7 @@ already_AddRefed<DrawTarget> PrintTarget::MakeDrawTarget(
}
if (aRecorder) {
dt = CreateWrapAndRecordDrawTarget(aRecorder, dt);
dt = CreateRecordingDrawTarget(aRecorder, dt);
if (!dt || !dt->IsValid()) {
return nullptr;
}
@ -163,7 +163,7 @@ void PrintTarget::AdjustPrintJobNameForIPP(const nsAString& aJobName,
}
/* static */
already_AddRefed<DrawTarget> PrintTarget::CreateWrapAndRecordDrawTarget(
already_AddRefed<DrawTarget> PrintTarget::CreateRecordingDrawTarget(
DrawEventRecorder* aRecorder, DrawTarget* aDrawTarget) {
MOZ_ASSERT(aRecorder);
MOZ_ASSERT(aDrawTarget);

View File

@ -153,7 +153,7 @@ class PrintTarget {
// Protected because we're refcounted
virtual ~PrintTarget();
static already_AddRefed<DrawTarget> CreateWrapAndRecordDrawTarget(
static already_AddRefed<DrawTarget> CreateRecordingDrawTarget(
DrawEventRecorder* aRecorder, DrawTarget* aDrawTarget);
cairo_surface_t* mCairoSurface;

View File

@ -24,7 +24,7 @@ already_AddRefed<PrintTargetRecording> PrintTargetRecording::CreateOrNull(
}
// Perhaps surprisingly, this surface is never actually drawn to. This class
// creates a DrawTargetWrapAndRecord using CreateWrapAndRecordDrawTarget, and
// creates a DrawTargetRecording using CreateRecordingDrawTarget, and
// that needs another DrawTarget to be passed to it. You might expect the
// type of the DrawTarget that is passed to matter because it would seem
// logical to encoded its type in the recording, and on replaying the
@ -42,7 +42,7 @@ already_AddRefed<PrintTargetRecording> PrintTargetRecording::CreateOrNull(
// available on all platforms and doesn't require allocating a
// potentially large surface.
//
// * Since we need a DrawTarget to pass to CreateWrapAndRecordDrawTarget we
// * Since we need a DrawTarget to pass to CreateRecordingDrawTarget we
// might as well leverage our base class's machinery to create a
// DrawTarget (it's as good a way as any other that will work), and to do
// that we need a cairo_surface_t.
@ -76,7 +76,7 @@ already_AddRefed<DrawTarget> PrintTargetRecording::MakeDrawTarget(
RefPtr<DrawTarget> dt = PrintTarget::MakeDrawTarget(aSize, nullptr);
if (dt) {
dt = CreateWrapAndRecordDrawTarget(aRecorder, dt);
dt = CreateRecordingDrawTarget(aRecorder, dt);
if (!dt || !dt->IsValid()) {
return nullptr;
}
@ -86,7 +86,7 @@ already_AddRefed<DrawTarget> PrintTargetRecording::MakeDrawTarget(
}
already_AddRefed<DrawTarget>
PrintTargetRecording::CreateWrapAndRecordDrawTarget(
PrintTargetRecording::CreateRecordingDrawTarget(
DrawEventRecorder* aRecorder, DrawTarget* aDrawTarget) {
MOZ_ASSERT(aRecorder);
MOZ_ASSERT(aDrawTarget);

View File

@ -41,7 +41,7 @@ already_AddRefed<DrawTarget> PrintTargetThebes::MakeDrawTarget(
}
if (aRecorder) {
dt = CreateWrapAndRecordDrawTarget(aRecorder, dt);
dt = CreateRecordingDrawTarget(aRecorder, dt);
if (!dt || !dt->IsValid()) {
return nullptr;
}