mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1520877 - Part 3: Implement FillRoundedRect for DrawTargetCapture. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D16894 --HG-- extra : rebase_source : becf1b41cd67e82053804e293486400162cadf28
This commit is contained in:
parent
940959abd0
commit
e146ae8233
@ -29,6 +29,7 @@ enum class CommandType : int8_t {
|
||||
COPYSURFACE,
|
||||
COPYRECT,
|
||||
FILLRECT,
|
||||
FILLROUNDEDRECT,
|
||||
STROKERECT,
|
||||
STROKELINE,
|
||||
STROKE,
|
||||
|
@ -369,6 +369,38 @@ class FillRectCommand : public DrawingCommand {
|
||||
DrawOptions mOptions;
|
||||
};
|
||||
|
||||
class FillRoundedRectCommand : public DrawingCommand {
|
||||
public:
|
||||
FillRoundedRectCommand(const RoundedRect& aRect, const Pattern& aPattern,
|
||||
const DrawOptions& aOptions)
|
||||
: mRect(aRect), mPattern(aPattern), mOptions(aOptions) {}
|
||||
|
||||
CommandType GetType() const override { return FillRoundedRectCommand::Type; }
|
||||
|
||||
void CloneInto(CaptureCommandList* aList) override {
|
||||
CLONE_INTO(FillRoundedRectCommand)(mRect, mPattern, mOptions);
|
||||
}
|
||||
|
||||
void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
|
||||
aDT->FillRoundedRect(mRect, mPattern, mOptions);
|
||||
}
|
||||
|
||||
void Log(TreeLog& aStream) const override {
|
||||
aStream << "[FillRoundedRect rect=" << mRect.rect;
|
||||
aStream << " pattern=" << mPattern.Get();
|
||||
aStream << " opt=" << mOptions;
|
||||
aStream << "]";
|
||||
}
|
||||
|
||||
static const bool AffectsSnapshot = true;
|
||||
static const CommandType Type = CommandType::FILLROUNDEDRECT;
|
||||
|
||||
private:
|
||||
RoundedRect mRect;
|
||||
StoredPattern mPattern;
|
||||
DrawOptions mOptions;
|
||||
};
|
||||
|
||||
class StrokeRectCommand : public StrokeOptionsCommand {
|
||||
public:
|
||||
StrokeRectCommand(const Rect& aRect, const Pattern& aPattern,
|
||||
|
@ -189,6 +189,12 @@ void DrawTargetCaptureImpl::FillRect(const Rect& aRect, const Pattern& aPattern,
|
||||
AppendCommand(FillRectCommand)(aRect, aPattern, aOptions);
|
||||
}
|
||||
|
||||
void DrawTargetCaptureImpl::FillRoundedRect(const RoundedRect& aRect,
|
||||
const Pattern& aPattern,
|
||||
const DrawOptions& aOptions) {
|
||||
AppendCommand(FillRoundedRectCommand)(aRect, aPattern, aOptions);
|
||||
}
|
||||
|
||||
void DrawTargetCaptureImpl::StrokeRect(const Rect& aRect,
|
||||
const Pattern& aPattern,
|
||||
const StrokeOptions& aStrokeOptions,
|
||||
|
@ -65,6 +65,9 @@ class DrawTargetCaptureImpl : public DrawTargetCapture {
|
||||
|
||||
virtual void FillRect(const Rect &aRect, const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void FillRoundedRect(
|
||||
const RoundedRect &aRect, const Pattern &aPattern,
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
virtual void StrokeRect(const Rect &aRect, const Pattern &aPattern,
|
||||
const StrokeOptions &aStrokeOptions = StrokeOptions(),
|
||||
const DrawOptions &aOptions = DrawOptions()) override;
|
||||
|
Loading…
Reference in New Issue
Block a user