2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2014-08-01 20:01:47 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_DRAWCOMMAND_H_
|
|
|
|
#define MOZILLA_GFX_DRAWCOMMAND_H_
|
|
|
|
|
2015-06-10 20:57:08 +03:00
|
|
|
#include <math.h>
|
|
|
|
|
2014-08-01 20:01:47 +04:00
|
|
|
#include "2D.h"
|
2017-10-31 22:02:30 +03:00
|
|
|
#include "Blur.h"
|
2014-08-01 20:01:47 +04:00
|
|
|
#include "Filters.h"
|
|
|
|
#include <vector>
|
2017-12-07 05:21:49 +03:00
|
|
|
#include "FilterNodeCapture.h"
|
2014-08-01 20:01:47 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
|
2018-02-02 18:59:35 +03:00
|
|
|
class CaptureCommandList;
|
|
|
|
|
2015-01-26 01:22:07 +03:00
|
|
|
enum class CommandType : int8_t {
|
2014-08-01 20:01:47 +04:00
|
|
|
DRAWSURFACE = 0,
|
|
|
|
DRAWFILTER,
|
|
|
|
DRAWSURFACEWITHSHADOW,
|
|
|
|
CLEARRECT,
|
|
|
|
COPYSURFACE,
|
|
|
|
COPYRECT,
|
|
|
|
FILLRECT,
|
|
|
|
STROKERECT,
|
|
|
|
STROKELINE,
|
|
|
|
STROKE,
|
|
|
|
FILL,
|
|
|
|
FILLGLYPHS,
|
2017-07-15 03:48:00 +03:00
|
|
|
STROKEGLYPHS,
|
2014-08-01 20:01:47 +04:00
|
|
|
MASK,
|
|
|
|
MASKSURFACE,
|
|
|
|
PUSHCLIP,
|
|
|
|
PUSHCLIPRECT,
|
2017-06-22 00:19:42 +03:00
|
|
|
PUSHLAYER,
|
2014-08-01 20:01:47 +04:00
|
|
|
POPCLIP,
|
2017-06-22 00:19:42 +03:00
|
|
|
POPLAYER,
|
2015-06-10 20:57:08 +03:00
|
|
|
SETTRANSFORM,
|
2017-09-13 22:15:16 +03:00
|
|
|
SETPERMITSUBPIXELAA,
|
2017-10-31 22:02:30 +03:00
|
|
|
FLUSH,
|
|
|
|
BLUR
|
2015-01-26 01:22:07 +03:00
|
|
|
};
|
2014-08-01 20:01:47 +04:00
|
|
|
|
|
|
|
class DrawingCommand
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~DrawingCommand() {}
|
|
|
|
|
2015-09-28 14:49:50 +03:00
|
|
|
virtual void ExecuteOnDT(DrawTarget* aDT, const Matrix* aTransform = nullptr) const = 0;
|
|
|
|
virtual bool GetAffectedRect(Rect& aDeviceRect, const Matrix& aTransform) const { return false; }
|
2017-10-31 22:02:31 +03:00
|
|
|
virtual void CloneInto(CaptureCommandList* aList) = 0;
|
2015-06-10 20:57:08 +03:00
|
|
|
|
2016-11-24 08:11:29 +03:00
|
|
|
CommandType GetType() { return mType; }
|
|
|
|
|
2014-08-01 20:01:47 +04:00
|
|
|
protected:
|
2014-09-01 07:31:20 +04:00
|
|
|
explicit DrawingCommand(CommandType aType)
|
2014-08-01 20:01:47 +04:00
|
|
|
: mType(aType)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
CommandType mType;
|
|
|
|
};
|
|
|
|
|
2017-10-31 22:02:30 +03:00
|
|
|
} // namespace gfx
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-08-01 20:01:47 +04:00
|
|
|
#endif /* MOZILLA_GFX_DRAWCOMMAND_H_ */
|