Bug 1848468 - Mark k-rate-dynamics-compressor-connections.html subtest as failing...
[gecko.git] / gfx / thebes / PrintTargetThebes.h
blob65dfcbf7edb830f15dd383d580f2d84693d6219f
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef MOZILLA_GFX_PRINTTARGETTHEBES_H
7 #define MOZILLA_GFX_PRINTTARGETTHEBES_H
9 #include "mozilla/gfx/PrintTarget.h"
11 class gfxASurface;
13 namespace mozilla {
14 namespace gfx {
16 /**
17 * XXX Remove this class.
19 * This class should go away once all the logic from the gfxASurface subclasses
20 * has been moved to new PrintTarget subclasses and we no longer need to
21 * wrap a gfxASurface.
23 * When removing this class, be sure to make PrintTarget::MakeDrawTarget
24 * non-virtual!
26 class PrintTargetThebes final : public PrintTarget {
27 public:
28 static already_AddRefed<PrintTargetThebes> CreateOrNull(
29 gfxASurface* aSurface);
31 nsresult BeginPrinting(const nsAString& aTitle,
32 const nsAString& aPrintToFileName, int32_t aStartPage,
33 int32_t aEndPage) override;
34 nsresult EndPrinting() override;
35 nsresult AbortPrinting() override;
36 nsresult BeginPage(const IntSize& aSizeInPoints) override;
37 nsresult EndPage() override;
38 void Finish() override;
40 already_AddRefed<DrawTarget> MakeDrawTarget(
41 const IntSize& aSize, DrawEventRecorder* aRecorder = nullptr) override;
43 already_AddRefed<DrawTarget> GetReferenceDrawTarget() final;
45 private:
46 // Only created via CreateOrNull
47 explicit PrintTargetThebes(gfxASurface* aSurface);
49 RefPtr<gfxASurface> mGfxSurface;
52 } // namespace gfx
53 } // namespace mozilla
55 #endif /* MOZILLA_GFX_PRINTTARGETTHEBES_H */