Bug 1444940 [wpt PR 9917] - Writable streams: test changes to abort() under error...
[gecko.git] / gfx / 2d / DrawCommand.h
blob07dca044a857f15d2501efbe32830d8e18237fa3
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZILLA_GFX_DRAWCOMMAND_H_
8 #define MOZILLA_GFX_DRAWCOMMAND_H_
10 #include <math.h>
12 #include "2D.h"
13 #include "Blur.h"
14 #include "Filters.h"
15 #include <vector>
16 #include "FilterNodeCapture.h"
17 #include "Logging.h"
19 namespace mozilla {
20 namespace gfx {
22 class CaptureCommandList;
24 enum class CommandType : int8_t {
25 DRAWSURFACE = 0,
26 DRAWFILTER,
27 DRAWSURFACEWITHSHADOW,
28 CLEARRECT,
29 COPYSURFACE,
30 COPYRECT,
31 FILLRECT,
32 STROKERECT,
33 STROKELINE,
34 STROKE,
35 FILL,
36 FILLGLYPHS,
37 STROKEGLYPHS,
38 MASK,
39 MASKSURFACE,
40 PUSHCLIP,
41 PUSHCLIPRECT,
42 PUSHLAYER,
43 POPCLIP,
44 POPLAYER,
45 SETTRANSFORM,
46 SETPERMITSUBPIXELAA,
47 FLUSH,
48 BLUR
51 class DrawingCommand
53 public:
54 virtual ~DrawingCommand() {}
56 virtual void ExecuteOnDT(DrawTarget* aDT, const Matrix* aTransform = nullptr) const = 0;
57 virtual bool GetAffectedRect(Rect& aDeviceRect, const Matrix& aTransform) const { return false; }
58 virtual void CloneInto(CaptureCommandList* aList) = 0;
59 virtual void Log(TreeLog& aLog) const = 0;
61 CommandType GetType() { return mType; }
63 protected:
64 explicit DrawingCommand(CommandType aType)
65 : mType(aType)
69 private:
70 CommandType mType;
73 } // namespace gfx
74 } // namespace mozilla
76 #endif /* MOZILLA_GFX_DRAWCOMMAND_H_ */