Bug 1540581 - P6. Tidy some C++ declarations in gfx/. r=gerald,jrmuizel
* Remove redundant virtual keywords
* Mark all destructors of inheriting classes as virtual for clarity
* Mark all classes without virtual destructor as final (exposed errors)
* Make destructor virtual where it needed to be (some were missing)
* Replace empty ({}) code declaration in header with = default
* Remove virtual unused methods
I probably missed some, it quickly became a rabbit hole.
Differential Revision: https://phabricator.services.mozilla.com/D26060
This commit is contained in:
36
gfx/2d/2D.h
36
gfx/2d/2D.h
@@ -194,7 +194,7 @@ struct DrawSurfaceOptions {
|
||||
class GradientStops : public external::AtomicRefCounted<GradientStops> {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStops)
|
||||
virtual ~GradientStops() {}
|
||||
virtual ~GradientStops() = default;
|
||||
|
||||
virtual BackendType GetBackendType() const = 0;
|
||||
virtual bool IsValid() const { return true; }
|
||||
@@ -211,12 +211,12 @@ class GradientStops : public external::AtomicRefCounted<GradientStops> {
|
||||
*/
|
||||
class Pattern {
|
||||
public:
|
||||
virtual ~Pattern() {}
|
||||
virtual ~Pattern() = default;
|
||||
|
||||
virtual PatternType GetType() const = 0;
|
||||
|
||||
protected:
|
||||
Pattern() {}
|
||||
Pattern() = default;
|
||||
};
|
||||
|
||||
class ColorPattern : public Pattern {
|
||||
@@ -225,7 +225,7 @@ class ColorPattern : public Pattern {
|
||||
// creating a ColorPattern.
|
||||
explicit ColorPattern(const Color &aColor) : mColor(aColor) {}
|
||||
|
||||
virtual PatternType GetType() const override { return PatternType::COLOR; }
|
||||
PatternType GetType() const override { return PatternType::COLOR; }
|
||||
|
||||
Color mColor;
|
||||
};
|
||||
@@ -242,9 +242,7 @@ class LinearGradientPattern : public Pattern {
|
||||
GradientStops *aStops, const Matrix &aMatrix = Matrix())
|
||||
: mBegin(aBegin), mEnd(aEnd), mStops(aStops), mMatrix(aMatrix) {}
|
||||
|
||||
virtual PatternType GetType() const override {
|
||||
return PatternType::LINEAR_GRADIENT;
|
||||
}
|
||||
PatternType GetType() const override { return PatternType::LINEAR_GRADIENT; }
|
||||
|
||||
Point mBegin; //!< Start of the linear gradient
|
||||
Point mEnd; /**< End of the linear gradient - NOTE: In the case
|
||||
@@ -276,9 +274,7 @@ class RadialGradientPattern : public Pattern {
|
||||
mStops(aStops),
|
||||
mMatrix(aMatrix) {}
|
||||
|
||||
virtual PatternType GetType() const override {
|
||||
return PatternType::RADIAL_GRADIENT;
|
||||
}
|
||||
PatternType GetType() const override { return PatternType::RADIAL_GRADIENT; }
|
||||
|
||||
Point mCenter1; //!< Center of the inner (focal) circle.
|
||||
Point mCenter2; //!< Center of the outer circle.
|
||||
@@ -308,7 +304,7 @@ class SurfacePattern : public Pattern {
|
||||
mMatrix(aMatrix),
|
||||
mSamplingRect(aSamplingRect) {}
|
||||
|
||||
virtual PatternType GetType() const override { return PatternType::SURFACE; }
|
||||
PatternType GetType() const override { return PatternType::SURFACE; }
|
||||
|
||||
RefPtr<SourceSurface> mSurface; //!< Surface to use for drawing
|
||||
ExtendMode mExtendMode; /**< This determines how the image is extended
|
||||
@@ -338,7 +334,7 @@ class DrawTargetCaptureImpl;
|
||||
class SourceSurface : public external::AtomicRefCounted<SourceSurface> {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurface)
|
||||
virtual ~SourceSurface() {}
|
||||
virtual ~SourceSurface() = default;
|
||||
|
||||
virtual SurfaceType GetType() const = 0;
|
||||
virtual IntSize GetSize() const = 0;
|
||||
@@ -429,7 +425,7 @@ class DataSourceSurface : public SourceSurface {
|
||||
*/
|
||||
class ScopedMap final {
|
||||
public:
|
||||
explicit ScopedMap(DataSourceSurface *aSurface, MapType aType)
|
||||
ScopedMap(DataSourceSurface *aSurface, MapType aType)
|
||||
: mSurface(aSurface), mIsMapped(aSurface->Map(aType, &mMap)) {}
|
||||
|
||||
ScopedMap(ScopedMap &&aOther)
|
||||
@@ -484,7 +480,7 @@ class DataSourceSurface : public SourceSurface {
|
||||
bool mIsMapped;
|
||||
};
|
||||
|
||||
virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
|
||||
SurfaceType GetType() const override { return SurfaceType::DATA; }
|
||||
/** @deprecated
|
||||
* Get the raw bitmap data of the surface.
|
||||
* Can return null if there was OOM allocating surface data.
|
||||
@@ -535,7 +531,7 @@ class DataSourceSurface : public SourceSurface {
|
||||
* The returning surface might be null, because of OOM or gfx device reset.
|
||||
* The caller needs to do null-check before using it.
|
||||
*/
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
|
||||
already_AddRefed<DataSourceSurface> GetDataSurface() override;
|
||||
|
||||
/**
|
||||
* Add the size of the underlying data buffer to the aggregate.
|
||||
@@ -570,7 +566,7 @@ class DataSourceSurface : public SourceSurface {
|
||||
class PathSink : public RefCounted<PathSink> {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSink)
|
||||
virtual ~PathSink() {}
|
||||
virtual ~PathSink() = default;
|
||||
|
||||
/** Move the current point in the path, any figure currently being drawn will
|
||||
* be considered closed during fill operations, however when stroking the
|
||||
@@ -894,7 +890,7 @@ class NativeFontResource
|
||||
uint32_t aIndex, const uint8_t *aInstanceData,
|
||||
uint32_t aInstanceDataLength) = 0;
|
||||
|
||||
virtual ~NativeFontResource() {}
|
||||
virtual ~NativeFontResource() = default;
|
||||
};
|
||||
|
||||
class DrawTargetCapture;
|
||||
@@ -911,7 +907,7 @@ class DrawTarget : public external::AtomicRefCounted<DrawTarget> {
|
||||
: mTransformDirty(false),
|
||||
mPermitSubpixelAA(false),
|
||||
mFormat(SurfaceFormat::UNKNOWN) {}
|
||||
virtual ~DrawTarget() {}
|
||||
virtual ~DrawTarget() = default;
|
||||
|
||||
virtual bool IsValid() const { return true; };
|
||||
virtual DrawTargetType GetType() const = 0;
|
||||
@@ -1519,7 +1515,7 @@ class DrawTarget : public external::AtomicRefCounted<DrawTarget> {
|
||||
|
||||
class DrawTargetCapture : public DrawTarget {
|
||||
public:
|
||||
virtual bool IsCaptureDT() const override { return true; }
|
||||
bool IsCaptureDT() const override { return true; }
|
||||
|
||||
virtual bool IsEmpty() const = 0;
|
||||
virtual void Dump() = 0;
|
||||
@@ -1530,7 +1526,7 @@ class DrawEventRecorder : public RefCounted<DrawEventRecorder> {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorder)
|
||||
// returns true if there were any items in the recording
|
||||
virtual bool Finish() = 0;
|
||||
virtual ~DrawEventRecorder() {}
|
||||
virtual ~DrawEventRecorder() = default;
|
||||
};
|
||||
|
||||
struct Tile {
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace gfx {
|
||||
* A spread N makes each output pixel the maximum value of all source
|
||||
* pixels within a square of side length 2N+1 centered on the output pixel.
|
||||
*/
|
||||
class GFX2D_API AlphaBoxBlur {
|
||||
class GFX2D_API AlphaBoxBlur final {
|
||||
public:
|
||||
/** Constructs a box blur and computes the backing surface size.
|
||||
*
|
||||
|
||||
@@ -14,7 +14,7 @@ class SkConvolutionFilter1D;
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
class ConvolutionFilter {
|
||||
class ConvolutionFilter final {
|
||||
public:
|
||||
ConvolutionFilter();
|
||||
~ConvolutionFilter();
|
||||
|
||||
@@ -67,7 +67,7 @@ class CriticalSection {
|
||||
#endif
|
||||
|
||||
/// RAII helper.
|
||||
struct CriticalSectionAutoEnter {
|
||||
struct CriticalSectionAutoEnter final {
|
||||
explicit CriticalSectionAutoEnter(CriticalSection* aSection)
|
||||
: mSection(aSection) {
|
||||
mSection->Enter();
|
||||
|
||||
@@ -25,15 +25,13 @@ class DataSourceSurfaceWrapper final : public DataSourceSurface {
|
||||
mSurface->Equals(aOther, aSymmetric);
|
||||
}
|
||||
|
||||
virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
|
||||
SurfaceType GetType() const override { return SurfaceType::DATA; }
|
||||
|
||||
virtual uint8_t *GetData() override { return mSurface->GetData(); }
|
||||
virtual int32_t Stride() override { return mSurface->Stride(); }
|
||||
virtual IntSize GetSize() const override { return mSurface->GetSize(); }
|
||||
virtual SurfaceFormat GetFormat() const override {
|
||||
return mSurface->GetFormat();
|
||||
}
|
||||
virtual bool IsValid() const override { return mSurface->IsValid(); }
|
||||
uint8_t *GetData() override { return mSurface->GetData(); }
|
||||
int32_t Stride() override { return mSurface->Stride(); }
|
||||
IntSize GetSize() const override { return mSurface->GetSize(); }
|
||||
SurfaceFormat GetFormat() const override { return mSurface->GetFormat(); }
|
||||
bool IsValid() const override { return mSurface->IsValid(); }
|
||||
|
||||
bool Map(MapType aType, MappedSurface *aMappedSurface) override {
|
||||
return mSurface->Map(aType, aMappedSurface);
|
||||
|
||||
@@ -52,7 +52,7 @@ enum class CommandType : int8_t {
|
||||
|
||||
class DrawingCommand {
|
||||
public:
|
||||
virtual ~DrawingCommand() {}
|
||||
virtual ~DrawingCommand() = default;
|
||||
|
||||
virtual CommandType GetType() const = 0;
|
||||
virtual void ExecuteOnDT(DrawTarget* aDT,
|
||||
|
||||
@@ -38,7 +38,7 @@ class StrokeOptionsCommand : public DrawingCommand {
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~StrokeOptionsCommand() {}
|
||||
virtual ~StrokeOptionsCommand() = default;
|
||||
|
||||
protected:
|
||||
StrokeOptions mStrokeOptions;
|
||||
@@ -867,8 +867,7 @@ class SetTransformCommand : public DrawingCommand {
|
||||
CLONE_INTO(SetTransformCommand)(mTransform);
|
||||
}
|
||||
|
||||
virtual void ExecuteOnDT(DrawTarget* aDT,
|
||||
const Matrix* aMatrix) const override {
|
||||
void ExecuteOnDT(DrawTarget* aDT, const Matrix* aMatrix) const override {
|
||||
if (aMatrix) {
|
||||
aDT->SetTransform(mTransform * (*aMatrix));
|
||||
} else {
|
||||
@@ -902,8 +901,7 @@ class SetPermitSubpixelAACommand : public DrawingCommand {
|
||||
CLONE_INTO(SetPermitSubpixelAACommand)(mPermitSubpixelAA);
|
||||
}
|
||||
|
||||
virtual void ExecuteOnDT(DrawTarget* aDT,
|
||||
const Matrix* aMatrix) const override {
|
||||
void ExecuteOnDT(DrawTarget* aDT, const Matrix* aMatrix) const override {
|
||||
aDT->SetPermitSubpixelAA(mPermitSubpixelAA);
|
||||
}
|
||||
|
||||
@@ -921,7 +919,7 @@ class SetPermitSubpixelAACommand : public DrawingCommand {
|
||||
|
||||
class FlushCommand : public DrawingCommand {
|
||||
public:
|
||||
explicit FlushCommand() {}
|
||||
FlushCommand() = default;
|
||||
|
||||
CommandType GetType() const override { return FlushCommand::Type; }
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ class DrawEventRecorderPrivate : public DrawEventRecorder {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderPrivate, override)
|
||||
|
||||
DrawEventRecorderPrivate();
|
||||
virtual ~DrawEventRecorderPrivate() {}
|
||||
virtual bool Finish() override {
|
||||
virtual ~DrawEventRecorderPrivate() = default;
|
||||
bool Finish() override {
|
||||
ClearResources();
|
||||
return true;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class DrawEventRecorderFile : public DrawEventRecorderPrivate {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderFile, override)
|
||||
explicit DrawEventRecorderFile(const char_type* aFilename);
|
||||
~DrawEventRecorderFile();
|
||||
virtual ~DrawEventRecorderFile();
|
||||
|
||||
void RecordEvent(const RecordedEvent& aEvent) override;
|
||||
|
||||
@@ -211,7 +211,7 @@ class DrawEventRecorderMemory : public DrawEventRecorderPrivate {
|
||||
MemStream mIndex;
|
||||
|
||||
protected:
|
||||
~DrawEventRecorderMemory(){};
|
||||
virtual ~DrawEventRecorderMemory(){};
|
||||
|
||||
private:
|
||||
SerializeResourcesFn mSerializeCallback;
|
||||
|
||||
@@ -387,7 +387,7 @@ static cairo_surface_t* GetCairoSurfaceForSourceSurface(
|
||||
// An RAII class to temporarily clear any device offset set
|
||||
// on a surface. Note that this does not take a reference to the
|
||||
// surface.
|
||||
class AutoClearDeviceOffset {
|
||||
class AutoClearDeviceOffset final {
|
||||
public:
|
||||
explicit AutoClearDeviceOffset(SourceSurface* aSurface)
|
||||
: mSurface(nullptr), mX(0), mY(0) {
|
||||
|
||||
@@ -30,7 +30,7 @@ class GradientStopsCairo : public GradientStops {
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~GradientStopsCairo() {}
|
||||
virtual ~GradientStopsCairo() = default;
|
||||
|
||||
const std::vector<GradientStop> &GetStops() const { return mStops; }
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class DrawingCommand;
|
||||
class SourceSurfaceCapture;
|
||||
class AlphaBoxBlur;
|
||||
|
||||
class DrawTargetCaptureImpl : public DrawTargetCapture {
|
||||
class DrawTargetCaptureImpl final : public DrawTargetCapture {
|
||||
friend class SourceSurfaceCapture;
|
||||
|
||||
public:
|
||||
@@ -30,108 +30,104 @@ class DrawTargetCaptureImpl : public DrawTargetCapture {
|
||||
bool Init(const IntSize &aSize, DrawTarget *aRefDT);
|
||||
void InitForData(int32_t aStride, size_t aSurfaceAllocationSize);
|
||||
|
||||
virtual BackendType GetBackendType() const override {
|
||||
BackendType GetBackendType() const override {
|
||||
return mRefDT->GetBackendType();
|
||||
}
|
||||
virtual DrawTargetType GetType() const override { return mRefDT->GetType(); }
|
||||
virtual bool IsCaptureDT() const override { return true; }
|
||||
virtual already_AddRefed<SourceSurface> Snapshot() override;
|
||||
virtual already_AddRefed<SourceSurface> IntoLuminanceSource(
|
||||
DrawTargetType GetType() const override { return mRefDT->GetType(); }
|
||||
bool IsCaptureDT() const override { return true; }
|
||||
already_AddRefed<SourceSurface> Snapshot() override;
|
||||
already_AddRefed<SourceSurface> IntoLuminanceSource(
|
||||
LuminanceType aLuminanceType, float aOpacity) override;
|
||||
virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
|
||||
virtual void DetachAllSnapshots() override;
|
||||
virtual IntSize GetSize() const override { return mSize; }
|
||||
virtual void Flush() override {}
|
||||
virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
|
||||
const Rect &aSource,
|
||||
const DrawSurfaceOptions &aSurfOptions,
|
||||
void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
|
||||
void DetachAllSnapshots() override;
|
||||
IntSize GetSize() const override { return mSize; }
|
||||
void Flush() override {}
|
||||
void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
|
||||
const Rect &aSource, const DrawSurfaceOptions &aSurfOptions,
|
||||
const DrawOptions &aOptions) override;
|
||||
virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
|
||||
void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
|
||||
const Point &aDestPoint,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void DrawSurfaceWithShadow(SourceSurface *aSurface,
|
||||
const Point &aDest, const Color &aColor,
|
||||
const Point &aOffset, Float aSigma,
|
||||
CompositionOp aOperator) override;
|
||||
void DrawSurfaceWithShadow(SourceSurface *aSurface, const Point &aDest,
|
||||
const Color &aColor, const Point &aOffset,
|
||||
Float aSigma, CompositionOp aOperator) override;
|
||||
|
||||
virtual void ClearRect(const Rect &aRect) override;
|
||||
virtual void MaskSurface(
|
||||
const Pattern &aSource, SourceSurface *aMask, Point aOffset,
|
||||
void ClearRect(const Rect &aRect) override;
|
||||
void MaskSurface(const Pattern &aSource, SourceSurface *aMask, Point aOffset,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
|
||||
void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
|
||||
const IntPoint &aDestination) override;
|
||||
virtual void CopyRect(const IntRect &aSourceRect,
|
||||
void CopyRect(const IntRect &aSourceRect,
|
||||
const IntPoint &aDestination) override;
|
||||
|
||||
virtual void FillRect(const Rect &aRect, const Pattern &aPattern,
|
||||
void FillRect(const Rect &aRect, const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void FillRoundedRect(
|
||||
const RoundedRect &aRect, const Pattern &aPattern,
|
||||
void FillRoundedRect(const RoundedRect &aRect, const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern,
|
||||
void StrokeRect(const Rect &aRect, const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void StrokeLine(const Point &aStart, const Point &aEnd,
|
||||
void StrokeLine(const Point &aStart, const Point &aEnd,
|
||||
const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void Stroke(const Path *aPath, const Pattern &aPattern,
|
||||
void Stroke(const Path *aPath, const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void Fill(const Path *aPath, const Pattern &aPattern,
|
||||
void Fill(const Path *aPath, const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
|
||||
void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
|
||||
const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void StrokeGlyphs(
|
||||
ScaledFont *aFont, const GlyphBuffer &aBuffer, const Pattern &aPattern,
|
||||
void StrokeGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
|
||||
const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void Mask(const Pattern &aSource, const Pattern &aMask,
|
||||
void Mask(const Pattern &aSource, const Pattern &aMask,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void PushClip(const Path *aPath) override;
|
||||
virtual void PushClipRect(const Rect &aRect) override;
|
||||
virtual void PopClip() override;
|
||||
virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
|
||||
void PushClip(const Path *aPath) override;
|
||||
void PushClipRect(const Rect &aRect) override;
|
||||
void PopClip() override;
|
||||
void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
|
||||
const Matrix &aMaskTransform, const IntRect &aBounds,
|
||||
bool aCopyBackground) override;
|
||||
virtual void PopLayer() override;
|
||||
virtual void Blur(const AlphaBoxBlur &aBlur) override;
|
||||
virtual void PadEdges(const IntRegion &aRegion) override;
|
||||
void PopLayer() override;
|
||||
void Blur(const AlphaBoxBlur &aBlur) override;
|
||||
void PadEdges(const IntRegion &aRegion) override;
|
||||
|
||||
virtual void SetTransform(const Matrix &aTransform) override;
|
||||
void SetTransform(const Matrix &aTransform) override;
|
||||
|
||||
virtual bool SupportsRegionClipping() const override {
|
||||
bool SupportsRegionClipping() const override {
|
||||
return mRefDT->SupportsRegionClipping();
|
||||
}
|
||||
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
|
||||
already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
|
||||
unsigned char *aData, const IntSize &aSize, int32_t aStride,
|
||||
SurfaceFormat aFormat) const override {
|
||||
return mRefDT->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat);
|
||||
}
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(
|
||||
already_AddRefed<SourceSurface> OptimizeSourceSurface(
|
||||
SourceSurface *aSurface) const override;
|
||||
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
|
||||
already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
|
||||
const NativeSurface &aSurface) const override {
|
||||
return mRefDT->CreateSourceSurfaceFromNativeSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
|
||||
already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
|
||||
const IntSize &aSize, SurfaceFormat aFormat) const override;
|
||||
virtual RefPtr<DrawTarget> CreateSimilarRasterTarget(
|
||||
RefPtr<DrawTarget> CreateSimilarRasterTarget(
|
||||
const IntSize &aSize, SurfaceFormat aFormat) const override;
|
||||
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(
|
||||
already_AddRefed<PathBuilder> CreatePathBuilder(
|
||||
FillRule aFillRule = FillRule::FILL_WINDING) const override;
|
||||
|
||||
virtual already_AddRefed<GradientStops> CreateGradientStops(
|
||||
already_AddRefed<GradientStops> CreateGradientStops(
|
||||
GradientStop *aStops, uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const override {
|
||||
return mRefDT->CreateGradientStops(aStops, aNumStops, aExtendMode);
|
||||
}
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override;
|
||||
already_AddRefed<FilterNode> CreateFilter(FilterType aType) override;
|
||||
|
||||
void ReplayToDrawTarget(DrawTarget *aDT, const Matrix &aTransform);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class DualSurface {
|
||||
* case can we be dealing with a 'dual' source (SourceSurfaceDual) and do
|
||||
* we need to pass separate patterns into our destination DrawTargets.
|
||||
*/
|
||||
class DualPattern {
|
||||
class DualPattern final {
|
||||
public:
|
||||
inline explicit DualPattern(const Pattern &aPattern)
|
||||
: mPatternsInitialized(false) {
|
||||
|
||||
@@ -69,12 +69,10 @@ class SourceSurfaceRecording : public SourceSurface {
|
||||
RecordedSourceSurfaceDestruction(ReferencePtr(this)));
|
||||
}
|
||||
|
||||
virtual SurfaceType GetType() const override {
|
||||
return SurfaceType::RECORDING;
|
||||
}
|
||||
virtual IntSize GetSize() const override { return mSize; }
|
||||
virtual SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override {
|
||||
SurfaceType GetType() const override { return SurfaceType::RECORDING; }
|
||||
IntSize GetSize() const override { return mSize; }
|
||||
SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
already_AddRefed<DataSourceSurface> GetDataSurface() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -109,13 +107,11 @@ class DataSourceSurfaceRecording : public DataSourceSurface {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual SurfaceType GetType() const override {
|
||||
return SurfaceType::RECORDING;
|
||||
}
|
||||
virtual IntSize GetSize() const override { return mSize; }
|
||||
virtual int32_t Stride() override { return mStride; }
|
||||
virtual SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
virtual uint8_t *GetData() override { return mData.get(); }
|
||||
SurfaceType GetType() const override { return SurfaceType::RECORDING; }
|
||||
IntSize GetSize() const override { return mSize; }
|
||||
int32_t Stride() override { return mStride; }
|
||||
SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
uint8_t *GetData() override { return mData.get(); }
|
||||
|
||||
UniquePtr<uint8_t[]> mData;
|
||||
IntSize mSize;
|
||||
@@ -132,15 +128,13 @@ class GradientStopsRecording : public GradientStops {
|
||||
mRecorder->AddStoredObject(this);
|
||||
}
|
||||
|
||||
~GradientStopsRecording() {
|
||||
virtual ~GradientStopsRecording() {
|
||||
mRecorder->RemoveStoredObject(this);
|
||||
mRecorder->RecordEvent(
|
||||
RecordedGradientStopsDestruction(ReferencePtr(this)));
|
||||
}
|
||||
|
||||
virtual BackendType GetBackendType() const override {
|
||||
return BackendType::RECORDING;
|
||||
}
|
||||
BackendType GetBackendType() const override { return BackendType::RECORDING; }
|
||||
|
||||
RefPtr<DrawEventRecorderPrivate> mRecorder;
|
||||
};
|
||||
@@ -155,24 +149,24 @@ class FilterNodeRecording : public FilterNode {
|
||||
mRecorder->AddStoredObject(this);
|
||||
}
|
||||
|
||||
~FilterNodeRecording() {
|
||||
virtual ~FilterNodeRecording() {
|
||||
mRecorder->RemoveStoredObject(this);
|
||||
mRecorder->RecordEvent(RecordedFilterNodeDestruction(ReferencePtr(this)));
|
||||
}
|
||||
|
||||
virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
|
||||
void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
|
||||
EnsureSurfaceStoredRecording(mRecorder, aSurface, "SetInput");
|
||||
|
||||
mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aSurface));
|
||||
}
|
||||
virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
|
||||
void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
|
||||
MOZ_ASSERT(mRecorder->HasStoredObject(aFilter));
|
||||
|
||||
mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aFilter));
|
||||
}
|
||||
|
||||
#define FORWARD_SET_ATTRIBUTE(type, argtype) \
|
||||
virtual void SetAttribute(uint32_t aIndex, type aValue) override { \
|
||||
void SetAttribute(uint32_t aIndex, type aValue) override { \
|
||||
mRecorder->RecordEvent(RecordedFilterNodeSetAttribute( \
|
||||
this, aIndex, aValue, \
|
||||
RecordedFilterNodeSetAttribute::ARGTYPE_##argtype)); \
|
||||
@@ -194,15 +188,13 @@ class FilterNodeRecording : public FilterNode {
|
||||
|
||||
#undef FORWARD_SET_ATTRIBUTE
|
||||
|
||||
virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
uint32_t aSize) override {
|
||||
mRecorder->RecordEvent(
|
||||
RecordedFilterNodeSetAttribute(this, aIndex, aFloat, aSize));
|
||||
}
|
||||
|
||||
virtual FilterBackend GetBackendType() override {
|
||||
return FILTER_BACKEND_RECORDING;
|
||||
}
|
||||
FilterBackend GetBackendType() override { return FILTER_BACKEND_RECORDING; }
|
||||
|
||||
RefPtr<DrawEventRecorderPrivate> mRecorder;
|
||||
};
|
||||
|
||||
@@ -34,126 +34,124 @@ class DrawTargetTiled : public DrawTarget {
|
||||
|
||||
bool Init(const TileSet &mTiles);
|
||||
|
||||
virtual bool IsTiledDrawTarget() const override { return true; }
|
||||
bool IsTiledDrawTarget() const override { return true; }
|
||||
|
||||
virtual bool IsCaptureDT() const override {
|
||||
bool IsCaptureDT() const override {
|
||||
return mTiles[0].mDrawTarget->IsCaptureDT();
|
||||
}
|
||||
virtual DrawTargetType GetType() const override {
|
||||
DrawTargetType GetType() const override {
|
||||
return mTiles[0].mDrawTarget->GetType();
|
||||
}
|
||||
virtual BackendType GetBackendType() const override {
|
||||
BackendType GetBackendType() const override {
|
||||
return mTiles[0].mDrawTarget->GetBackendType();
|
||||
}
|
||||
virtual already_AddRefed<SourceSurface> Snapshot() override;
|
||||
virtual void DetachAllSnapshots() override;
|
||||
virtual IntSize GetSize() const override {
|
||||
already_AddRefed<SourceSurface> Snapshot() override;
|
||||
void DetachAllSnapshots() override;
|
||||
IntSize GetSize() const override {
|
||||
MOZ_ASSERT(mRect.Width() > 0 && mRect.Height() > 0);
|
||||
return IntSize(mRect.XMost(), mRect.YMost());
|
||||
}
|
||||
virtual IntRect GetRect() const override { return mRect; }
|
||||
IntRect GetRect() const override { return mRect; }
|
||||
|
||||
virtual void Flush() override;
|
||||
virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
|
||||
const Rect &aSource,
|
||||
const DrawSurfaceOptions &aSurfOptions,
|
||||
void Flush() override;
|
||||
void DrawSurface(SourceSurface *aSurface, const Rect &aDest,
|
||||
const Rect &aSource, const DrawSurfaceOptions &aSurfOptions,
|
||||
const DrawOptions &aOptions) override;
|
||||
virtual void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
|
||||
void DrawFilter(FilterNode *aNode, const Rect &aSourceRect,
|
||||
const Point &aDestPoint,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void DrawSurfaceWithShadow(
|
||||
void DrawSurfaceWithShadow(
|
||||
SourceSurface *aSurface, const Point &aDest, const Color &aColor,
|
||||
const Point &aOffset, Float aSigma,
|
||||
CompositionOp aOperator) override { /* Not implemented */
|
||||
MOZ_CRASH("GFX: DrawSurfaceWithShadow");
|
||||
}
|
||||
|
||||
virtual void ClearRect(const Rect &aRect) override;
|
||||
virtual void MaskSurface(
|
||||
const Pattern &aSource, SourceSurface *aMask, Point aOffset,
|
||||
void ClearRect(const Rect &aRect) override;
|
||||
void MaskSurface(const Pattern &aSource, SourceSurface *aMask, Point aOffset,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
|
||||
virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
|
||||
void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
|
||||
const IntPoint &aDestination) override;
|
||||
|
||||
virtual void FillRect(const Rect &aRect, const Pattern &aPattern,
|
||||
void FillRect(const Rect &aRect, const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern,
|
||||
void StrokeRect(const Rect &aRect, const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void StrokeLine(const Point &aStart, const Point &aEnd,
|
||||
void StrokeLine(const Point &aStart, const Point &aEnd,
|
||||
const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void Stroke(const Path *aPath, const Pattern &aPattern,
|
||||
void Stroke(const Path *aPath, const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void Fill(const Path *aPath, const Pattern &aPattern,
|
||||
void Fill(const Path *aPath, const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
|
||||
void FillGlyphs(ScaledFont *aFont, const GlyphBuffer &aBuffer,
|
||||
const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void Mask(const Pattern &aSource, const Pattern &aMask,
|
||||
void Mask(const Pattern &aSource, const Pattern &aMask,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void PushClip(const Path *aPath) override;
|
||||
virtual void PushClipRect(const Rect &aRect) override;
|
||||
virtual void PopClip() override;
|
||||
virtual void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
|
||||
void PushClip(const Path *aPath) override;
|
||||
void PushClipRect(const Rect &aRect) override;
|
||||
void PopClip() override;
|
||||
void PushLayer(bool aOpaque, Float aOpacity, SourceSurface *aMask,
|
||||
const Matrix &aMaskTransform,
|
||||
const IntRect &aBounds = IntRect(),
|
||||
bool aCopyBackground = false) override;
|
||||
virtual void PushLayerWithBlend(
|
||||
bool aOpaque, Float aOpacity, SourceSurface *aMask,
|
||||
const Matrix &aMaskTransform, const IntRect &aBounds = IntRect(),
|
||||
void PushLayerWithBlend(bool aOpaque, Float aOpacity, SourceSurface *aMask,
|
||||
const Matrix &aMaskTransform,
|
||||
const IntRect &aBounds = IntRect(),
|
||||
bool aCopyBackground = false,
|
||||
CompositionOp = CompositionOp::OP_OVER) override;
|
||||
virtual void PopLayer() override;
|
||||
void PopLayer() override;
|
||||
|
||||
virtual void PadEdges(const IntRegion &aRegion) override;
|
||||
void PadEdges(const IntRegion &aRegion) override;
|
||||
|
||||
virtual void SetTransform(const Matrix &aTransform) override;
|
||||
void SetTransform(const Matrix &aTransform) override;
|
||||
|
||||
virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
|
||||
void SetPermitSubpixelAA(bool aPermitSubpixelAA) override;
|
||||
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
|
||||
already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(
|
||||
unsigned char *aData, const IntSize &aSize, int32_t aStride,
|
||||
SurfaceFormat aFormat) const override {
|
||||
return mTiles[0].mDrawTarget->CreateSourceSurfaceFromData(aData, aSize,
|
||||
aStride, aFormat);
|
||||
}
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(
|
||||
already_AddRefed<SourceSurface> OptimizeSourceSurface(
|
||||
SourceSurface *aSurface) const override {
|
||||
return mTiles[0].mDrawTarget->OptimizeSourceSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
|
||||
already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(
|
||||
const NativeSurface &aSurface) const override {
|
||||
return mTiles[0].mDrawTarget->CreateSourceSurfaceFromNativeSurface(
|
||||
aSurface);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
|
||||
already_AddRefed<DrawTarget> CreateSimilarDrawTarget(
|
||||
const IntSize &aSize, SurfaceFormat aFormat) const override {
|
||||
return mTiles[0].mDrawTarget->CreateSimilarDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
virtual bool CanCreateSimilarDrawTarget(
|
||||
const IntSize &aSize, SurfaceFormat aFormat) const override {
|
||||
bool CanCreateSimilarDrawTarget(const IntSize &aSize,
|
||||
SurfaceFormat aFormat) const override {
|
||||
return mTiles[0].mDrawTarget->CanCreateSimilarDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(
|
||||
already_AddRefed<PathBuilder> CreatePathBuilder(
|
||||
FillRule aFillRule = FillRule::FILL_WINDING) const override {
|
||||
return mTiles[0].mDrawTarget->CreatePathBuilder(aFillRule);
|
||||
}
|
||||
|
||||
virtual already_AddRefed<GradientStops> CreateGradientStops(
|
||||
already_AddRefed<GradientStops> CreateGradientStops(
|
||||
GradientStop *aStops, uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const override {
|
||||
return mTiles[0].mDrawTarget->CreateGradientStops(aStops, aNumStops,
|
||||
aExtendMode);
|
||||
}
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override {
|
||||
already_AddRefed<FilterNode> CreateFilter(FilterType aType) override {
|
||||
return mTiles[0].mDrawTarget->CreateFilter(aType);
|
||||
}
|
||||
|
||||
@@ -185,17 +183,17 @@ class SnapshotTiled : public SourceSurface {
|
||||
}
|
||||
}
|
||||
|
||||
virtual SurfaceType GetType() const override { return SurfaceType::TILED; }
|
||||
virtual IntSize GetSize() const override {
|
||||
SurfaceType GetType() const override { return SurfaceType::TILED; }
|
||||
IntSize GetSize() const override {
|
||||
MOZ_ASSERT(mRect.Width() > 0 && mRect.Height() > 0);
|
||||
return IntSize(mRect.XMost(), mRect.YMost());
|
||||
}
|
||||
virtual IntRect GetRect() const override { return mRect; }
|
||||
virtual SurfaceFormat GetFormat() const override {
|
||||
IntRect GetRect() const override { return mRect; }
|
||||
SurfaceFormat GetFormat() const override {
|
||||
return mSnapshots[0]->GetFormat();
|
||||
}
|
||||
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override {
|
||||
already_AddRefed<DataSourceSurface> GetDataSurface() override {
|
||||
RefPtr<DataSourceSurface> surf =
|
||||
Factory::CreateDataSourceSurface(mRect.Size(), GetFormat());
|
||||
if (!surf) {
|
||||
|
||||
@@ -92,14 +92,12 @@ class SourceSurfaceWrapAndRecord : public SourceSurface {
|
||||
RecordedSourceSurfaceDestruction(ReferencePtr(this)));
|
||||
}
|
||||
|
||||
virtual SurfaceType GetType() const override {
|
||||
return SurfaceType::RECORDING;
|
||||
}
|
||||
virtual IntSize GetSize() const override { return mFinalSurface->GetSize(); }
|
||||
virtual SurfaceFormat GetFormat() const override {
|
||||
SurfaceType GetType() const override { return SurfaceType::RECORDING; }
|
||||
IntSize GetSize() const override { return mFinalSurface->GetSize(); }
|
||||
SurfaceFormat GetFormat() const override {
|
||||
return mFinalSurface->GetFormat();
|
||||
}
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override {
|
||||
already_AddRefed<DataSourceSurface> GetDataSurface() override {
|
||||
return mFinalSurface->GetDataSurface();
|
||||
}
|
||||
|
||||
@@ -123,9 +121,7 @@ class GradientStopsWrapAndRecord : public GradientStops {
|
||||
RecordedGradientStopsDestruction(ReferencePtr(this)));
|
||||
}
|
||||
|
||||
virtual BackendType GetBackendType() const override {
|
||||
return BackendType::RECORDING;
|
||||
}
|
||||
BackendType GetBackendType() const override { return BackendType::RECORDING; }
|
||||
|
||||
RefPtr<GradientStops> mFinalGradientStops;
|
||||
RefPtr<DrawEventRecorderPrivate> mRecorder;
|
||||
@@ -173,13 +169,13 @@ class FilterNodeWrapAndRecord : public FilterNode {
|
||||
return static_cast<FilterNodeWrapAndRecord *>(aNode)->mFinalFilterNode;
|
||||
}
|
||||
|
||||
virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
|
||||
void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
|
||||
EnsureSurfaceStored(mRecorder, aSurface, "SetInput");
|
||||
|
||||
mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aSurface));
|
||||
mFinalFilterNode->SetInput(aIndex, GetSourceSurface(aSurface));
|
||||
}
|
||||
virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
|
||||
void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
|
||||
MOZ_ASSERT(mRecorder->HasStoredObject(aFilter));
|
||||
|
||||
mRecorder->RecordEvent(RecordedFilterNodeSetInput(this, aIndex, aFilter));
|
||||
@@ -187,7 +183,7 @@ class FilterNodeWrapAndRecord : public FilterNode {
|
||||
}
|
||||
|
||||
#define FORWARD_SET_ATTRIBUTE(type, argtype) \
|
||||
virtual void SetAttribute(uint32_t aIndex, type aValue) override { \
|
||||
void SetAttribute(uint32_t aIndex, type aValue) override { \
|
||||
mRecorder->RecordEvent(RecordedFilterNodeSetAttribute( \
|
||||
this, aIndex, aValue, \
|
||||
RecordedFilterNodeSetAttribute::ARGTYPE_##argtype)); \
|
||||
@@ -217,15 +213,13 @@ class FilterNodeWrapAndRecord : public FilterNode {
|
||||
mFinalFilterNode->SetAttribute(aIndex, aFloat, aSize);
|
||||
}
|
||||
|
||||
virtual FilterBackend GetBackendType() override {
|
||||
return FILTER_BACKEND_RECORDING;
|
||||
}
|
||||
FilterBackend GetBackendType() override { return FILTER_BACKEND_RECORDING; }
|
||||
|
||||
RefPtr<FilterNode> mFinalFilterNode;
|
||||
RefPtr<DrawEventRecorderPrivate> mRecorder;
|
||||
};
|
||||
|
||||
struct AdjustedPattern {
|
||||
struct AdjustedPattern final {
|
||||
explicit AdjustedPattern(const Pattern &aPattern) : mPattern(nullptr) {
|
||||
mOrigPattern = const_cast<Pattern *>(&aPattern);
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ class CommandBufferBuilder {
|
||||
/// Stores multiple commands to be executed sequencially.
|
||||
class DrawingJob : public Job {
|
||||
public:
|
||||
~DrawingJob();
|
||||
virtual ~DrawingJob();
|
||||
|
||||
virtual JobStatus Run() override;
|
||||
JobStatus Run() override;
|
||||
|
||||
protected:
|
||||
DrawingJob(DrawTarget* aTarget, IntPoint aOffset, SyncObject* aStart,
|
||||
@@ -107,7 +107,7 @@ class DrawingJob : public Job {
|
||||
///
|
||||
/// The builder is a separate object to ensure that commands are not added to a
|
||||
/// submitted DrawingJob.
|
||||
class DrawingJobBuilder {
|
||||
class DrawingJobBuilder final {
|
||||
public:
|
||||
DrawingJobBuilder();
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@ class FilterNodeCapture final : public FilterNode {
|
||||
explicit FilterNodeCapture(FilterType aType)
|
||||
: mType{aType}, mInputsChanged{true} {}
|
||||
|
||||
virtual FilterBackend GetBackendType() override {
|
||||
return FILTER_BACKEND_CAPTURE;
|
||||
}
|
||||
FilterBackend GetBackendType() override { return FILTER_BACKEND_CAPTURE; }
|
||||
|
||||
RefPtr<FilterNode> Validate(DrawTarget *aDT);
|
||||
|
||||
@@ -38,11 +36,11 @@ class FilterNodeCapture final : public FilterNode {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
|
||||
void SetInput(uint32_t aIndex, SourceSurface *aSurface) override {
|
||||
mInputsChanged = true;
|
||||
Replace(aIndex, RefPtr<SourceSurface>(aSurface), mInputs);
|
||||
}
|
||||
virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
|
||||
void SetInput(uint32_t aIndex, FilterNode *aFilter) override {
|
||||
mInputsChanged = true;
|
||||
Replace(aIndex, RefPtr<FilterNode>(aFilter), mInputs);
|
||||
}
|
||||
@@ -51,45 +49,45 @@ class FilterNodeCapture final : public FilterNode {
|
||||
Variant<uint32_t, Float, Point, Matrix5x4, Point3D, Size, IntSize, Color,
|
||||
Rect, IntRect, bool, std::vector<Float>, IntPoint, Matrix>;
|
||||
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, Float aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Point &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const Point &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Matrix5x4 &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const Matrix5x4 &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Point3D &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const Point3D &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Size &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const Size &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntSize &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const IntSize &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Color &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const Color &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Rect &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const Rect &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntRect &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const IntRect &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, bool aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, bool aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Float *aValues,
|
||||
uint32_t aSize) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
virtual void SetAttribute(uint32_t aIndex, const Matrix &aValue) override {
|
||||
void SetAttribute(uint32_t aIndex, const Matrix &aValue) override {
|
||||
Replace(aIndex, aValue, mAttributes);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,14 +81,14 @@ class FilterNodeConvolveD2D1 : public FilterNodeD2D1 {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveD2D1, override)
|
||||
explicit FilterNodeConvolveD2D1(ID2D1DeviceContext *aDC);
|
||||
|
||||
virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
|
||||
void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
|
||||
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntSize &aValue) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntRect &aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntSize &aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntPoint &aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntRect &aValue) override;
|
||||
|
||||
virtual ID2D1Effect *InputEffect() override;
|
||||
ID2D1Effect *InputEffect() override;
|
||||
|
||||
private:
|
||||
using FilterNode::SetAttribute;
|
||||
@@ -109,10 +109,10 @@ class FilterNodeConvolveD2D1 : public FilterNodeD2D1 {
|
||||
class FilterNodeOpacityD2D1 : public FilterNodeD2D1 {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeOpacityD2D1, override)
|
||||
explicit FilterNodeOpacityD2D1(ID2D1Effect *aEffect, FilterType aType)
|
||||
FilterNodeOpacityD2D1(ID2D1Effect *aEffect, FilterType aType)
|
||||
: FilterNodeD2D1(aEffect, aType) {}
|
||||
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
};
|
||||
|
||||
class FilterNodeExtendInputAdapterD2D1 : public FilterNodeD2D1 {
|
||||
@@ -123,10 +123,8 @@ class FilterNodeExtendInputAdapterD2D1 : public FilterNodeD2D1 {
|
||||
FilterNodeD2D1 *aFilterNode,
|
||||
FilterType aType);
|
||||
|
||||
virtual ID2D1Effect *InputEffect() override {
|
||||
return mExtendInputEffect.get();
|
||||
}
|
||||
virtual ID2D1Effect *OutputEffect() override {
|
||||
ID2D1Effect *InputEffect() override { return mExtendInputEffect.get(); }
|
||||
ID2D1Effect *OutputEffect() override {
|
||||
return mWrappedFilterNode->OutputEffect();
|
||||
}
|
||||
|
||||
@@ -143,10 +141,8 @@ class FilterNodePremultiplyAdapterD2D1 : public FilterNodeD2D1 {
|
||||
FilterNodeD2D1 *aFilterNode,
|
||||
FilterType aType);
|
||||
|
||||
virtual ID2D1Effect *InputEffect() override {
|
||||
return mPrePremultiplyEffect.get();
|
||||
}
|
||||
virtual ID2D1Effect *OutputEffect() override {
|
||||
ID2D1Effect *InputEffect() override { return mPrePremultiplyEffect.get(); }
|
||||
ID2D1Effect *OutputEffect() override {
|
||||
return mPostUnpremultiplyEffect.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,20 +49,17 @@ class FilterNodeSoftware : public FilterNode,
|
||||
void Draw(DrawTarget *aDrawTarget, const Rect &aSourceRect,
|
||||
const Point &aDestPoint, const DrawOptions &aOptions);
|
||||
|
||||
virtual FilterBackend GetBackendType() override {
|
||||
return FILTER_BACKEND_SOFTWARE;
|
||||
}
|
||||
virtual void SetInput(uint32_t aIndex, SourceSurface *aSurface) override;
|
||||
virtual void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
|
||||
FilterBackend GetBackendType() override { return FILTER_BACKEND_SOFTWARE; }
|
||||
void SetInput(uint32_t aIndex, SourceSurface *aSurface) override;
|
||||
void SetInput(uint32_t aIndex, FilterNode *aFilter) override;
|
||||
|
||||
virtual const char *GetName() { return "Unknown"; }
|
||||
|
||||
virtual void AddInvalidationListener(FilterInvalidationListener *aListener);
|
||||
virtual void RemoveInvalidationListener(
|
||||
FilterInvalidationListener *aListener);
|
||||
void AddInvalidationListener(FilterInvalidationListener *aListener);
|
||||
void RemoveInvalidationListener(FilterInvalidationListener *aListener);
|
||||
|
||||
// FilterInvalidationListener implementation
|
||||
virtual void FilterInvalidated(FilterNodeSoftware *aFilter) override;
|
||||
void FilterInvalidated(FilterNodeSoftware *aFilter) override;
|
||||
|
||||
protected:
|
||||
// The following methods are intended to be overriden by subclasses.
|
||||
@@ -231,19 +228,18 @@ class FilterNodeTransformSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTransformSoftware, override)
|
||||
FilterNodeTransformSoftware();
|
||||
virtual const char *GetName() override { return "Transform"; }
|
||||
const char *GetName() override { return "Transform"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aGraphicsFilter) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Matrix &aMatrix) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aGraphicsFilter) override;
|
||||
void SetAttribute(uint32_t aIndex, const Matrix &aMatrix) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
IntRect SourceRectForOutputRect(const IntRect &aRect);
|
||||
|
||||
private:
|
||||
@@ -255,18 +251,17 @@ class FilterNodeBlendSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlendSoftware, override)
|
||||
FilterNodeBlendSoftware();
|
||||
virtual const char *GetName() override { return "Blend"; }
|
||||
const char *GetName() override { return "Blend"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aBlendMode) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aBlendMode) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
BlendMode mBlendMode;
|
||||
@@ -277,17 +272,16 @@ class FilterNodeMorphologySoftware : public FilterNodeSoftware {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeMorphologySoftware,
|
||||
override)
|
||||
FilterNodeMorphologySoftware();
|
||||
virtual const char *GetName() override { return "Morphology"; }
|
||||
const char *GetName() override { return "Morphology"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntSize &aRadii) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntSize &aRadii) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
IntSize mRadii;
|
||||
@@ -298,18 +292,17 @@ class FilterNodeColorMatrixSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeColorMatrixSoftware,
|
||||
override)
|
||||
virtual const char *GetName() override { return "ColorMatrix"; }
|
||||
const char *GetName() override { return "ColorMatrix"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Matrix5x4 &aMatrix) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aAlphaMode) override;
|
||||
void SetAttribute(uint32_t aIndex, const Matrix5x4 &aMatrix) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aAlphaMode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
private:
|
||||
@@ -320,18 +313,16 @@ class FilterNodeColorMatrixSoftware : public FilterNodeSoftware {
|
||||
class FilterNodeFloodSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeFloodSoftware, override)
|
||||
virtual const char *GetName() override { return "Flood"; }
|
||||
const char *GetName() override { return "Flood"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Color &aColor) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, const Color &aColor) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> GetOutput(
|
||||
const IntRect &aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> GetOutput(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
Color mColor;
|
||||
@@ -340,17 +331,15 @@ class FilterNodeFloodSoftware : public FilterNodeSoftware {
|
||||
class FilterNodeTileSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTileSoftware, override)
|
||||
virtual const char *GetName() override { return "Tile"; }
|
||||
const char *GetName() override { return "Tile"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex,
|
||||
const IntRect &aSourceRect) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
IntRect mSourceRect;
|
||||
@@ -366,16 +355,15 @@ class FilterNodeComponentTransferSoftware : public FilterNodeSoftware {
|
||||
FilterNodeComponentTransferSoftware();
|
||||
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, bool aDisable) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, bool aDisable) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
virtual void GenerateLookupTable(ptrdiff_t aComponent,
|
||||
uint8_t aTables[4][256], bool aDisabled);
|
||||
virtual void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) = 0;
|
||||
@@ -391,14 +379,13 @@ class FilterNodeTableTransferSoftware
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTableTransferSoftware,
|
||||
override)
|
||||
virtual const char *GetName() override { return "TableTransfer"; }
|
||||
const char *GetName() override { return "TableTransfer"; }
|
||||
using FilterNodeComponentTransferSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
uint32_t aSize) override;
|
||||
|
||||
protected:
|
||||
virtual void FillLookupTable(ptrdiff_t aComponent,
|
||||
uint8_t aTable[256]) override;
|
||||
void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
|
||||
|
||||
private:
|
||||
void FillLookupTableImpl(std::vector<Float> &aTableValues,
|
||||
@@ -415,14 +402,13 @@ class FilterNodeDiscreteTransferSoftware
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDiscreteTransferSoftware,
|
||||
override)
|
||||
virtual const char *GetName() override { return "DiscreteTransfer"; }
|
||||
const char *GetName() override { return "DiscreteTransfer"; }
|
||||
using FilterNodeComponentTransferSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
uint32_t aSize) override;
|
||||
|
||||
protected:
|
||||
virtual void FillLookupTable(ptrdiff_t aComponent,
|
||||
uint8_t aTable[256]) override;
|
||||
void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
|
||||
|
||||
private:
|
||||
void FillLookupTableImpl(std::vector<Float> &aTableValues,
|
||||
@@ -440,13 +426,12 @@ class FilterNodeLinearTransferSoftware
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeLinearTransformSoftware,
|
||||
override)
|
||||
FilterNodeLinearTransferSoftware();
|
||||
virtual const char *GetName() override { return "LinearTransfer"; }
|
||||
const char *GetName() override { return "LinearTransfer"; }
|
||||
using FilterNodeComponentTransferSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
|
||||
protected:
|
||||
virtual void FillLookupTable(ptrdiff_t aComponent,
|
||||
uint8_t aTable[256]) override;
|
||||
void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
|
||||
|
||||
private:
|
||||
void FillLookupTableImpl(Float aSlope, Float aIntercept, uint8_t aTable[256]);
|
||||
@@ -467,13 +452,12 @@ class FilterNodeGammaTransferSoftware
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGammaTransferSoftware,
|
||||
override)
|
||||
FilterNodeGammaTransferSoftware();
|
||||
virtual const char *GetName() override { return "GammaTransfer"; }
|
||||
const char *GetName() override { return "GammaTransfer"; }
|
||||
using FilterNodeComponentTransferSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
|
||||
protected:
|
||||
virtual void FillLookupTable(ptrdiff_t aComponent,
|
||||
uint8_t aTable[256]) override;
|
||||
void FillLookupTable(ptrdiff_t aComponent, uint8_t aTable[256]) override;
|
||||
|
||||
private:
|
||||
void FillLookupTableImpl(Float aAmplitude, Float aExponent, Float aOffset,
|
||||
@@ -498,29 +482,25 @@ class FilterNodeConvolveMatrixSoftware : public FilterNodeSoftware {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeConvolveMatrixSoftware,
|
||||
override)
|
||||
FilterNodeConvolveMatrixSoftware();
|
||||
virtual const char *GetName() override { return "ConvolveMatrix"; }
|
||||
const char *GetName() override { return "ConvolveMatrix"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex,
|
||||
const IntSize &aKernelSize) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Float *aMatrix,
|
||||
void SetAttribute(uint32_t aIndex, const IntSize &aKernelSize) override;
|
||||
void SetAttribute(uint32_t aIndex, const Float *aMatrix,
|
||||
uint32_t aSize) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
virtual void SetAttribute(uint32_t aIndex,
|
||||
const Size &aKernelUnitLength) override;
|
||||
virtual void SetAttribute(uint32_t aIndex,
|
||||
const IntRect &aSourceRect) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const IntPoint &aTarget) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aEdgeMode) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, bool aPreserveAlpha) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
void SetAttribute(uint32_t aIndex, const Size &aKernelUnitLength) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntPoint &aTarget) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aEdgeMode) override;
|
||||
void SetAttribute(uint32_t aIndex, bool aPreserveAlpha) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
template <typename CoordType>
|
||||
@@ -547,19 +527,18 @@ class FilterNodeDisplacementMapSoftware : public FilterNodeSoftware {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDisplacementMapSoftware,
|
||||
override)
|
||||
FilterNodeDisplacementMapSoftware();
|
||||
virtual const char *GetName() override { return "DisplacementMap"; }
|
||||
const char *GetName() override { return "DisplacementMap"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aScale) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, Float aScale) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
IntRect InflatedSourceOrDestRect(const IntRect &aDestOrSourceRect);
|
||||
@@ -574,21 +553,19 @@ class FilterNodeTurbulenceSoftware : public FilterNodeSoftware {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeTurbulenceSoftware,
|
||||
override)
|
||||
FilterNodeTurbulenceSoftware();
|
||||
virtual const char *GetName() override { return "Turbulence"; }
|
||||
const char *GetName() override { return "Turbulence"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Size &aSize) override;
|
||||
virtual void SetAttribute(uint32_t aIndex,
|
||||
const IntRect &aRenderRect) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, bool aStitchable) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, const Size &aSize) override;
|
||||
void SetAttribute(uint32_t aIndex, const IntRect &aRenderRect) override;
|
||||
void SetAttribute(uint32_t aIndex, bool aStitchable) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aValue) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
|
||||
private:
|
||||
IntRect mRenderRect;
|
||||
@@ -604,19 +581,18 @@ class FilterNodeArithmeticCombineSoftware : public FilterNodeSoftware {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeArithmeticCombineSoftware,
|
||||
override)
|
||||
FilterNodeArithmeticCombineSoftware();
|
||||
virtual const char *GetName() override { return "ArithmeticCombine"; }
|
||||
const char *GetName() override { return "ArithmeticCombine"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
void SetAttribute(uint32_t aIndex, const Float *aFloat,
|
||||
uint32_t aSize) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
Float mK1;
|
||||
@@ -629,17 +605,16 @@ class FilterNodeCompositeSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCompositeSoftware, override)
|
||||
FilterNodeCompositeSoftware();
|
||||
virtual const char *GetName() override { return "Composite"; }
|
||||
const char *GetName() override { return "Composite"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aOperator) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
private:
|
||||
@@ -652,13 +627,12 @@ class FilterNodeBlurXYSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlurXYSoftware, override)
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
IntRect InflatedSourceOrDestRect(const IntRect &aDestRect);
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
// Implemented by subclasses.
|
||||
@@ -670,12 +644,12 @@ class FilterNodeGaussianBlurSoftware : public FilterNodeBlurXYSoftware {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeGaussianBlurSoftware,
|
||||
override)
|
||||
FilterNodeGaussianBlurSoftware();
|
||||
virtual const char *GetName() override { return "GaussianBlur"; }
|
||||
const char *GetName() override { return "GaussianBlur"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
|
||||
void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
|
||||
|
||||
protected:
|
||||
virtual Size StdDeviationXY() override;
|
||||
Size StdDeviationXY() override;
|
||||
|
||||
private:
|
||||
Float mStdDeviation;
|
||||
@@ -686,13 +660,13 @@ class FilterNodeDirectionalBlurSoftware : public FilterNodeBlurXYSoftware {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeDirectionalBlurSoftware,
|
||||
override)
|
||||
FilterNodeDirectionalBlurSoftware();
|
||||
virtual const char *GetName() override { return "DirectionalBlur"; }
|
||||
const char *GetName() override { return "DirectionalBlur"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, uint32_t aBlurDirection) override;
|
||||
void SetAttribute(uint32_t aIndex, Float aStdDeviation) override;
|
||||
void SetAttribute(uint32_t aIndex, uint32_t aBlurDirection) override;
|
||||
|
||||
protected:
|
||||
virtual Size StdDeviationXY() override;
|
||||
Size StdDeviationXY() override;
|
||||
|
||||
private:
|
||||
Float mStdDeviation;
|
||||
@@ -702,17 +676,16 @@ class FilterNodeDirectionalBlurSoftware : public FilterNodeBlurXYSoftware {
|
||||
class FilterNodeCropSoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeCropSoftware, override)
|
||||
virtual const char *GetName() override { return "Crop"; }
|
||||
const char *GetName() override { return "Crop"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Rect &aSourceRect) override;
|
||||
void SetAttribute(uint32_t aIndex, const Rect &aSourceRect) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
private:
|
||||
@@ -723,15 +696,14 @@ class FilterNodePremultiplySoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodePremultiplySoftware,
|
||||
override)
|
||||
virtual const char *GetName() override { return "Premultiply"; }
|
||||
const char *GetName() override { return "Premultiply"; }
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
};
|
||||
|
||||
@@ -739,33 +711,31 @@ class FilterNodeUnpremultiplySoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeUnpremultiplySoftware,
|
||||
override)
|
||||
virtual const char *GetName() override { return "Unpremultiply"; }
|
||||
const char *GetName() override { return "Unpremultiply"; }
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
};
|
||||
|
||||
class FilterNodeOpacitySoftware : public FilterNodeSoftware {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeOpacitySoftware, override)
|
||||
virtual const char *GetName() override { return "Opacity"; }
|
||||
const char *GetName() override { return "Opacity"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, Float aValue) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
Float mValue = 1.0f;
|
||||
};
|
||||
@@ -776,25 +746,24 @@ class FilterNodeLightingSoftware : public FilterNodeSoftware {
|
||||
#if defined(MOZILLA_INTERNAL_API) && \
|
||||
(defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
|
||||
// Helpers for refcounted
|
||||
virtual const char *typeName() const override { return mTypeName; }
|
||||
virtual size_t typeSize() const override { return sizeof(*this); }
|
||||
const char *typeName() const override { return mTypeName; }
|
||||
size_t typeSize() const override { return sizeof(*this); }
|
||||
#endif
|
||||
explicit FilterNodeLightingSoftware(const char *aTypeName);
|
||||
virtual const char *GetName() override { return "Lighting"; }
|
||||
const char *GetName() override { return "Lighting"; }
|
||||
using FilterNodeSoftware::SetAttribute;
|
||||
virtual void SetAttribute(uint32_t aIndex, Float) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Size &) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Point3D &) override;
|
||||
virtual void SetAttribute(uint32_t aIndex, const Color &) override;
|
||||
virtual IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
void SetAttribute(uint32_t aIndex, Float) override;
|
||||
void SetAttribute(uint32_t aIndex, const Size &) override;
|
||||
void SetAttribute(uint32_t aIndex, const Point3D &) override;
|
||||
void SetAttribute(uint32_t aIndex, const Color &) override;
|
||||
IntRect MapRectToSource(const IntRect &aRect, const IntRect &aMax,
|
||||
FilterNode *aSourceNode) override;
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<DataSourceSurface> Render(
|
||||
const IntRect &aRect) override;
|
||||
virtual IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
virtual int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
virtual void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
already_AddRefed<DataSourceSurface> Render(const IntRect &aRect) override;
|
||||
IntRect GetOutputRectInRect(const IntRect &aRect) override;
|
||||
int32_t InputIndex(uint32_t aInputEnumIndex) override;
|
||||
void RequestFromInputsForRect(const IntRect &aRect) override;
|
||||
|
||||
private:
|
||||
template <typename CoordType>
|
||||
|
||||
@@ -370,7 +370,7 @@ enum OpacityInputs { IN_OPACITY_IN = 0 };
|
||||
class FilterNode : public external::AtomicRefCounted<FilterNode> {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNode)
|
||||
virtual ~FilterNode() {}
|
||||
virtual ~FilterNode() = default;
|
||||
|
||||
virtual FilterBackend GetBackendType() = 0;
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
class AutoRestoreTransform {
|
||||
class AutoRestoreTransform final {
|
||||
public:
|
||||
AutoRestoreTransform() {}
|
||||
AutoRestoreTransform() = default;
|
||||
|
||||
explicit AutoRestoreTransform(DrawTarget *aTarget)
|
||||
: mDrawTarget(aTarget), mOldTransform(aTarget->GetTransform()) {}
|
||||
@@ -38,7 +38,7 @@ class AutoRestoreTransform {
|
||||
Matrix mOldTransform;
|
||||
};
|
||||
|
||||
class AutoPopClips {
|
||||
class AutoPopClips final {
|
||||
public:
|
||||
explicit AutoPopClips(DrawTarget *aTarget)
|
||||
: mDrawTarget(aTarget), mPushCount(0) {
|
||||
|
||||
@@ -867,7 +867,7 @@ class DCCommandSink : public ID2D1CommandSink {
|
||||
ID2D1DeviceContext *mCtx;
|
||||
};
|
||||
|
||||
class MOZ_STACK_CLASS AutoRestoreFP {
|
||||
class MOZ_STACK_CLASS AutoRestoreFP final {
|
||||
public:
|
||||
AutoRestoreFP() {
|
||||
// save the current floating point control word
|
||||
|
||||
@@ -142,7 +142,7 @@ class SetEventJob : public Job {
|
||||
SyncObject* aCompletion = nullptr,
|
||||
WorkerThread* aPinToWorker = nullptr);
|
||||
|
||||
~SetEventJob();
|
||||
virtual ~SetEventJob();
|
||||
|
||||
JobStatus Run() override;
|
||||
|
||||
@@ -179,7 +179,7 @@ class SyncObject final : public external::AtomicRefCounted<SyncObject> {
|
||||
/// using muteces.
|
||||
explicit SyncObject(uint32_t aNumPrerequisites = 1);
|
||||
|
||||
~SyncObject();
|
||||
virtual ~SyncObject();
|
||||
|
||||
/// Attempt to register a task.
|
||||
///
|
||||
@@ -237,7 +237,7 @@ class WorkerThread {
|
||||
public:
|
||||
static WorkerThread* Create(MultiThreadedJobQueue* aJobQueue);
|
||||
|
||||
virtual ~WorkerThread() {}
|
||||
virtual ~WorkerThread() = default;
|
||||
|
||||
void Run();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class WorkerThreadPosix : public WorkerThread {
|
||||
static_cast<WorkerThread*>(this));
|
||||
}
|
||||
|
||||
~WorkerThreadPosix() override { pthread_join(mThread, nullptr); }
|
||||
virtual ~WorkerThreadPosix() { pthread_join(mThread, nullptr); }
|
||||
|
||||
void SetName(const char*) override {
|
||||
// XXX - temporarily disabled, see bug 1209039
|
||||
|
||||
@@ -22,7 +22,7 @@ class WorkerThreadWin32 : public WorkerThread {
|
||||
static_cast<WorkerThread*>(this), 0, nullptr);
|
||||
}
|
||||
|
||||
~WorkerThreadWin32() {
|
||||
virtual ~WorkerThreadWin32() {
|
||||
::WaitForSingleObject(mThread, INFINITE);
|
||||
::CloseHandle(mThread);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ typedef mozilla::Tuple<int32_t, std::string, double> LoggingRecordEntry;
|
||||
typedef std::vector<LoggingRecordEntry> LoggingRecord;
|
||||
class LogForwarder {
|
||||
public:
|
||||
virtual ~LogForwarder() {}
|
||||
virtual ~LogForwarder() = default;
|
||||
virtual void Log(const std::string& aString) = 0;
|
||||
virtual void CrashAction(LogReason aReason) = 0;
|
||||
virtual bool UpdateStringsVector(const std::string& aString) = 0;
|
||||
@@ -257,7 +257,7 @@ void LogWStr(const wchar_t* aStr, std::stringstream& aOut);
|
||||
#endif
|
||||
|
||||
template <int L, typename Logger = BasicLogger>
|
||||
class Log {
|
||||
class Log final {
|
||||
public:
|
||||
// The default is to have the prefix, have the new line, and for critical
|
||||
// logs assert on each call.
|
||||
@@ -931,7 +931,7 @@ class TreeLog {
|
||||
};
|
||||
|
||||
template <int Level = LOG_DEBUG>
|
||||
class TreeAutoIndent {
|
||||
class TreeAutoIndent final {
|
||||
public:
|
||||
explicit TreeAutoIndent(TreeLog<Level>& aTreeLog) : mTreeLog(aTreeLog) {
|
||||
mTreeLog.IncreaseIndent();
|
||||
|
||||
@@ -31,7 +31,7 @@ class NativeFontResourceGDI final : public NativeFontResource {
|
||||
static already_AddRefed<NativeFontResourceGDI> Create(uint8_t* aFontData,
|
||||
uint32_t aDataLength);
|
||||
|
||||
~NativeFontResourceGDI();
|
||||
virtual ~NativeFontResourceGDI();
|
||||
|
||||
already_AddRefed<UnscaledFont> CreateUnscaledFont(
|
||||
uint32_t aIndex, const uint8_t* aInstanceData,
|
||||
|
||||
@@ -22,20 +22,18 @@ class PathBuilderCairo : public PathBuilder {
|
||||
|
||||
explicit PathBuilderCairo(FillRule aFillRule);
|
||||
|
||||
virtual void MoveTo(const Point &aPoint) override;
|
||||
virtual void LineTo(const Point &aPoint) override;
|
||||
virtual void BezierTo(const Point &aCP1, const Point &aCP2,
|
||||
void MoveTo(const Point &aPoint) override;
|
||||
void LineTo(const Point &aPoint) override;
|
||||
void BezierTo(const Point &aCP1, const Point &aCP2,
|
||||
const Point &aCP3) override;
|
||||
virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
|
||||
virtual void Close() override;
|
||||
virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
|
||||
void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
|
||||
void Close() override;
|
||||
void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
|
||||
float aEndAngle, bool aAntiClockwise = false) override;
|
||||
virtual Point CurrentPoint() const override;
|
||||
virtual already_AddRefed<Path> Finish() override;
|
||||
Point CurrentPoint() const override;
|
||||
already_AddRefed<Path> Finish() override;
|
||||
|
||||
virtual BackendType GetBackendType() const override {
|
||||
return BackendType::CAIRO;
|
||||
}
|
||||
BackendType GetBackendType() const override { return BackendType::CAIRO; }
|
||||
|
||||
private: // data
|
||||
friend class PathCairo;
|
||||
@@ -55,33 +53,30 @@ class PathCairo : public Path {
|
||||
PathCairo(FillRule aFillRule, std::vector<cairo_path_data_t> &aPathData,
|
||||
const Point &aCurrentPoint);
|
||||
explicit PathCairo(cairo_t *aContext);
|
||||
~PathCairo();
|
||||
virtual ~PathCairo();
|
||||
|
||||
virtual BackendType GetBackendType() const override {
|
||||
return BackendType::CAIRO;
|
||||
}
|
||||
BackendType GetBackendType() const override { return BackendType::CAIRO; }
|
||||
|
||||
virtual already_AddRefed<PathBuilder> CopyToBuilder(
|
||||
already_AddRefed<PathBuilder> CopyToBuilder(
|
||||
FillRule aFillRule) const override;
|
||||
virtual already_AddRefed<PathBuilder> TransformedCopyToBuilder(
|
||||
already_AddRefed<PathBuilder> TransformedCopyToBuilder(
|
||||
const Matrix &aTransform, FillRule aFillRule) const override;
|
||||
|
||||
virtual bool ContainsPoint(const Point &aPoint,
|
||||
bool ContainsPoint(const Point &aPoint,
|
||||
const Matrix &aTransform) const override;
|
||||
|
||||
virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
|
||||
bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
|
||||
const Point &aPoint,
|
||||
const Matrix &aTransform) const override;
|
||||
|
||||
virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
|
||||
Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
|
||||
|
||||
virtual Rect GetStrokedBounds(
|
||||
const StrokeOptions &aStrokeOptions,
|
||||
Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
|
||||
const Matrix &aTransform = Matrix()) const override;
|
||||
|
||||
virtual void StreamToSink(PathSink *aSink) const override;
|
||||
void StreamToSink(PathSink *aSink) const override;
|
||||
|
||||
virtual FillRule GetFillRule() const override { return mFillRule; }
|
||||
FillRule GetFillRule() const override { return mFillRule; }
|
||||
|
||||
void SetPathOnContext(cairo_t *aContext) const;
|
||||
|
||||
|
||||
@@ -23,22 +23,20 @@ class PathBuilderSkia : public PathBuilder {
|
||||
FillRule aFillRule);
|
||||
explicit PathBuilderSkia(FillRule aFillRule);
|
||||
|
||||
virtual void MoveTo(const Point &aPoint) override;
|
||||
virtual void LineTo(const Point &aPoint) override;
|
||||
virtual void BezierTo(const Point &aCP1, const Point &aCP2,
|
||||
void MoveTo(const Point &aPoint) override;
|
||||
void LineTo(const Point &aPoint) override;
|
||||
void BezierTo(const Point &aCP1, const Point &aCP2,
|
||||
const Point &aCP3) override;
|
||||
virtual void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
|
||||
virtual void Close() override;
|
||||
virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
|
||||
void QuadraticBezierTo(const Point &aCP1, const Point &aCP2) override;
|
||||
void Close() override;
|
||||
void Arc(const Point &aOrigin, float aRadius, float aStartAngle,
|
||||
float aEndAngle, bool aAntiClockwise = false) override;
|
||||
virtual Point CurrentPoint() const override;
|
||||
virtual already_AddRefed<Path> Finish() override;
|
||||
Point CurrentPoint() const override;
|
||||
already_AddRefed<Path> Finish() override;
|
||||
|
||||
void AppendPath(const SkPath &aPath);
|
||||
|
||||
virtual BackendType GetBackendType() const override {
|
||||
return BackendType::SKIA;
|
||||
}
|
||||
BackendType GetBackendType() const override { return BackendType::SKIA; }
|
||||
|
||||
private:
|
||||
void SetFillRule(FillRule aFillRule);
|
||||
@@ -55,31 +53,28 @@ class PathSkia : public Path {
|
||||
mPath.swap(aPath);
|
||||
}
|
||||
|
||||
virtual BackendType GetBackendType() const override {
|
||||
return BackendType::SKIA;
|
||||
}
|
||||
BackendType GetBackendType() const override { return BackendType::SKIA; }
|
||||
|
||||
virtual already_AddRefed<PathBuilder> CopyToBuilder(
|
||||
already_AddRefed<PathBuilder> CopyToBuilder(
|
||||
FillRule aFillRule) const override;
|
||||
virtual already_AddRefed<PathBuilder> TransformedCopyToBuilder(
|
||||
already_AddRefed<PathBuilder> TransformedCopyToBuilder(
|
||||
const Matrix &aTransform, FillRule aFillRule) const override;
|
||||
|
||||
virtual bool ContainsPoint(const Point &aPoint,
|
||||
bool ContainsPoint(const Point &aPoint,
|
||||
const Matrix &aTransform) const override;
|
||||
|
||||
virtual bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
|
||||
bool StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
|
||||
const Point &aPoint,
|
||||
const Matrix &aTransform) const override;
|
||||
|
||||
virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
|
||||
Rect GetBounds(const Matrix &aTransform = Matrix()) const override;
|
||||
|
||||
virtual Rect GetStrokedBounds(
|
||||
const StrokeOptions &aStrokeOptions,
|
||||
Rect GetStrokedBounds(const StrokeOptions &aStrokeOptions,
|
||||
const Matrix &aTransform = Matrix()) const override;
|
||||
|
||||
virtual void StreamToSink(PathSink *aSink) const override;
|
||||
void StreamToSink(PathSink *aSink) const override;
|
||||
|
||||
virtual FillRule GetFillRule() const override { return mFillRule; }
|
||||
FillRule GetFillRule() const override { return mFillRule; }
|
||||
|
||||
const SkPath &GetPath() const { return mPath; }
|
||||
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace gfx {
|
||||
* particularly desirable to avoid the overhead of allocating on the
|
||||
* free-store.
|
||||
*/
|
||||
class GeneralPattern {
|
||||
class GeneralPattern final {
|
||||
public:
|
||||
explicit GeneralPattern() : mPattern(nullptr) {}
|
||||
explicit GeneralPattern() = default;
|
||||
|
||||
GeneralPattern(const GeneralPattern &aOther) : mPattern(nullptr) {}
|
||||
GeneralPattern(const GeneralPattern &aOther) {}
|
||||
|
||||
~GeneralPattern() {
|
||||
if (mPattern) {
|
||||
@@ -115,7 +115,7 @@ class GeneralPattern {
|
||||
AlignedStorage2<RadialGradientPattern> mRadialGradientPattern;
|
||||
AlignedStorage2<SurfacePattern> mSurfacePattern;
|
||||
};
|
||||
Pattern *mPattern;
|
||||
Pattern *mPattern = nullptr;
|
||||
};
|
||||
|
||||
} // namespace gfx
|
||||
|
||||
@@ -157,7 +157,7 @@ class PolygonTyped {
|
||||
typedef Point4DTyped<Units> Point4DType;
|
||||
|
||||
public:
|
||||
PolygonTyped() {}
|
||||
PolygonTyped() = default;
|
||||
|
||||
explicit PolygonTyped(const nsTArray<Point4DType>& aPoints,
|
||||
const Point4DType& aNormal = DefaultNormal())
|
||||
|
||||
@@ -71,7 +71,7 @@ inline std::string StringFromPtr(ReferencePtr aPtr) {
|
||||
|
||||
class Translator {
|
||||
public:
|
||||
virtual ~Translator() {}
|
||||
virtual ~Translator() = default;
|
||||
|
||||
virtual DrawTarget *LookupDrawTarget(ReferencePtr aRefPtr) = 0;
|
||||
virtual Path *LookupPath(ReferencePtr aRefPtr) = 0;
|
||||
@@ -253,7 +253,7 @@ class RecordedEvent {
|
||||
static const uint32_t kTotalEventTypes =
|
||||
RecordedEvent::FILTERNODESETINPUT + 1;
|
||||
|
||||
virtual ~RecordedEvent() {}
|
||||
virtual ~RecordedEvent() = default;
|
||||
|
||||
static std::string GetEventName(EventType aType);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class RecordedEventDerived : public RecordedEvent {
|
||||
template <class Derived>
|
||||
class RecordedDrawingEvent : public RecordedEventDerived<Derived> {
|
||||
public:
|
||||
virtual ReferencePtr GetDestinedDT() override { return mDT; }
|
||||
ReferencePtr GetDestinedDT() override { return mDT; }
|
||||
|
||||
protected:
|
||||
RecordedDrawingEvent(RecordedEvent::EventType aType, DrawTarget *aTarget)
|
||||
@@ -54,7 +54,7 @@ class RecordedDrawingEvent : public RecordedEventDerived<Derived> {
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
|
||||
virtual ReferencePtr GetObjectRef() const override;
|
||||
ReferencePtr GetObjectRef() const override;
|
||||
|
||||
ReferencePtr mDT;
|
||||
};
|
||||
@@ -74,15 +74,15 @@ class RecordedDrawTargetCreation
|
||||
mHasExistingData(aHasExistingData),
|
||||
mExistingData(aExistingData) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "DrawTarget Creation"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "DrawTarget Creation"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
ReferencePtr mRefPtr;
|
||||
BackendType mBackendType;
|
||||
@@ -106,17 +106,14 @@ class RecordedDrawTargetDestruction
|
||||
mRefPtr(aRefPtr),
|
||||
mBackendType(BackendType::NONE) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "DrawTarget Destruction";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "DrawTarget Destruction"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
ReferencePtr mRefPtr;
|
||||
|
||||
@@ -139,17 +136,15 @@ class RecordedCreateSimilarDrawTarget
|
||||
mSize(aSize),
|
||||
mFormat(aFormat) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "CreateSimilarDrawTarget";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "CreateSimilarDrawTarget"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
ReferencePtr mRefPtr;
|
||||
IntSize mSize;
|
||||
@@ -174,17 +169,15 @@ class RecordedCreateClippedDrawTarget
|
||||
mTransform(aTransform),
|
||||
mFormat(aFormat) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "CreateClippedDrawTarget";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "CreateClippedDrawTarget"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
ReferencePtr mRefPtr;
|
||||
IntSize mMaxSize;
|
||||
@@ -216,17 +209,17 @@ class RecordedCreateDrawTargetForFilter
|
||||
mSourceRect(aSourceRect),
|
||||
mDestPoint(aDestPoint) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
std::string GetName() const override {
|
||||
return "CreateSimilarDrawTargetForFilter";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
ReferencePtr mRefPtr;
|
||||
IntSize mMaxSize;
|
||||
@@ -254,14 +247,13 @@ class RecordedFillRect : public RecordedDrawingEvent<RecordedFillRect> {
|
||||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "FillRect"; }
|
||||
std::string GetName() const override { return "FillRect"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -288,14 +280,13 @@ class RecordedStrokeRect : public RecordedDrawingEvent<RecordedStrokeRect> {
|
||||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "StrokeRect"; }
|
||||
std::string GetName() const override { return "StrokeRect"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -324,14 +315,13 @@ class RecordedStrokeLine : public RecordedDrawingEvent<RecordedStrokeLine> {
|
||||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "StrokeLine"; }
|
||||
std::string GetName() const override { return "StrokeLine"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -357,14 +347,13 @@ class RecordedFill : public RecordedDrawingEvent<RecordedFill> {
|
||||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Fill"; }
|
||||
std::string GetName() const override { return "Fill"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -393,14 +382,13 @@ class RecordedFillGlyphs : public RecordedDrawingEvent<RecordedFillGlyphs> {
|
||||
}
|
||||
virtual ~RecordedFillGlyphs();
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "FillGlyphs"; }
|
||||
std::string GetName() const override { return "FillGlyphs"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -427,14 +415,13 @@ class RecordedMask : public RecordedDrawingEvent<RecordedMask> {
|
||||
StorePattern(mMask, aMask);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Mask"; }
|
||||
std::string GetName() const override { return "Mask"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -460,14 +447,14 @@ class RecordedStroke : public RecordedDrawingEvent<RecordedStroke> {
|
||||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Stroke"; }
|
||||
std::string GetName() const override { return "Stroke"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -486,14 +473,13 @@ class RecordedClearRect : public RecordedDrawingEvent<RecordedClearRect> {
|
||||
RecordedClearRect(DrawTarget *aDT, const Rect &aRect)
|
||||
: RecordedDrawingEvent(CLEARRECT, aDT), mRect(aRect) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "ClearRect"; }
|
||||
std::string GetName() const override { return "ClearRect"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -513,14 +499,13 @@ class RecordedCopySurface : public RecordedDrawingEvent<RecordedCopySurface> {
|
||||
mSourceRect(aSourceRect),
|
||||
mDest(aDest) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "CopySurface"; }
|
||||
std::string GetName() const override { return "CopySurface"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -538,14 +523,13 @@ class RecordedPushClip : public RecordedDrawingEvent<RecordedPushClip> {
|
||||
RecordedPushClip(DrawTarget *aDT, ReferencePtr aPath)
|
||||
: RecordedDrawingEvent(PUSHCLIP, aDT), mPath(aPath) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "PushClip"; }
|
||||
std::string GetName() const override { return "PushClip"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -561,14 +545,13 @@ class RecordedPushClipRect : public RecordedDrawingEvent<RecordedPushClipRect> {
|
||||
RecordedPushClipRect(DrawTarget *aDT, const Rect &aRect)
|
||||
: RecordedDrawingEvent(PUSHCLIPRECT, aDT), mRect(aRect) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "PushClipRect"; }
|
||||
std::string GetName() const override { return "PushClipRect"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -584,14 +567,13 @@ class RecordedPopClip : public RecordedDrawingEvent<RecordedPopClip> {
|
||||
MOZ_IMPLICIT RecordedPopClip(DrawTarget *aDT)
|
||||
: RecordedDrawingEvent(POPCLIP, aDT) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "PopClip"; }
|
||||
std::string GetName() const override { return "PopClip"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -613,14 +595,13 @@ class RecordedPushLayer : public RecordedDrawingEvent<RecordedPushLayer> {
|
||||
mBounds(aBounds),
|
||||
mCopyBackground(aCopyBackground) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "PushLayer"; }
|
||||
std::string GetName() const override { return "PushLayer"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -652,14 +633,14 @@ class RecordedPushLayerWithBlend
|
||||
mCopyBackground(aCopyBackground),
|
||||
mCompositionOp(aCompositionOp) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "PushLayerWithBlend"; }
|
||||
std::string GetName() const override { return "PushLayerWithBlend"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -681,14 +662,13 @@ class RecordedPopLayer : public RecordedDrawingEvent<RecordedPopLayer> {
|
||||
MOZ_IMPLICIT RecordedPopLayer(DrawTarget *aDT)
|
||||
: RecordedDrawingEvent(POPLAYER, aDT) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "PopLayer"; }
|
||||
std::string GetName() const override { return "PopLayer"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -702,14 +682,13 @@ class RecordedSetTransform : public RecordedDrawingEvent<RecordedSetTransform> {
|
||||
RecordedSetTransform(DrawTarget *aDT, const Matrix &aTransform)
|
||||
: RecordedDrawingEvent(SETTRANSFORM, aDT), mTransform(aTransform) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "SetTransform"; }
|
||||
std::string GetName() const override { return "SetTransform"; }
|
||||
|
||||
Matrix mTransform;
|
||||
|
||||
@@ -733,14 +712,13 @@ class RecordedDrawSurface : public RecordedDrawingEvent<RecordedDrawSurface> {
|
||||
mDSOptions(aDSOptions),
|
||||
mOptions(aOptions) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "DrawSurface"; }
|
||||
std::string GetName() const override { return "DrawSurface"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -767,16 +745,13 @@ class RecordedDrawDependentSurface
|
||||
mDSOptions(aDSOptions),
|
||||
mOptions(aOptions) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "DrawDependentSurface";
|
||||
}
|
||||
std::string GetName() const override { return "DrawDependentSurface"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -805,16 +780,13 @@ class RecordedDrawSurfaceWithShadow
|
||||
mSigma(aSigma),
|
||||
mOp(aOp) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "DrawSurfaceWithShadow";
|
||||
}
|
||||
std::string GetName() const override { return "DrawSurfaceWithShadow"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -841,14 +813,13 @@ class RecordedDrawFilter : public RecordedDrawingEvent<RecordedDrawFilter> {
|
||||
mDestPoint(aDestPoint),
|
||||
mOptions(aOptions) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "DrawFilter"; }
|
||||
std::string GetName() const override { return "DrawFilter"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -867,15 +838,14 @@ class RecordedPathCreation : public RecordedEventDerived<RecordedPathCreation> {
|
||||
MOZ_IMPLICIT RecordedPathCreation(PathRecording *aPath);
|
||||
~RecordedPathCreation();
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Path Creation"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "Path Creation"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -894,15 +864,14 @@ class RecordedPathDestruction
|
||||
MOZ_IMPLICIT RecordedPathDestruction(PathRecording *aPath)
|
||||
: RecordedEventDerived(PATHDESTRUCTION), mRefPtr(aPath) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Path Destruction"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "Path Destruction"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -929,17 +898,14 @@ class RecordedSourceSurfaceCreation
|
||||
|
||||
~RecordedSourceSurfaceCreation();
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "SourceSurface Creation";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "SourceSurface Creation"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -961,17 +927,14 @@ class RecordedSourceSurfaceDestruction
|
||||
MOZ_IMPLICIT RecordedSourceSurfaceDestruction(ReferencePtr aRefPtr)
|
||||
: RecordedEventDerived(SOURCESURFACEDESTRUCTION), mRefPtr(aRefPtr) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "SourceSurface Destruction";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "SourceSurface Destruction"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1023,15 +986,14 @@ class RecordedFilterNodeCreation
|
||||
|
||||
~RecordedFilterNodeCreation();
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "FilterNode Creation"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "FilterNode Creation"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1049,17 +1011,14 @@ class RecordedFilterNodeDestruction
|
||||
MOZ_IMPLICIT RecordedFilterNodeDestruction(ReferencePtr aRefPtr)
|
||||
: RecordedEventDerived(FILTERNODEDESTRUCTION), mRefPtr(aRefPtr) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "FilterNode Destruction";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "FilterNode Destruction"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1084,17 +1043,14 @@ class RecordedGradientStopsCreation
|
||||
|
||||
~RecordedGradientStopsCreation();
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "GradientStops Creation";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "GradientStops Creation"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1115,17 +1071,14 @@ class RecordedGradientStopsDestruction
|
||||
MOZ_IMPLICIT RecordedGradientStopsDestruction(ReferencePtr aRefPtr)
|
||||
: RecordedEventDerived(GRADIENTSTOPSDESTRUCTION), mRefPtr(aRefPtr) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "GradientStops Destruction";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "GradientStops Destruction"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1141,15 +1094,14 @@ class RecordedSnapshot : public RecordedEventDerived<RecordedSnapshot> {
|
||||
RecordedSnapshot(ReferencePtr aRefPtr, DrawTarget *aDT)
|
||||
: RecordedEventDerived(SNAPSHOT), mRefPtr(aRefPtr), mDT(aDT) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Snapshot"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "Snapshot"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1172,15 +1124,14 @@ class RecordedIntoLuminanceSource
|
||||
mLuminanceType(aLuminanceType),
|
||||
mOpacity(aOpacity) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "IntoLuminanceSource"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "IntoLuminanceSource"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1211,19 +1162,18 @@ class RecordedFontData : public RecordedEventDerived<RecordedFontData> {
|
||||
aUnscaledFont->GetFontFileData(&FontDataProc, this) && mData;
|
||||
}
|
||||
|
||||
~RecordedFontData();
|
||||
virtual ~RecordedFontData();
|
||||
|
||||
bool IsValid() const { return mGetFontFileDataSucceeded; }
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Font Data"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return nullptr; };
|
||||
std::string GetName() const override { return "Font Data"; }
|
||||
ReferencePtr GetObjectRef() const override { return nullptr; };
|
||||
|
||||
void SetFontData(const uint8_t *aData, uint32_t aSize, uint32_t aIndex);
|
||||
|
||||
@@ -1259,19 +1209,18 @@ class RecordedFontDescriptor
|
||||
mHasDesc = aUnscaledFont->GetFontDescriptor(FontDescCb, this);
|
||||
}
|
||||
|
||||
~RecordedFontDescriptor();
|
||||
virtual ~RecordedFontDescriptor();
|
||||
|
||||
bool IsValid() const { return mHasDesc; }
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "Font Desc"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "Font Desc"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1308,17 +1257,14 @@ class RecordedUnscaledFontCreation
|
||||
aUnscaledFont->GetFontInstanceData(FontInstanceDataProc, this);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "UnscaledFont Creation";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "UnscaledFont Creation"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
void SetFontInstanceData(const uint8_t *aData, uint32_t aSize);
|
||||
|
||||
@@ -1340,16 +1286,13 @@ class RecordedUnscaledFontDestruction
|
||||
MOZ_IMPLICIT RecordedUnscaledFontDestruction(ReferencePtr aRefPtr)
|
||||
: RecordedEventDerived(UNSCALEDFONTDESTRUCTION), mRefPtr(aRefPtr) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "UnscaledFont Destruction";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "UnscaledFont Destruction"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1381,15 +1324,14 @@ class RecordedScaledFontCreation
|
||||
aScaledFont->GetFontInstanceData(FontInstanceDataProc, this);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "ScaledFont Creation"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "ScaledFont Creation"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
void SetFontInstanceData(const uint8_t *aData, uint32_t aSize,
|
||||
const FontVariation *aVariations,
|
||||
@@ -1414,17 +1356,14 @@ class RecordedScaledFontDestruction
|
||||
MOZ_IMPLICIT RecordedScaledFontDestruction(ReferencePtr aRefPtr)
|
||||
: RecordedEventDerived(SCALEDFONTDESTRUCTION), mRefPtr(aRefPtr) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override {
|
||||
return "ScaledFont Destruction";
|
||||
}
|
||||
virtual ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
std::string GetName() const override { return "ScaledFont Destruction"; }
|
||||
ReferencePtr GetObjectRef() const override { return mRefPtr; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1448,14 +1387,13 @@ class RecordedMaskSurface : public RecordedDrawingEvent<RecordedMaskSurface> {
|
||||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "MaskSurface"; }
|
||||
std::string GetName() const override { return "MaskSurface"; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1510,14 +1448,13 @@ class RecordedFilterNodeSetAttribute
|
||||
memcpy(&mPayload.front(), aFloat, sizeof(Float) * aSize);
|
||||
}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "SetAttribute"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mNode; }
|
||||
std::string GetName() const override { return "SetAttribute"; }
|
||||
ReferencePtr GetObjectRef() const override { return mNode; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
@@ -1551,14 +1488,13 @@ class RecordedFilterNodeSetInput
|
||||
mInputFilter(nullptr),
|
||||
mInputSurface(aInputSurface) {}
|
||||
|
||||
virtual bool PlayEvent(Translator *aTranslator) const override;
|
||||
bool PlayEvent(Translator *aTranslator) const override;
|
||||
template <class S>
|
||||
void Record(S &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(
|
||||
std::stringstream &aStringStream) const override;
|
||||
void OutputSimpleEventInfo(std::stringstream &aStringStream) const override;
|
||||
|
||||
virtual std::string GetName() const override { return "SetInput"; }
|
||||
virtual ReferencePtr GetObjectRef() const override { return mNode; }
|
||||
std::string GetName() const override { return "SetInput"; }
|
||||
ReferencePtr GetObjectRef() const override { return mNode; }
|
||||
|
||||
private:
|
||||
friend class RecordedEvent;
|
||||
|
||||
@@ -358,16 +358,16 @@ Maybe<Rect> UnionMaybeRects(const Maybe<Rect>& a, const Maybe<Rect>& b) {
|
||||
}
|
||||
}
|
||||
|
||||
struct RectCornerRadii {
|
||||
struct RectCornerRadii final {
|
||||
Size radii[eCornerCount];
|
||||
|
||||
RectCornerRadii() {}
|
||||
RectCornerRadii() = default;
|
||||
|
||||
explicit RectCornerRadii(Float radius) {
|
||||
NS_FOR_CSS_FULL_CORNERS(i) { radii[i].SizeTo(radius, radius); }
|
||||
}
|
||||
|
||||
explicit RectCornerRadii(Float radiusX, Float radiusY) {
|
||||
RectCornerRadii(Float radiusX, Float radiusY) {
|
||||
NS_FOR_CSS_FULL_CORNERS(i) { radii[i].SizeTo(radiusX, radiusY); }
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace gfx {
|
||||
// Simple helper class to automatically release a CFObject when it goes out
|
||||
// of scope.
|
||||
template <class T>
|
||||
class AutoRelease {
|
||||
class AutoRelease final {
|
||||
public:
|
||||
explicit AutoRelease(T aObject) : mObject(aObject) {}
|
||||
|
||||
@@ -230,7 +230,7 @@ static int maxPow2LessThan(int a) {
|
||||
return shift;
|
||||
}
|
||||
|
||||
struct writeBuf {
|
||||
struct writeBuf final {
|
||||
explicit writeBuf(int size) {
|
||||
this->data = new unsigned char[size];
|
||||
this->offset = 0;
|
||||
|
||||
@@ -28,10 +28,10 @@ class SourceSurfaceCairo : public SourceSurface {
|
||||
DrawTargetCairo* aDrawTarget = nullptr);
|
||||
virtual ~SourceSurfaceCairo();
|
||||
|
||||
virtual SurfaceType GetType() const override { return SurfaceType::CAIRO; }
|
||||
virtual IntSize GetSize() const override;
|
||||
virtual SurfaceFormat GetFormat() const override;
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
|
||||
SurfaceType GetType() const override { return SurfaceType::CAIRO; }
|
||||
IntSize GetSize() const override;
|
||||
SurfaceFormat GetFormat() const override;
|
||||
already_AddRefed<DataSourceSurface> GetDataSurface() override;
|
||||
|
||||
cairo_surface_t* GetSurface() const;
|
||||
|
||||
@@ -52,14 +52,12 @@ class DataSourceSurfaceCairo : public DataSourceSurface {
|
||||
|
||||
explicit DataSourceSurfaceCairo(cairo_surface_t* imageSurf);
|
||||
virtual ~DataSourceSurfaceCairo();
|
||||
virtual unsigned char* GetData() override;
|
||||
virtual int32_t Stride() override;
|
||||
unsigned char* GetData() override;
|
||||
int32_t Stride() override;
|
||||
|
||||
virtual SurfaceType GetType() const override {
|
||||
return SurfaceType::CAIRO_IMAGE;
|
||||
}
|
||||
virtual IntSize GetSize() const override;
|
||||
virtual SurfaceFormat GetFormat() const override;
|
||||
SurfaceType GetType() const override { return SurfaceType::CAIRO_IMAGE; }
|
||||
IntSize GetSize() const override;
|
||||
SurfaceFormat GetFormat() const override;
|
||||
|
||||
cairo_surface_t* GetSurface() const;
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ class SourceSurfaceCapture : public SourceSurface {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceCapture, override)
|
||||
|
||||
explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner);
|
||||
explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
|
||||
SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
|
||||
LuminanceType aLuminanceType, float aOpacity);
|
||||
explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
|
||||
SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
|
||||
SourceSurface* aSurfToOptimize);
|
||||
~SourceSurfaceCapture();
|
||||
virtual ~SourceSurfaceCapture();
|
||||
|
||||
SurfaceType GetType() const override { return SurfaceType::CAPTURE; }
|
||||
IntSize GetSize() const override { return mSize; }
|
||||
|
||||
@@ -27,13 +27,11 @@ class SourceSurfaceD2D1 : public SourceSurface {
|
||||
DrawTargetD2D1 *aDT = nullptr);
|
||||
~SourceSurfaceD2D1();
|
||||
|
||||
virtual SurfaceType GetType() const override {
|
||||
return SurfaceType::D2D1_1_IMAGE;
|
||||
}
|
||||
virtual IntSize GetSize() const override { return mSize; }
|
||||
virtual SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
virtual bool IsValid() const override;
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
|
||||
SurfaceType GetType() const override { return SurfaceType::D2D1_1_IMAGE; }
|
||||
IntSize GetSize() const override { return mSize; }
|
||||
SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
bool IsValid() const override;
|
||||
already_AddRefed<DataSourceSurface> GetDataSurface() override;
|
||||
|
||||
ID2D1Image *GetImage() { return mImage; }
|
||||
|
||||
@@ -77,14 +75,14 @@ class DataSourceSurfaceD2D1 : public DataSourceSurface {
|
||||
DataSourceSurfaceD2D1(ID2D1Bitmap1 *aMappableBitmap, SurfaceFormat aFormat);
|
||||
~DataSourceSurfaceD2D1();
|
||||
|
||||
virtual SurfaceType GetType() const override { return SurfaceType::DATA; }
|
||||
virtual IntSize GetSize() const override;
|
||||
virtual SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
virtual bool IsValid() const override { return !!mBitmap; }
|
||||
virtual uint8_t *GetData() override;
|
||||
virtual int32_t Stride() override;
|
||||
virtual bool Map(MapType, MappedSurface *aMappedSurface) override;
|
||||
virtual void Unmap() override;
|
||||
SurfaceType GetType() const override { return SurfaceType::DATA; }
|
||||
IntSize GetSize() const override;
|
||||
SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
bool IsValid() const override { return !!mBitmap; }
|
||||
uint8_t *GetData() override;
|
||||
int32_t Stride() override;
|
||||
bool Map(MapType, MappedSurface *aMappedSurface) override;
|
||||
void Unmap() override;
|
||||
|
||||
private:
|
||||
friend class SourceSurfaceD2DTarget;
|
||||
|
||||
@@ -25,11 +25,11 @@ class SourceSurfaceSkia : public DataSourceSurface {
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurfaceSkia, override)
|
||||
|
||||
SourceSurfaceSkia();
|
||||
~SourceSurfaceSkia();
|
||||
virtual ~SourceSurfaceSkia();
|
||||
|
||||
virtual SurfaceType GetType() const override { return SurfaceType::SKIA; }
|
||||
virtual IntSize GetSize() const override;
|
||||
virtual SurfaceFormat GetFormat() const override;
|
||||
SurfaceType GetType() const override { return SurfaceType::SKIA; }
|
||||
IntSize GetSize() const override;
|
||||
SurfaceFormat GetFormat() const override;
|
||||
|
||||
// This is only ever called by the DT destructor, which can only ever happen
|
||||
// from one place at a time. Therefore it doesn't need to hold the ChangeMutex
|
||||
@@ -49,16 +49,16 @@ class SourceSurfaceSkia : public DataSourceSurface {
|
||||
SurfaceFormat aFormat = SurfaceFormat::UNKNOWN,
|
||||
DrawTargetSkia* aOwner = nullptr);
|
||||
|
||||
virtual uint8_t* GetData() override;
|
||||
uint8_t* GetData() override;
|
||||
|
||||
/**
|
||||
* The caller is responsible for ensuring aMappedSurface is not null.
|
||||
*/
|
||||
virtual bool Map(MapType, MappedSurface* aMappedSurface) override;
|
||||
bool Map(MapType, MappedSurface* aMappedSurface) override;
|
||||
|
||||
virtual void Unmap() override;
|
||||
void Unmap() override;
|
||||
|
||||
virtual int32_t Stride() override { return mStride; }
|
||||
int32_t Stride() override { return mStride; }
|
||||
|
||||
private:
|
||||
friend class DrawTargetSkia;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
template <class T, size_t size>
|
||||
class StackArray {
|
||||
class StackArray final {
|
||||
public:
|
||||
explicit StackArray(size_t count) {
|
||||
if (count > size) {
|
||||
|
||||
@@ -76,7 +76,7 @@ static inline Float Distance(Point aA, Point aB) {
|
||||
}
|
||||
|
||||
template <typename T, int alignment = 16>
|
||||
struct AlignedArray {
|
||||
struct AlignedArray final {
|
||||
typedef T value_type;
|
||||
|
||||
AlignedArray() : mPtr(nullptr), mStorage(nullptr), mCount(0) {}
|
||||
|
||||
@@ -34,7 +34,7 @@ class UnscaledFontFreeType : public UnscaledFont {
|
||||
mOwnsFace(false),
|
||||
mIndex(0),
|
||||
mNativeFontResource(aNativeFontResource) {}
|
||||
~UnscaledFontFreeType() {
|
||||
virtual ~UnscaledFontFreeType() {
|
||||
if (mOwnsFace) {
|
||||
Factory::ReleaseFTFace(mFace);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class UnscaledFontMac final : public UnscaledFont {
|
||||
: mFont(aFont), mIsDataFont(aIsDataFont), mNeedsCairo(aNeedsCairo) {
|
||||
CFRetain(mFont);
|
||||
}
|
||||
~UnscaledFontMac() { CFRelease(mFont); }
|
||||
virtual ~UnscaledFontMac() { CFRelease(mFont); }
|
||||
|
||||
FontType GetType() const override { return FontType::MAC; }
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
|
||||
class AndroidNativeWindow {
|
||||
class AndroidNativeWindow final {
|
||||
public:
|
||||
AndroidNativeWindow() : mNativeWindow(nullptr) {}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ void AndroidSurfaceTexture::GetTransformMatrix(
|
||||
env->ReleaseFloatArrayElements(jarray.Get(), array, 0);
|
||||
}
|
||||
|
||||
class SharedGL {
|
||||
class SharedGL final {
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedGL);
|
||||
|
||||
|
||||
@@ -33,11 +33,9 @@ class GLContextGLX : public GLContext {
|
||||
ScopedXFree<GLXFBConfig>* const out_scopedConfigArr,
|
||||
GLXFBConfig* const out_config, int* const out_visid, bool aWebRender);
|
||||
|
||||
~GLContextGLX() override;
|
||||
virtual ~GLContextGLX();
|
||||
|
||||
virtual GLContextType GetContextType() const override {
|
||||
return GLContextType::GLX;
|
||||
}
|
||||
GLContextType GetContextType() const override { return GLContextType::GLX; }
|
||||
|
||||
static GLContextGLX* Cast(GLContext* gl) {
|
||||
MOZ_ASSERT(gl->GetContextType() == GLContextType::GLX);
|
||||
@@ -46,17 +44,17 @@ class GLContextGLX : public GLContext {
|
||||
|
||||
bool Init() override;
|
||||
|
||||
virtual bool MakeCurrentImpl() const override;
|
||||
bool MakeCurrentImpl() const override;
|
||||
|
||||
virtual bool IsCurrentImpl() const override;
|
||||
bool IsCurrentImpl() const override;
|
||||
|
||||
Maybe<SymbolLoader> GetSymbolLoader() const override;
|
||||
|
||||
virtual bool IsDoubleBuffered() const override;
|
||||
bool IsDoubleBuffered() const override;
|
||||
|
||||
virtual bool SwapBuffers() override;
|
||||
bool SwapBuffers() override;
|
||||
|
||||
virtual void GetWSIInfo(nsCString* const out) const override;
|
||||
void GetWSIInfo(nsCString* const out) const override;
|
||||
|
||||
// Overrides the current GLXDrawable backing the context and makes the
|
||||
// context current.
|
||||
|
||||
@@ -177,16 +177,15 @@ class BasicTextureImage : public TextureImage {
|
||||
GLContext* aContext,
|
||||
TextureImage::Flags aFlags = TextureImage::NoFlags);
|
||||
|
||||
virtual void BindTexture(GLenum aTextureUnit) override;
|
||||
void BindTexture(GLenum aTextureUnit) override;
|
||||
|
||||
virtual bool DirectUpdate(
|
||||
gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
|
||||
bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
|
||||
const gfx::IntPoint& aFrom = gfx::IntPoint(0, 0)) override;
|
||||
virtual GLuint GetTextureID() override { return mTexture; }
|
||||
GLuint GetTextureID() override { return mTexture; }
|
||||
|
||||
virtual void MarkValid() override { mTextureState = Valid; }
|
||||
void MarkValid() override { mTextureState = Valid; }
|
||||
|
||||
virtual void Resize(const gfx::IntSize& aSize) override;
|
||||
void Resize(const gfx::IntSize& aSize) override;
|
||||
|
||||
protected:
|
||||
GLuint mTexture;
|
||||
@@ -205,25 +204,24 @@ class TiledTextureImage final : public TextureImage {
|
||||
GLContext* aGL, gfx::IntSize aSize, TextureImage::ContentType,
|
||||
TextureImage::Flags aFlags = TextureImage::NoFlags,
|
||||
TextureImage::ImageFormat aImageFormat = gfx::SurfaceFormat::UNKNOWN);
|
||||
~TiledTextureImage();
|
||||
virtual ~TiledTextureImage();
|
||||
void DumpDiv();
|
||||
virtual void Resize(const gfx::IntSize& aSize) override;
|
||||
virtual uint32_t GetTileCount() override;
|
||||
virtual void BeginBigImageIteration() override;
|
||||
virtual bool NextTile() override;
|
||||
virtual void SetIterationCallback(BigImageIterationCallback aCallback,
|
||||
void Resize(const gfx::IntSize& aSize) override;
|
||||
uint32_t GetTileCount() override;
|
||||
void BeginBigImageIteration() override;
|
||||
bool NextTile() override;
|
||||
void SetIterationCallback(BigImageIterationCallback aCallback,
|
||||
void* aCallbackData) override;
|
||||
virtual gfx::IntRect GetTileRect() override;
|
||||
virtual GLuint GetTextureID() override {
|
||||
gfx::IntRect GetTileRect() override;
|
||||
GLuint GetTextureID() override {
|
||||
return mImages[mCurrentImage]->GetTextureID();
|
||||
}
|
||||
virtual bool DirectUpdate(
|
||||
gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
|
||||
bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion,
|
||||
const gfx::IntPoint& aFrom = gfx::IntPoint(0, 0)) override;
|
||||
virtual void BindTexture(GLenum) override;
|
||||
void BindTexture(GLenum) override;
|
||||
|
||||
protected:
|
||||
virtual gfx::IntRect GetSrcTileRect() override;
|
||||
gfx::IntRect GetSrcTileRect() override;
|
||||
|
||||
unsigned int mCurrentImage;
|
||||
BigImageIterationCallback mIterationCallback;
|
||||
|
||||
@@ -288,7 +288,7 @@ class SurfaceFactory : public SupportsWeakPtr<SurfaceFactory> {
|
||||
bool Recycle(layers::SharedSurfaceTextureClient* texClient);
|
||||
};
|
||||
|
||||
class ScopedReadbackFB {
|
||||
class ScopedReadbackFB final {
|
||||
GLContext* const mGL;
|
||||
ScopedBindFramebuffer mAutoFB;
|
||||
GLuint mTempFB = 0;
|
||||
|
||||
@@ -49,25 +49,25 @@ class SharedSurface_D3D11Interop : public SharedSurface {
|
||||
HANDLE dxgiHandle);
|
||||
|
||||
public:
|
||||
virtual ~SharedSurface_D3D11Interop() override;
|
||||
virtual ~SharedSurface_D3D11Interop();
|
||||
|
||||
virtual void LockProdImpl() override {}
|
||||
virtual void UnlockProdImpl() override {}
|
||||
void LockProdImpl() override {}
|
||||
void UnlockProdImpl() override {}
|
||||
|
||||
virtual void ProducerAcquireImpl() override;
|
||||
virtual void ProducerReleaseImpl() override;
|
||||
void ProducerAcquireImpl() override;
|
||||
void ProducerReleaseImpl() override;
|
||||
|
||||
virtual GLuint ProdRenderbuffer() override {
|
||||
GLuint ProdRenderbuffer() override {
|
||||
MOZ_ASSERT(!mProdTex);
|
||||
return mInteropRB;
|
||||
}
|
||||
|
||||
virtual GLuint ProdTexture() override {
|
||||
GLuint ProdTexture() override {
|
||||
MOZ_ASSERT(mProdTex);
|
||||
return mProdTex;
|
||||
}
|
||||
|
||||
virtual bool ToSurfaceDescriptor(
|
||||
bool ToSurfaceDescriptor(
|
||||
layers::SurfaceDescriptor* const out_descriptor) override;
|
||||
};
|
||||
|
||||
@@ -86,11 +86,10 @@ class SurfaceFactory_D3D11Interop : public SurfaceFactory {
|
||||
DXInterop2Device* interop);
|
||||
|
||||
public:
|
||||
virtual ~SurfaceFactory_D3D11Interop() override;
|
||||
virtual ~SurfaceFactory_D3D11Interop();
|
||||
|
||||
protected:
|
||||
virtual UniquePtr<SharedSurface> CreateShared(
|
||||
const gfx::IntSize& size) override {
|
||||
UniquePtr<SharedSurface> CreateShared(const gfx::IntSize& size) override {
|
||||
bool hasAlpha = mReadCaps.alpha;
|
||||
return SharedSurface_D3D11Interop::Create(mInterop, mGL, size, hasAlpha);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class CompositorOptions {
|
||||
mUseAdvancedLayers(false),
|
||||
mInitiallyPaused(false) {}
|
||||
|
||||
explicit CompositorOptions(bool aUseAPZ, bool aUseWebRender)
|
||||
CompositorOptions(bool aUseAPZ, bool aUseWebRender)
|
||||
: mUseAPZ(aUseAPZ),
|
||||
mUseWebRender(aUseWebRender),
|
||||
mUseAdvancedLayers(false),
|
||||
|
||||
@@ -30,7 +30,7 @@ class CrossProcessPaint;
|
||||
/**
|
||||
* A fragment of a paint of a cross process document tree.
|
||||
*/
|
||||
class PaintFragment {
|
||||
class PaintFragment final {
|
||||
public:
|
||||
/// Initializes an empty PaintFragment
|
||||
PaintFragment() = default;
|
||||
@@ -74,7 +74,7 @@ class PaintFragment {
|
||||
/**
|
||||
* An object for painting a cross process document tree.
|
||||
*/
|
||||
class CrossProcessPaint {
|
||||
class CrossProcessPaint final {
|
||||
NS_INLINE_DECL_REFCOUNTING(CrossProcessPaint);
|
||||
|
||||
public:
|
||||
|
||||
@@ -28,7 +28,7 @@ class GPUChild final : public PGPUChild, public gfxVarReceiver {
|
||||
|
||||
public:
|
||||
explicit GPUChild(GPUProcessHost* aHost);
|
||||
~GPUChild();
|
||||
virtual ~GPUChild();
|
||||
|
||||
void Init();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace gfx {
|
||||
class GPUProcessImpl final : public ipc::ProcessChild {
|
||||
public:
|
||||
explicit GPUProcessImpl(ProcessId aParentPid);
|
||||
~GPUProcessImpl();
|
||||
virtual ~GPUProcessImpl();
|
||||
|
||||
bool Init(int aArgc, char* aArgv[]) override;
|
||||
void CleanUp() override;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace gfx {
|
||||
|
||||
class GPUProcessListener {
|
||||
public:
|
||||
virtual ~GPUProcessListener() {}
|
||||
virtual ~GPUProcessListener() = default;
|
||||
|
||||
// Called when the compositor has died and the rendering stack must be
|
||||
// recreated.
|
||||
|
||||
@@ -248,7 +248,7 @@ class GPUProcessManager final : public GPUProcessHost::Listener {
|
||||
explicit Observer(GPUProcessManager* aManager);
|
||||
|
||||
protected:
|
||||
~Observer() {}
|
||||
virtual ~Observer() = default;
|
||||
|
||||
GPUProcessManager* mManager;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ class RemoteCompositorSession final : public CompositorSession {
|
||||
CompositorWidgetDelegate* aWidgetDelegate,
|
||||
APZCTreeManagerChild* aAPZ,
|
||||
const LayersId& aRootLayerTreeId);
|
||||
~RemoteCompositorSession() override;
|
||||
virtual ~RemoteCompositorSession();
|
||||
|
||||
CompositorBridgeParent* GetInProcessBridge() const override;
|
||||
void SetContentController(GeckoContentController* aController) override;
|
||||
|
||||
@@ -32,11 +32,11 @@ class VsyncBridgeChild final : public PVsyncBridgeChild {
|
||||
|
||||
void NotifyVsync(const VsyncEvent& aVsync, const layers::LayersId& aLayersId);
|
||||
|
||||
virtual void HandleFatalError(const char* aMsg) const override;
|
||||
void HandleFatalError(const char* aMsg) const override;
|
||||
|
||||
private:
|
||||
VsyncBridgeChild(RefPtr<VsyncIOThreadHolder>, const uint64_t& aProcessToken);
|
||||
~VsyncBridgeChild();
|
||||
virtual ~VsyncBridgeChild();
|
||||
|
||||
void Open(Endpoint<PVsyncBridgeChild>&& aEndpoint);
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ struct AnimationTransform {
|
||||
TransformData mData;
|
||||
};
|
||||
|
||||
struct AnimatedValue {
|
||||
struct AnimatedValue final {
|
||||
enum { TRANSFORM, OPACITY, COLOR, NONE } mType{NONE};
|
||||
|
||||
union {
|
||||
@@ -110,6 +110,9 @@ struct AnimatedValue {
|
||||
explicit AnimatedValue(nscolor aValue)
|
||||
: mType(AnimatedValue::COLOR), mColor(aValue) {}
|
||||
|
||||
// Can't use = default as AnimatedValue contains a union and has a variant
|
||||
// member with non-trivial destructor.
|
||||
// Otherwise a Deleted implicitly-declared destructor error will occur.
|
||||
~AnimatedValue() {}
|
||||
|
||||
private:
|
||||
|
||||
@@ -22,7 +22,7 @@ class AxisPhysicsMSDModel : public AxisPhysicsModel {
|
||||
double aInitialVelocity, double aSpringConstant,
|
||||
double aDampingRatio);
|
||||
|
||||
~AxisPhysicsMSDModel();
|
||||
virtual ~AxisPhysicsMSDModel();
|
||||
|
||||
/**
|
||||
* Gets the raw destination of this axis at this moment.
|
||||
@@ -41,7 +41,7 @@ class AxisPhysicsMSDModel : public AxisPhysicsModel {
|
||||
bool IsFinished(double aSmallestVisibleIncrement);
|
||||
|
||||
protected:
|
||||
virtual double Acceleration(const State &aState) override;
|
||||
double Acceleration(const State &aState) override;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace layers {
|
||||
class AxisPhysicsModel {
|
||||
public:
|
||||
AxisPhysicsModel(double aInitialPosition, double aInitialVelocity);
|
||||
~AxisPhysicsModel();
|
||||
virtual ~AxisPhysicsModel();
|
||||
|
||||
/**
|
||||
* Advance the physics simulation.
|
||||
|
||||
@@ -88,7 +88,7 @@ struct BSPTreeNode {
|
||||
* https://en.wikipedia.org/wiki/Binary_space_partitioning
|
||||
* ftp://ftp.sgi.com/other/bspfaq/faq/bspfaq.html
|
||||
*/
|
||||
class BSPTree {
|
||||
class BSPTree final {
|
||||
public:
|
||||
/**
|
||||
* The constructor modifies layers in the given list.
|
||||
|
||||
@@ -36,22 +36,22 @@ class BufferTextureData : public TextureData {
|
||||
gfx::ColorDepth aColorDepth, gfx::YUVColorSpace aYUVColorSpace,
|
||||
TextureFlags aTextureFlags);
|
||||
|
||||
virtual bool Lock(OpenMode aMode) override { return true; }
|
||||
bool Lock(OpenMode aMode) override { return true; }
|
||||
|
||||
virtual void Unlock() override {}
|
||||
void Unlock() override {}
|
||||
|
||||
virtual void FillInfo(TextureData::Info& aInfo) const override;
|
||||
void FillInfo(TextureData::Info& aInfo) const override;
|
||||
|
||||
virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
|
||||
already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
|
||||
|
||||
virtual bool BorrowMappedData(MappedTextureData& aMap) override;
|
||||
bool BorrowMappedData(MappedTextureData& aMap) override;
|
||||
|
||||
virtual bool BorrowMappedYCbCrData(MappedYCbCrTextureData& aMap) override;
|
||||
bool BorrowMappedYCbCrData(MappedYCbCrTextureData& aMap) override;
|
||||
|
||||
// use TextureClient's default implementation
|
||||
virtual bool UpdateFromSurface(gfx::SourceSurface* aSurface) override;
|
||||
bool UpdateFromSurface(gfx::SourceSurface* aSurface) override;
|
||||
|
||||
virtual BufferTextureData* AsBufferTextureData() override { return this; }
|
||||
BufferTextureData* AsBufferTextureData() override { return this; }
|
||||
|
||||
// Don't use this.
|
||||
void SetDescriptor(BufferDescriptor&& aDesc);
|
||||
|
||||
@@ -30,7 +30,7 @@ class RecordedFrame {
|
||||
TimeStamp GetTimeStamp() { return mTimeStamp; }
|
||||
|
||||
protected:
|
||||
virtual ~RecordedFrame() {}
|
||||
virtual ~RecordedFrame() = default;
|
||||
RecordedFrame(const TimeStamp& aTimeStamp) : mTimeStamp(aTimeStamp) {}
|
||||
|
||||
private:
|
||||
|
||||
@@ -186,7 +186,7 @@ class Compositor : public TextureSourceProvider {
|
||||
CompositorBridgeParent* aParent = nullptr);
|
||||
|
||||
virtual bool Initialize(nsCString* const out_failureReason) = 0;
|
||||
virtual void Destroy() override;
|
||||
void Destroy() override;
|
||||
bool IsDestroyed() const { return mIsDestroyed; }
|
||||
|
||||
virtual void DetachWidget() { mWidget = nullptr; }
|
||||
@@ -471,7 +471,7 @@ class Compositor : public TextureSourceProvider {
|
||||
virtual CompositorD3D11* AsCompositorD3D11() { return nullptr; }
|
||||
virtual BasicCompositor* AsBasicCompositor() { return nullptr; }
|
||||
|
||||
virtual Compositor* AsCompositor() override { return this; }
|
||||
Compositor* AsCompositor() override { return this; }
|
||||
|
||||
TimeStamp GetLastCompositionEndTime() const override {
|
||||
return mLastCompositionEndTime;
|
||||
@@ -518,7 +518,7 @@ class Compositor : public TextureSourceProvider {
|
||||
// A stale Compositor has no CompositorBridgeParent; it will not process
|
||||
// frames and should not be used.
|
||||
void SetInvalid();
|
||||
virtual bool IsValid() const override;
|
||||
bool IsValid() const override;
|
||||
CompositorBridgeParent* GetCompositorBridgeParent() const { return mParent; }
|
||||
|
||||
protected:
|
||||
@@ -636,7 +636,7 @@ class AsyncReadbackBuffer {
|
||||
|
||||
protected:
|
||||
explicit AsyncReadbackBuffer(const gfx::IntSize& aSize) : mSize(aSize) {}
|
||||
virtual ~AsyncReadbackBuffer() {}
|
||||
virtual ~AsyncReadbackBuffer() = default;
|
||||
|
||||
gfx::IntSize mSize;
|
||||
};
|
||||
|
||||
@@ -19,15 +19,14 @@ namespace layers {
|
||||
|
||||
class D3D11RecycleAllocator : public TextureClientRecycleAllocator {
|
||||
public:
|
||||
explicit D3D11RecycleAllocator(KnowsCompositor* aAllocator,
|
||||
ID3D11Device* aDevice)
|
||||
D3D11RecycleAllocator(KnowsCompositor* aAllocator, ID3D11Device* aDevice)
|
||||
: TextureClientRecycleAllocator(aAllocator), mDevice(aDevice) {}
|
||||
|
||||
already_AddRefed<TextureClient> CreateOrRecycleClient(
|
||||
gfx::SurfaceFormat aFormat, const gfx::IntSize& aSize);
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<TextureClient> Allocate(
|
||||
already_AddRefed<TextureClient> Allocate(
|
||||
gfx::SurfaceFormat aFormat, gfx::IntSize aSize, BackendSelector aSelector,
|
||||
TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags) override;
|
||||
|
||||
@@ -46,7 +45,7 @@ class D3D11ShareHandleImage final : public Image {
|
||||
public:
|
||||
D3D11ShareHandleImage(const gfx::IntSize& aSize, const gfx::IntRect& aRect,
|
||||
const GUID& aSourceFormat);
|
||||
virtual ~D3D11ShareHandleImage() {}
|
||||
virtual ~D3D11ShareHandleImage() = default;
|
||||
|
||||
bool AllocateTexture(D3D11RecycleAllocator* aAllocator,
|
||||
ID3D11Device* aDevice);
|
||||
|
||||
@@ -270,7 +270,7 @@ already_AddRefed<SourceSurface> D3D11YCbCrImage::GetAsSourceSurface() {
|
||||
return surface.forget();
|
||||
}
|
||||
|
||||
class AutoCheckLockD3D11Texture {
|
||||
class AutoCheckLockD3D11Texture final {
|
||||
public:
|
||||
explicit AutoCheckLockD3D11Texture(ID3D11Texture2D* aTexture)
|
||||
: mIsLocked(false) {
|
||||
|
||||
@@ -19,15 +19,14 @@ class TextureClient;
|
||||
|
||||
class D3D9RecycleAllocator : public TextureClientRecycleAllocator {
|
||||
public:
|
||||
explicit D3D9RecycleAllocator(KnowsCompositor* aAllocator,
|
||||
IDirect3DDevice9* aDevice)
|
||||
D3D9RecycleAllocator(KnowsCompositor* aAllocator, IDirect3DDevice9* aDevice)
|
||||
: TextureClientRecycleAllocator(aAllocator), mDevice(aDevice) {}
|
||||
|
||||
already_AddRefed<TextureClient> CreateOrRecycleClient(
|
||||
gfx::SurfaceFormat aFormat, const gfx::IntSize& aSize);
|
||||
|
||||
protected:
|
||||
virtual already_AddRefed<TextureClient> Allocate(
|
||||
already_AddRefed<TextureClient> Allocate(
|
||||
gfx::SurfaceFormat aFormat, gfx::IntSize aSize, BackendSelector aSelector,
|
||||
TextureFlags aTextureFlags, TextureAllocationFlags aAllocFlags) override;
|
||||
|
||||
@@ -46,17 +45,17 @@ class DXGID3D9TextureData : public TextureData {
|
||||
TextureFlags aFlags,
|
||||
IDirect3DDevice9* aDevice);
|
||||
|
||||
~DXGID3D9TextureData();
|
||||
virtual ~DXGID3D9TextureData();
|
||||
|
||||
virtual void FillInfo(TextureData::Info& aInfo) const override;
|
||||
void FillInfo(TextureData::Info& aInfo) const override;
|
||||
|
||||
virtual bool Lock(OpenMode) override { return true; }
|
||||
bool Lock(OpenMode) override { return true; }
|
||||
|
||||
virtual void Unlock() override {}
|
||||
void Unlock() override {}
|
||||
|
||||
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
||||
|
||||
virtual void Deallocate(LayersIPCChannel* aAllocator) override {}
|
||||
void Deallocate(LayersIPCChannel* aAllocator) override {}
|
||||
|
||||
IDirect3DDevice9* GetD3D9Device() { return mDevice; }
|
||||
IDirect3DTexture9* GetD3D9Texture() { return mTexture; }
|
||||
|
||||
@@ -53,7 +53,7 @@ struct Effect {
|
||||
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~Effect() {}
|
||||
virtual ~Effect() = default;
|
||||
};
|
||||
|
||||
// Render from a texture
|
||||
@@ -66,10 +66,9 @@ struct TexturedEffect : public Effect {
|
||||
mPremultiplied(aPremultiplied),
|
||||
mSamplingFilter(aSamplingFilter) {}
|
||||
|
||||
virtual TexturedEffect* AsTexturedEffect() override { return this; }
|
||||
TexturedEffect* AsTexturedEffect() override { return this; }
|
||||
virtual const char* Name() = 0;
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
gfx::Rect mTextureCoords;
|
||||
TextureSource* mTexture;
|
||||
@@ -86,8 +85,7 @@ struct EffectMask : public Effect {
|
||||
mSize(aSize),
|
||||
mMaskTransform(aMaskTransform) {}
|
||||
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
TextureSource* mMaskTexture;
|
||||
gfx::IntSize mSize;
|
||||
@@ -99,8 +97,7 @@ struct EffectBlendMode : public Effect {
|
||||
: Effect(EffectTypes::BLEND_MODE), mBlendMode(aBlendMode) {}
|
||||
|
||||
virtual const char* Name() { return "EffectBlendMode"; }
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
gfx::CompositionOp mBlendMode;
|
||||
};
|
||||
@@ -112,9 +109,8 @@ struct EffectRenderTarget : public TexturedEffect {
|
||||
gfx::SamplingFilter::LINEAR),
|
||||
mRenderTarget(aRenderTarget) {}
|
||||
|
||||
virtual const char* Name() override { return "EffectRenderTarget"; }
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
const char* Name() override { return "EffectRenderTarget"; }
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
RefPtr<CompositingRenderTarget> mRenderTarget;
|
||||
|
||||
@@ -129,9 +125,7 @@ struct EffectColorMatrix : public Effect {
|
||||
explicit EffectColorMatrix(gfx::Matrix5x4 aMatrix)
|
||||
: Effect(EffectTypes::COLOR_MATRIX), mColorMatrix(aMatrix) {}
|
||||
|
||||
virtual const char* Name() { return "EffectColorMatrix"; }
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
const gfx::Matrix5x4 mColorMatrix;
|
||||
};
|
||||
|
||||
@@ -141,7 +135,7 @@ struct EffectRGB : public TexturedEffect {
|
||||
: TexturedEffect(EffectTypes::RGB, aTexture, aPremultiplied,
|
||||
aSamplingFilter) {}
|
||||
|
||||
virtual const char* Name() override { return "EffectRGB"; }
|
||||
const char* Name() override { return "EffectRGB"; }
|
||||
};
|
||||
|
||||
struct EffectYCbCr : public TexturedEffect {
|
||||
@@ -151,7 +145,7 @@ struct EffectYCbCr : public TexturedEffect {
|
||||
mYUVColorSpace(aYUVColorSpace),
|
||||
mColorDepth(aColorDepth) {}
|
||||
|
||||
virtual const char* Name() override { return "EffectYCbCr"; }
|
||||
const char* Name() override { return "EffectYCbCr"; }
|
||||
|
||||
gfx::YUVColorSpace mYUVColorSpace;
|
||||
gfx::ColorDepth mColorDepth;
|
||||
@@ -164,7 +158,7 @@ struct EffectNV12 : public EffectYCbCr {
|
||||
mType = EffectTypes::NV12;
|
||||
}
|
||||
|
||||
virtual const char* Name() override { return "EffectNV12"; }
|
||||
const char* Name() override { return "EffectNV12"; }
|
||||
};
|
||||
|
||||
struct EffectComponentAlpha : public TexturedEffect {
|
||||
@@ -175,7 +169,7 @@ struct EffectComponentAlpha : public TexturedEffect {
|
||||
mOnBlack(aOnBlack),
|
||||
mOnWhite(aOnWhite) {}
|
||||
|
||||
virtual const char* Name() override { return "EffectComponentAlpha"; }
|
||||
const char* Name() override { return "EffectComponentAlpha"; }
|
||||
|
||||
TextureSource* mOnBlack;
|
||||
TextureSource* mOnWhite;
|
||||
@@ -185,8 +179,7 @@ struct EffectSolidColor : public Effect {
|
||||
explicit EffectSolidColor(const gfx::Color& aColor)
|
||||
: Effect(EffectTypes::SOLID_COLOR), mColor(aColor) {}
|
||||
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
gfx::Color mColor;
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ class GPUVideoImage final : public Image {
|
||||
ImageBridgeChild::GetSingleton().get());
|
||||
}
|
||||
|
||||
virtual ~GPUVideoImage() {}
|
||||
virtual ~GPUVideoImage() = default;
|
||||
|
||||
gfx::IntSize GetSize() const override { return mSize; }
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class ParentActor : public Protocol {
|
||||
|
||||
typedef ipc::IProtocol::ActorDestroyReason Why;
|
||||
|
||||
virtual void ActorDestroy(Why) override { DestroyIfNeeded(); }
|
||||
void ActorDestroy(Why) override { DestroyIfNeeded(); }
|
||||
|
||||
protected:
|
||||
void DestroyIfNeeded() {
|
||||
|
||||
@@ -161,7 +161,7 @@ class D3D11YCbCrRecycleAllocator;
|
||||
class SurfaceDescriptorBuffer;
|
||||
|
||||
struct ImageBackendData {
|
||||
virtual ~ImageBackendData() {}
|
||||
virtual ~ImageBackendData() = default;
|
||||
|
||||
protected:
|
||||
ImageBackendData() {}
|
||||
@@ -244,7 +244,7 @@ class Image {
|
||||
: mImplData(aImplData), mSerial(++sSerialCounter), mFormat(aFormat) {}
|
||||
|
||||
// Protected destructor, to discourage deletion outside of Release():
|
||||
virtual ~Image() {}
|
||||
virtual ~Image() = default;
|
||||
|
||||
mozilla::EnumeratedArray<mozilla::layers::LayersBackend,
|
||||
mozilla::layers::LayersBackend::LAYERS_LAST,
|
||||
@@ -317,7 +317,7 @@ class ImageFactory {
|
||||
friend class ImageContainer;
|
||||
|
||||
ImageFactory() {}
|
||||
virtual ~ImageFactory() {}
|
||||
virtual ~ImageFactory() = default;
|
||||
|
||||
virtual RefPtr<PlanarYCbCrImage> CreatePlanarYCbCrImage(
|
||||
const gfx::IntSize& aScaleHint, BufferRecycleBin* aRecycleBin);
|
||||
@@ -802,7 +802,7 @@ class PlanarYCbCrImage : public Image {
|
||||
|
||||
enum { MAX_DIMENSION = 16384 };
|
||||
|
||||
virtual ~PlanarYCbCrImage() {}
|
||||
virtual ~PlanarYCbCrImage() = default;
|
||||
|
||||
/**
|
||||
* This makes a copy of the data buffers, in order to support functioning
|
||||
|
||||
@@ -66,22 +66,20 @@ class ImageLayer : public Layer {
|
||||
|
||||
MOZ_LAYER_DECL_NAME("ImageLayer", TYPE_IMAGE)
|
||||
|
||||
virtual void ComputeEffectiveTransforms(
|
||||
void ComputeEffectiveTransforms(
|
||||
const gfx::Matrix4x4& aTransformToSurface) override;
|
||||
|
||||
virtual const gfx::Matrix4x4& GetEffectiveTransformForBuffer()
|
||||
const override {
|
||||
const gfx::Matrix4x4& GetEffectiveTransformForBuffer() const override {
|
||||
return mEffectiveTransformForBuffer;
|
||||
}
|
||||
|
||||
virtual ImageLayer* AsImageLayer() override { return this; }
|
||||
ImageLayer* AsImageLayer() override { return this; }
|
||||
|
||||
protected:
|
||||
ImageLayer(LayerManager* aManager, void* aImplData);
|
||||
~ImageLayer();
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
virtual void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
virtual ~ImageLayer();
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
const void* aParent) override;
|
||||
|
||||
RefPtr<ImageContainer> mContainer;
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace layers {
|
||||
* alternative of making mIndex a int32_t that can store -1, but then having
|
||||
* to cast to uint32_t all over the place.
|
||||
*/
|
||||
class MOZ_STACK_CLASS LayerMetricsWrapper {
|
||||
class MOZ_STACK_CLASS LayerMetricsWrapper final {
|
||||
public:
|
||||
enum StartAt {
|
||||
TOP,
|
||||
|
||||
@@ -147,7 +147,7 @@ class LayerScopeWebSocketManager {
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~SocketListener() {}
|
||||
virtual ~SocketListener() = default;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -380,7 +380,7 @@ class DebugGLData : public LinkedListElement<DebugGLData> {
|
||||
public:
|
||||
explicit DebugGLData(Packet::DataType aDataType) : mDataType(aDataType) {}
|
||||
|
||||
virtual ~DebugGLData() {}
|
||||
virtual ~DebugGLData() = default;
|
||||
|
||||
virtual bool Write() = 0;
|
||||
|
||||
@@ -405,7 +405,7 @@ class DebugGLFrameStatusData final : public DebugGLData {
|
||||
explicit DebugGLFrameStatusData(Packet::DataType aDataType)
|
||||
: DebugGLData(aDataType), mFrameStamp(0) {}
|
||||
|
||||
virtual bool Write() override {
|
||||
bool Write() override {
|
||||
Packet packet;
|
||||
packet.set_type(mDataType);
|
||||
|
||||
@@ -441,7 +441,7 @@ class DebugGLTextureData final : public DebugGLData {
|
||||
pack(img);
|
||||
}
|
||||
|
||||
virtual bool Write() override { return WriteToStream(*mPacket); }
|
||||
bool Write() override { return WriteToStream(*mPacket); }
|
||||
|
||||
private:
|
||||
void pack(DataSourceSurface* aImage) {
|
||||
@@ -507,7 +507,7 @@ class DebugGLColorData final : public DebugGLData {
|
||||
mColor(color.ToABGR()),
|
||||
mSize(width, height) {}
|
||||
|
||||
virtual bool Write() override {
|
||||
bool Write() override {
|
||||
Packet packet;
|
||||
packet.set_type(mDataType);
|
||||
|
||||
@@ -531,7 +531,7 @@ class DebugGLLayersData final : public DebugGLData {
|
||||
explicit DebugGLLayersData(UniquePtr<Packet> aPacket)
|
||||
: DebugGLData(Packet::LAYERS), mPacket(std::move(aPacket)) {}
|
||||
|
||||
virtual bool Write() override {
|
||||
bool Write() override {
|
||||
mPacket->set_type(mDataType);
|
||||
return WriteToStream(*mPacket);
|
||||
}
|
||||
@@ -548,7 +548,7 @@ class DebugGLMetaData final : public DebugGLData {
|
||||
explicit DebugGLMetaData(Packet::DataType aDataType)
|
||||
: DebugGLData(aDataType), mComposedByHwc(false) {}
|
||||
|
||||
virtual bool Write() override {
|
||||
bool Write() override {
|
||||
Packet packet;
|
||||
packet.set_type(mDataType);
|
||||
|
||||
@@ -581,7 +581,7 @@ class DebugGLDrawData final : public DebugGLData {
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool Write() override {
|
||||
bool Write() override {
|
||||
Packet packet;
|
||||
packet.set_type(mDataType);
|
||||
|
||||
@@ -640,7 +640,7 @@ class DebugDataSender {
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~AppendTask() {}
|
||||
virtual ~AppendTask() = default;
|
||||
|
||||
DebugGLData* mData;
|
||||
// Keep a strong reference to DebugDataSender to prevent this object
|
||||
@@ -661,7 +661,7 @@ class DebugDataSender {
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~ClearTask() {}
|
||||
virtual ~ClearTask() = default;
|
||||
|
||||
RefPtr<DebugDataSender> mHost;
|
||||
};
|
||||
@@ -691,7 +691,7 @@ class DebugDataSender {
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~SendTask() {}
|
||||
virtual ~SendTask() = default;
|
||||
|
||||
RefPtr<DebugDataSender> mHost;
|
||||
};
|
||||
@@ -707,7 +707,7 @@ class DebugDataSender {
|
||||
void Send() { mThread->Dispatch(new SendTask(this), NS_DISPATCH_NORMAL); }
|
||||
|
||||
protected:
|
||||
virtual ~DebugDataSender() {}
|
||||
virtual ~DebugDataSender() = default;
|
||||
void RemoveData() {
|
||||
MOZ_ASSERT(mThread->SerialEventTarget()->IsOnCurrentThread());
|
||||
if (mList.isEmpty()) return;
|
||||
|
||||
@@ -52,7 +52,7 @@ class LayerScope {
|
||||
};
|
||||
|
||||
// Perform BeginFrame and EndFrame automatically
|
||||
class LayerScopeAutoFrame {
|
||||
class LayerScopeAutoFrame final {
|
||||
public:
|
||||
explicit LayerScopeAutoFrame(int64_t aFrameStamp);
|
||||
~LayerScopeAutoFrame();
|
||||
|
||||
@@ -173,7 +173,7 @@ struct LayerPropertiesBase : public LayerProperties {
|
||||
mUseClipRect(false) {
|
||||
MOZ_COUNT_CTOR(LayerPropertiesBase);
|
||||
}
|
||||
~LayerPropertiesBase() override { MOZ_COUNT_DTOR(LayerPropertiesBase); }
|
||||
virtual ~LayerPropertiesBase() { MOZ_COUNT_DTOR(LayerPropertiesBase); }
|
||||
|
||||
protected:
|
||||
LayerPropertiesBase(const LayerPropertiesBase& a) = delete;
|
||||
|
||||
@@ -33,13 +33,13 @@ typedef void (*NotifySubDocInvalidationFunc)(ContainerLayer* aLayer,
|
||||
*/
|
||||
struct LayerProperties {
|
||||
protected:
|
||||
LayerProperties() {}
|
||||
LayerProperties() = default;
|
||||
|
||||
LayerProperties(const LayerProperties& a) = delete;
|
||||
LayerProperties& operator=(const LayerProperties& a) = delete;
|
||||
|
||||
public:
|
||||
virtual ~LayerProperties() {}
|
||||
virtual ~LayerProperties() = default;
|
||||
|
||||
/**
|
||||
* Copies the current layer tree properties into
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace layers {
|
||||
*/
|
||||
class LayerUserData {
|
||||
public:
|
||||
virtual ~LayerUserData() {}
|
||||
virtual ~LayerUserData() = default;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
||||
@@ -113,8 +113,8 @@ class LayersPacket;
|
||||
} // namespace layerscope
|
||||
|
||||
#define MOZ_LAYER_DECL_NAME(n, e) \
|
||||
virtual const char* Name() const override { return n; } \
|
||||
virtual LayerType GetType() const override { return e; } \
|
||||
const char* Name() const override { return n; } \
|
||||
LayerType GetType() const override { return e; } \
|
||||
static LayerType Type() { return e; }
|
||||
|
||||
// Defined in LayerUserData.h; please include that file instead.
|
||||
@@ -754,7 +754,7 @@ class LayerManager : public FrameRecorder {
|
||||
nsIntRegion mRegionToClear;
|
||||
|
||||
// Protected destructor, to discourage deletion outside of Release():
|
||||
virtual ~LayerManager() {}
|
||||
virtual ~LayerManager() = default;
|
||||
|
||||
// Print interesting information about this into aStreamo. Internally
|
||||
// used to implement Dump*() and Log*().
|
||||
@@ -2059,11 +2059,11 @@ class PaintedLayer : public Layer {
|
||||
mInvalidRegion.SetEmpty();
|
||||
}
|
||||
|
||||
virtual PaintedLayer* AsPaintedLayer() override { return this; }
|
||||
PaintedLayer* AsPaintedLayer() override { return this; }
|
||||
|
||||
MOZ_LAYER_DECL_NAME("PaintedLayer", TYPE_PAINTED)
|
||||
|
||||
virtual void ComputeEffectiveTransforms(
|
||||
void ComputeEffectiveTransforms(
|
||||
const gfx::Matrix4x4& aTransformToSurface) override {
|
||||
gfx::Matrix4x4 idealTransform = GetLocalTransform() * aTransformToSurface;
|
||||
gfx::Matrix residual;
|
||||
@@ -2128,10 +2128,9 @@ class PaintedLayer : public Layer {
|
||||
mUsedForReadback(false),
|
||||
mAllowResidualTranslation(false) {}
|
||||
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
virtual void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
const void* aParent) override;
|
||||
|
||||
/**
|
||||
@@ -2192,7 +2191,7 @@ class PaintedLayer : public Layer {
|
||||
*/
|
||||
class ContainerLayer : public Layer {
|
||||
public:
|
||||
~ContainerLayer();
|
||||
virtual ~ContainerLayer();
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
@@ -2251,7 +2250,7 @@ class ContainerLayer : public Layer {
|
||||
Mutated();
|
||||
}
|
||||
|
||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
|
||||
void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
|
||||
|
||||
enum class SortMode {
|
||||
WITH_GEOMETRY,
|
||||
@@ -2260,14 +2259,12 @@ class ContainerLayer : public Layer {
|
||||
|
||||
nsTArray<LayerPolygon> SortChildrenBy3DZOrder(SortMode aSortMode);
|
||||
|
||||
virtual ContainerLayer* AsContainerLayer() override { return this; }
|
||||
virtual const ContainerLayer* AsContainerLayer() const override {
|
||||
return this;
|
||||
}
|
||||
ContainerLayer* AsContainerLayer() override { return this; }
|
||||
const ContainerLayer* AsContainerLayer() const override { return this; }
|
||||
|
||||
// These getters can be used anytime.
|
||||
virtual Layer* GetFirstChild() const override { return mFirstChild; }
|
||||
virtual Layer* GetLastChild() const override { return mLastChild; }
|
||||
Layer* GetFirstChild() const override { return mFirstChild; }
|
||||
Layer* GetLastChild() const override { return mLastChild; }
|
||||
float GetPreXScale() const { return mPreXScale; }
|
||||
float GetPreYScale() const { return mPreYScale; }
|
||||
float GetInheritedXScale() const { return mInheritedXScale; }
|
||||
@@ -2282,7 +2279,7 @@ class ContainerLayer : public Layer {
|
||||
* container is backend-specific. ComputeEffectiveTransforms must also set
|
||||
* mUseIntermediateSurface.
|
||||
*/
|
||||
virtual void ComputeEffectiveTransforms(
|
||||
void ComputeEffectiveTransforms(
|
||||
const gfx::Matrix4x4& aTransformToSurface) override = 0;
|
||||
|
||||
/**
|
||||
@@ -2427,7 +2424,7 @@ class ContainerLayer : public Layer {
|
||||
*/
|
||||
class ColorLayer : public Layer {
|
||||
public:
|
||||
virtual ColorLayer* AsColorLayer() override { return this; }
|
||||
ColorLayer* AsColorLayer() override { return this; }
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
@@ -2455,7 +2452,7 @@ class ColorLayer : public Layer {
|
||||
|
||||
MOZ_LAYER_DECL_NAME("ColorLayer", TYPE_COLOR)
|
||||
|
||||
virtual void ComputeEffectiveTransforms(
|
||||
void ComputeEffectiveTransforms(
|
||||
const gfx::Matrix4x4& aTransformToSurface) override {
|
||||
gfx::Matrix4x4 idealTransform = GetLocalTransform() * aTransformToSurface;
|
||||
mEffectiveTransform = SnapTransformTranslation(idealTransform, nullptr);
|
||||
@@ -2466,10 +2463,9 @@ class ColorLayer : public Layer {
|
||||
ColorLayer(LayerManager* aManager, void* aImplData)
|
||||
: Layer(aManager, aImplData), mColor() {}
|
||||
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
virtual void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
const void* aParent) override;
|
||||
|
||||
gfx::IntRect mBounds;
|
||||
@@ -2490,7 +2486,7 @@ class CanvasLayer : public Layer {
|
||||
public:
|
||||
void SetBounds(gfx::IntRect aBounds) { mBounds = aBounds; }
|
||||
|
||||
virtual CanvasLayer* AsCanvasLayer() override { return this; }
|
||||
CanvasLayer* AsCanvasLayer() override { return this; }
|
||||
|
||||
/**
|
||||
* Notify this CanvasLayer that the canvas surface contents have
|
||||
@@ -2540,7 +2536,7 @@ class CanvasLayer : public Layer {
|
||||
|
||||
MOZ_LAYER_DECL_NAME("CanvasLayer", TYPE_CANVAS)
|
||||
|
||||
virtual void ComputeEffectiveTransforms(
|
||||
void ComputeEffectiveTransforms(
|
||||
const gfx::Matrix4x4& aTransformToSurface) override {
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
@@ -2558,10 +2554,9 @@ class CanvasLayer : public Layer {
|
||||
CanvasLayer(LayerManager* aManager, void* aImplData);
|
||||
virtual ~CanvasLayer();
|
||||
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
virtual void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
const void* aParent) override;
|
||||
|
||||
virtual CanvasRenderer* CreateCanvasRendererInternal() = 0;
|
||||
@@ -2596,17 +2591,17 @@ class RefLayer : public ContainerLayer {
|
||||
friend class LayerManager;
|
||||
|
||||
private:
|
||||
virtual bool InsertAfter(Layer* aChild, Layer* aAfter) override {
|
||||
bool InsertAfter(Layer* aChild, Layer* aAfter) override {
|
||||
MOZ_CRASH("GFX: RefLayer");
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool RemoveChild(Layer* aChild) override {
|
||||
bool RemoveChild(Layer* aChild) override {
|
||||
MOZ_CRASH("GFX: RefLayer");
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool RepositionChild(Layer* aChild, Layer* aAfter) override {
|
||||
bool RepositionChild(Layer* aChild, Layer* aAfter) override {
|
||||
MOZ_CRASH("GFX: RefLayer");
|
||||
return false;
|
||||
}
|
||||
@@ -2677,14 +2672,14 @@ class RefLayer : public ContainerLayer {
|
||||
}
|
||||
|
||||
// These getters can be used anytime.
|
||||
virtual RefLayer* AsRefLayer() override { return this; }
|
||||
RefLayer* AsRefLayer() override { return this; }
|
||||
|
||||
virtual LayersId GetReferentId() { return mId; }
|
||||
|
||||
/**
|
||||
* DRAWING PHASE ONLY
|
||||
*/
|
||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
|
||||
void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) override;
|
||||
|
||||
MOZ_LAYER_DECL_NAME("RefLayer", TYPE_REF)
|
||||
|
||||
@@ -2694,10 +2689,9 @@ class RefLayer : public ContainerLayer {
|
||||
mId{0},
|
||||
mEventRegionsOverride(EventRegionsOverride::NoOverride) {}
|
||||
|
||||
virtual void PrintInfo(std::stringstream& aStream,
|
||||
const char* aPrefix) override;
|
||||
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
||||
|
||||
virtual void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
void DumpPacket(layerscope::LayersPacket* aPacket,
|
||||
const void* aParent) override;
|
||||
|
||||
// 0 is a special value that means "no ID".
|
||||
|
||||
@@ -365,7 +365,7 @@ typedef Maybe<LayerRect> MaybeLayerRect;
|
||||
// This is used to communicate Layers across IPC channels. The Handle is valid
|
||||
// for layers in the same PLayerTransaction. Handles are created by
|
||||
// ClientLayerManager, and are cached in LayerTransactionParent on first use.
|
||||
class LayerHandle {
|
||||
class LayerHandle final {
|
||||
friend struct IPC::ParamTraits<mozilla::layers::LayerHandle>;
|
||||
|
||||
public:
|
||||
@@ -387,7 +387,7 @@ class LayerHandle {
|
||||
// valid for layers in the same PLayerTransaction or PImageBridge. Handles are
|
||||
// created by ClientLayerManager or ImageBridgeChild, and are cached in the
|
||||
// parent side on first use.
|
||||
class CompositableHandle {
|
||||
class CompositableHandle final {
|
||||
friend struct IPC::ParamTraits<mozilla::layers::CompositableHandle>;
|
||||
|
||||
public:
|
||||
|
||||
@@ -38,7 +38,7 @@ class PersistentBufferProvider : public RefCounted<PersistentBufferProvider> {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PersistentBufferProvider)
|
||||
|
||||
virtual ~PersistentBufferProvider() {}
|
||||
virtual ~PersistentBufferProvider() = default;
|
||||
|
||||
virtual LayersBackend GetType() { return LayersBackend::LAYERS_NONE; }
|
||||
|
||||
@@ -95,29 +95,26 @@ class PersistentBufferProviderBasic : public PersistentBufferProvider {
|
||||
|
||||
explicit PersistentBufferProviderBasic(gfx::DrawTarget* aTarget);
|
||||
|
||||
virtual LayersBackend GetType() override {
|
||||
return LayersBackend::LAYERS_BASIC;
|
||||
}
|
||||
LayersBackend GetType() override { return LayersBackend::LAYERS_BASIC; }
|
||||
|
||||
virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
|
||||
already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
|
||||
const gfx::IntRect& aPersistedRect) override;
|
||||
|
||||
virtual bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
|
||||
bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
|
||||
|
||||
virtual already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
|
||||
already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
|
||||
|
||||
virtual void ReturnSnapshot(
|
||||
already_AddRefed<gfx::SourceSurface> aSnapshot) override;
|
||||
void ReturnSnapshot(already_AddRefed<gfx::SourceSurface> aSnapshot) override;
|
||||
|
||||
virtual bool PreservesDrawingState() const override { return true; }
|
||||
bool PreservesDrawingState() const override { return true; }
|
||||
|
||||
virtual void OnShutdown() override { Destroy(); }
|
||||
void OnShutdown() override { Destroy(); }
|
||||
|
||||
protected:
|
||||
void Destroy();
|
||||
|
||||
private:
|
||||
~PersistentBufferProviderBasic();
|
||||
virtual ~PersistentBufferProviderBasic();
|
||||
|
||||
RefPtr<gfx::DrawTarget> mDrawTarget;
|
||||
RefPtr<gfx::SourceSurface> mSnapshot;
|
||||
@@ -137,29 +134,28 @@ class PersistentBufferProviderShared : public PersistentBufferProvider,
|
||||
gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
KnowsCompositor* aKnowsCompositor);
|
||||
|
||||
virtual LayersBackend GetType() override;
|
||||
LayersBackend GetType() override;
|
||||
|
||||
virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
|
||||
already_AddRefed<gfx::DrawTarget> BorrowDrawTarget(
|
||||
const gfx::IntRect& aPersistedRect) override;
|
||||
|
||||
virtual bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
|
||||
bool ReturnDrawTarget(already_AddRefed<gfx::DrawTarget> aDT) override;
|
||||
|
||||
virtual already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
|
||||
already_AddRefed<gfx::SourceSurface> BorrowSnapshot() override;
|
||||
|
||||
virtual void ReturnSnapshot(
|
||||
already_AddRefed<gfx::SourceSurface> aSnapshot) override;
|
||||
void ReturnSnapshot(already_AddRefed<gfx::SourceSurface> aSnapshot) override;
|
||||
|
||||
virtual TextureClient* GetTextureClient() override;
|
||||
TextureClient* GetTextureClient() override;
|
||||
|
||||
virtual void NotifyInactive() override;
|
||||
void NotifyInactive() override;
|
||||
|
||||
virtual void OnShutdown() override { Destroy(); }
|
||||
void OnShutdown() override { Destroy(); }
|
||||
|
||||
virtual bool SetKnowsCompositor(KnowsCompositor* aKnowsCompositor) override;
|
||||
bool SetKnowsCompositor(KnowsCompositor* aKnowsCompositor) override;
|
||||
|
||||
virtual void ClearCachedResources() override;
|
||||
void ClearCachedResources() override;
|
||||
|
||||
virtual bool PreservesDrawingState() const override { return false; }
|
||||
bool PreservesDrawingState() const override { return false; }
|
||||
|
||||
protected:
|
||||
PersistentBufferProviderShared(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
@@ -186,7 +182,7 @@ class PersistentBufferProviderShared : public PersistentBufferProvider,
|
||||
RefPtr<gfx::SourceSurface> mSnapshot;
|
||||
};
|
||||
|
||||
struct AutoReturnSnapshot {
|
||||
struct AutoReturnSnapshot final {
|
||||
PersistentBufferProvider* mBufferProvider;
|
||||
RefPtr<gfx::SourceSurface>* mSnapshot;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class LayersPacket;
|
||||
class ReadbackSink {
|
||||
public:
|
||||
ReadbackSink() {}
|
||||
virtual ~ReadbackSink() {}
|
||||
virtual ~ReadbackSink() = default;
|
||||
|
||||
/**
|
||||
* Sends an update to indicate that the background is currently unknown.
|
||||
|
||||
@@ -279,7 +279,7 @@ class SourceSurfaceSharedData final : public DataSourceSurface {
|
||||
private:
|
||||
friend class SourceSurfaceSharedDataWrapper;
|
||||
|
||||
~SourceSurfaceSharedData() override {}
|
||||
virtual ~SourceSurfaceSharedData() = default;
|
||||
|
||||
void LockHandle() {
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
@@ -84,7 +84,7 @@ class SourceSurfaceVolatileData : public DataSourceSurface {
|
||||
}
|
||||
|
||||
private:
|
||||
~SourceSurfaceVolatileData() override {}
|
||||
virtual ~SourceSurfaceVolatileData() = default;
|
||||
|
||||
Mutex mMutex;
|
||||
int32_t mStride;
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef uintptr_t SyncHandle;
|
||||
class SyncObjectHost : public RefCounted<SyncObjectHost> {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SyncObjectHost)
|
||||
virtual ~SyncObjectHost() {}
|
||||
virtual ~SyncObjectHost() = default;
|
||||
|
||||
static already_AddRefed<SyncObjectHost> CreateSyncObjectHost(
|
||||
#ifdef XP_WIN
|
||||
@@ -45,7 +45,7 @@ class SyncObjectHost : public RefCounted<SyncObjectHost> {
|
||||
class SyncObjectClient : public external::AtomicRefCounted<SyncObjectClient> {
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SyncObjectClient)
|
||||
virtual ~SyncObjectClient() {}
|
||||
virtual ~SyncObjectClient() = default;
|
||||
|
||||
static already_AddRefed<SyncObjectClient> CreateSyncObjectClient(
|
||||
SyncHandle aHandle
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace layers {
|
||||
|
||||
class DIBTextureData : public TextureData {
|
||||
public:
|
||||
virtual bool Lock(OpenMode) override { return true; }
|
||||
bool Lock(OpenMode) override { return true; }
|
||||
|
||||
virtual void Unlock() override {}
|
||||
void Unlock() override {}
|
||||
|
||||
virtual void FillInfo(TextureData::Info& aInfo) const override;
|
||||
void FillInfo(TextureData::Info& aInfo) const override;
|
||||
|
||||
virtual already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
|
||||
already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
|
||||
|
||||
static DIBTextureData* Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
LayersIPCChannel* aAllocator);
|
||||
@@ -52,25 +52,22 @@ class TextureHostDirectUpload : public TextureHost {
|
||||
gfx::IntSize aSize)
|
||||
: TextureHost(aFlags), mFormat(aFormat), mSize(aSize), mIsLocked(false) {}
|
||||
|
||||
virtual void DeallocateDeviceData() override;
|
||||
void DeallocateDeviceData() override;
|
||||
|
||||
virtual void SetTextureSourceProvider(
|
||||
TextureSourceProvider* aProvider) override;
|
||||
void SetTextureSourceProvider(TextureSourceProvider* aProvider) override;
|
||||
|
||||
virtual gfx::SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
gfx::SurfaceFormat GetFormat() const override { return mFormat; }
|
||||
|
||||
virtual gfx::IntSize GetSize() const override { return mSize; }
|
||||
gfx::IntSize GetSize() const override { return mSize; }
|
||||
|
||||
virtual bool Lock() override;
|
||||
bool Lock() override;
|
||||
|
||||
virtual void Unlock() override;
|
||||
void Unlock() override;
|
||||
|
||||
virtual bool HasIntermediateBuffer() const { return true; }
|
||||
bool HasIntermediateBuffer() const { return true; }
|
||||
|
||||
virtual bool BindTextureSource(
|
||||
CompositableTextureSourceRef& aTexture) override;
|
||||
virtual bool AcquireTextureSource(
|
||||
CompositableTextureSourceRef& aTexture) override;
|
||||
bool BindTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
bool AcquireTextureSource(CompositableTextureSourceRef& aTexture) override;
|
||||
|
||||
protected:
|
||||
RefPtr<TextureSourceProvider> mProvider;
|
||||
@@ -84,12 +81,12 @@ class DIBTextureHost : public TextureHostDirectUpload {
|
||||
public:
|
||||
DIBTextureHost(TextureFlags aFlags, const SurfaceDescriptorDIB& aDescriptor);
|
||||
|
||||
virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
|
||||
already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
|
||||
return nullptr; // TODO: cf bug 872568
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
|
||||
void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
|
||||
|
||||
RefPtr<gfxWindowsSurface> mSurface;
|
||||
};
|
||||
@@ -100,7 +97,7 @@ class TextureHostFileMapping : public TextureHostDirectUpload {
|
||||
const SurfaceDescriptorFileMapping& aDescriptor);
|
||||
~TextureHostFileMapping();
|
||||
|
||||
virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
|
||||
already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override {
|
||||
MOZ_CRASH("GFX: TextureHostFileMapping::GetAsSurface not implemented");
|
||||
// Not implemented! It would be tricky to keep track of the
|
||||
// scope of the file mapping. We could do this through UserData
|
||||
@@ -108,7 +105,7 @@ class TextureHostFileMapping : public TextureHostDirectUpload {
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
|
||||
void UpdatedInternal(const nsIntRegion* aRegion = nullptr) override;
|
||||
|
||||
HANDLE mFileMapping;
|
||||
};
|
||||
|
||||
@@ -105,7 +105,7 @@ class TextureSourceProvider {
|
||||
virtual bool IsValid() const = 0;
|
||||
|
||||
public:
|
||||
class MOZ_STACK_CLASS AutoReadUnlockTextures {
|
||||
class MOZ_STACK_CLASS AutoReadUnlockTextures final {
|
||||
public:
|
||||
explicit AutoReadUnlockTextures(TextureSourceProvider* aProvider)
|
||||
: mProvider(aProvider) {}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace layers {
|
||||
|
||||
class TransactionIdAllocator {
|
||||
protected:
|
||||
virtual ~TransactionIdAllocator() {}
|
||||
virtual ~TransactionIdAllocator() = default;
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(TransactionIdAllocator)
|
||||
|
||||
@@ -111,7 +111,7 @@ class APZInputBridge {
|
||||
virtual void UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint,
|
||||
EventMessage aEventMessage) = 0;
|
||||
|
||||
virtual ~APZInputBridge() {}
|
||||
virtual ~APZInputBridge() = default;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
||||
@@ -24,7 +24,7 @@ class CompositorController {
|
||||
virtual void ScheduleShowAllPluginWindows() = 0;
|
||||
|
||||
protected:
|
||||
virtual ~CompositorController() {}
|
||||
virtual ~CompositorController() = default;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
||||
@@ -209,7 +209,7 @@ class GeckoContentController {
|
||||
|
||||
protected:
|
||||
// Protected destructor, to discourage deletion outside of Release():
|
||||
virtual ~GeckoContentController() {}
|
||||
virtual ~GeckoContentController() = default;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
||||
@@ -135,7 +135,7 @@ class IAPZCTreeManager {
|
||||
protected:
|
||||
// Discourage destruction outside of decref
|
||||
|
||||
virtual ~IAPZCTreeManager() {}
|
||||
virtual ~IAPZCTreeManager() = default;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
||||
@@ -28,7 +28,7 @@ class MetricsSharingController {
|
||||
uint32_t aApzcId) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~MetricsSharingController() {}
|
||||
virtual ~MetricsSharingController() = default;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
||||
@@ -106,7 +106,7 @@ inline AsyncTransformMatrix CompleteAsyncTransform(
|
||||
aMatrix, PixelCastJustification::MultipleAsyncTransforms);
|
||||
}
|
||||
|
||||
struct TargetConfirmationFlags {
|
||||
struct TargetConfirmationFlags final {
|
||||
explicit TargetConfirmationFlags(bool aTargetConfirmed)
|
||||
: mTargetConfirmed(aTargetConfirmed),
|
||||
mRequiresTargetConfirmation(false) {}
|
||||
|
||||
@@ -548,7 +548,7 @@ TimeStamp AsyncPanZoomController::GetFrameTime() const {
|
||||
return treeManagerLocal ? treeManagerLocal->GetFrameTime() : TimeStamp::Now();
|
||||
}
|
||||
|
||||
class MOZ_STACK_CLASS StateChangeNotificationBlocker {
|
||||
class MOZ_STACK_CLASS StateChangeNotificationBlocker final {
|
||||
public:
|
||||
explicit StateChangeNotificationBlocker(AsyncPanZoomController* aApzc)
|
||||
: mApzc(aApzc) {
|
||||
@@ -581,7 +581,7 @@ class MOZ_STACK_CLASS StateChangeNotificationBlocker {
|
||||
* the async layout viewport offset, since modifying the async scroll offset
|
||||
* may result in the layout viewport moving as well).
|
||||
*/
|
||||
class MOZ_RAII AutoApplyAsyncTestAttributes {
|
||||
class MOZ_RAII AutoApplyAsyncTestAttributes final {
|
||||
public:
|
||||
explicit AutoApplyAsyncTestAttributes(const AsyncPanZoomController*);
|
||||
~AutoApplyAsyncTestAttributes();
|
||||
|
||||
@@ -47,9 +47,8 @@ class MOZ_STACK_CLASS APZAutoDirWheelDeltaAdjuster final
|
||||
* IsHorizontalContentRightToLeft() in
|
||||
* the base class AutoDirWheelDeltaAdjuster.
|
||||
*/
|
||||
explicit APZAutoDirWheelDeltaAdjuster(double& aDeltaX, double& aDeltaY,
|
||||
const AxisX& aAxisX,
|
||||
const AxisY& aAxisY,
|
||||
APZAutoDirWheelDeltaAdjuster(double& aDeltaX, double& aDeltaY,
|
||||
const AxisX& aAxisX, const AxisY& aAxisY,
|
||||
bool aIsHorizontalContentRightToLeft)
|
||||
: AutoDirWheelDeltaAdjuster(aDeltaX, aDeltaY),
|
||||
mAxisX(aAxisX),
|
||||
|
||||
@@ -344,39 +344,35 @@ class Axis {
|
||||
class AxisX : public Axis {
|
||||
public:
|
||||
explicit AxisX(AsyncPanZoomController* mAsyncPanZoomController);
|
||||
virtual ParentLayerCoord GetPointOffset(
|
||||
ParentLayerCoord GetPointOffset(
|
||||
const ParentLayerPoint& aPoint) const override;
|
||||
virtual ParentLayerCoord GetRectLength(
|
||||
const ParentLayerRect& aRect) const override;
|
||||
virtual ParentLayerCoord GetRectOffset(
|
||||
const ParentLayerRect& aRect) const override;
|
||||
virtual CSSToParentLayerScale GetScaleForAxis(
|
||||
ParentLayerCoord GetRectLength(const ParentLayerRect& aRect) const override;
|
||||
ParentLayerCoord GetRectOffset(const ParentLayerRect& aRect) const override;
|
||||
CSSToParentLayerScale GetScaleForAxis(
|
||||
const CSSToParentLayerScale2D& aScale) const override;
|
||||
virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
||||
virtual const char* Name() const override;
|
||||
ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
||||
const char* Name() const override;
|
||||
bool CanScrollTo(Side aSide) const;
|
||||
|
||||
private:
|
||||
virtual OverscrollBehavior GetOverscrollBehavior() const override;
|
||||
OverscrollBehavior GetOverscrollBehavior() const override;
|
||||
};
|
||||
|
||||
class AxisY : public Axis {
|
||||
public:
|
||||
explicit AxisY(AsyncPanZoomController* mAsyncPanZoomController);
|
||||
virtual ParentLayerCoord GetPointOffset(
|
||||
ParentLayerCoord GetPointOffset(
|
||||
const ParentLayerPoint& aPoint) const override;
|
||||
virtual ParentLayerCoord GetRectLength(
|
||||
const ParentLayerRect& aRect) const override;
|
||||
virtual ParentLayerCoord GetRectOffset(
|
||||
const ParentLayerRect& aRect) const override;
|
||||
virtual CSSToParentLayerScale GetScaleForAxis(
|
||||
ParentLayerCoord GetRectLength(const ParentLayerRect& aRect) const override;
|
||||
ParentLayerCoord GetRectOffset(const ParentLayerRect& aRect) const override;
|
||||
CSSToParentLayerScale GetScaleForAxis(
|
||||
const CSSToParentLayerScale2D& aScale) const override;
|
||||
virtual ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
||||
virtual const char* Name() const override;
|
||||
ScreenPoint MakePoint(ScreenCoord aCoord) const override;
|
||||
const char* Name() const override;
|
||||
bool CanScrollTo(Side aSide) const;
|
||||
|
||||
private:
|
||||
virtual OverscrollBehavior GetOverscrollBehavior() const override;
|
||||
OverscrollBehavior GetOverscrollBehavior() const override;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace layers {
|
||||
* information about the severity of the checkerboarding so as to allow
|
||||
* prioritizing the debugging of some checkerboarding events over others.
|
||||
*/
|
||||
class CheckerboardEvent {
|
||||
class CheckerboardEvent final {
|
||||
public:
|
||||
// clang-format off
|
||||
MOZ_DEFINE_ENUM_AT_CLASS_SCOPE(
|
||||
|
||||
@@ -221,7 +221,7 @@ class HitTestingTreeNode {
|
||||
* Clear() being called, it unlocks the underlying node at which point it can
|
||||
* be recycled or freed.
|
||||
*/
|
||||
class MOZ_RAII HitTestingTreeNodeAutoLock {
|
||||
class MOZ_RAII HitTestingTreeNodeAutoLock final {
|
||||
public:
|
||||
HitTestingTreeNodeAutoLock();
|
||||
HitTestingTreeNodeAutoLock(const HitTestingTreeNodeAutoLock&) = delete;
|
||||
|
||||
@@ -49,7 +49,7 @@ class InputBlockState : public RefCounted<InputBlockState> {
|
||||
eConfirmed
|
||||
};
|
||||
|
||||
explicit InputBlockState(const RefPtr<AsyncPanZoomController>& aTargetApzc,
|
||||
InputBlockState(const RefPtr<AsyncPanZoomController>& aTargetApzc,
|
||||
TargetConfirmationFlags aFlags);
|
||||
virtual ~InputBlockState() = default;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user