Skip to content

Commit

Permalink
Provide GraphicsContext::fillRect(const FloatRect&, Gradient&, const …
Browse files Browse the repository at this point in the history
…AffineTransform& gradientSpaceTransform) variant

https://bugs.webkit.org/show_bug.cgi?id=267040

Reviewed by Said Abou-Hallawa.

The existing fillRect(const FloatRect&, Gradient&) accessor, only calls
gradient.paint(), but does not handle gradient space transformations, nor
drop shadows, nor does it clip to the rect, etc. in contrary to the generic
fillRect(const FloatRect&) variant, which supports all these features,
but only when using the fillGradient() and the fillGradientSpaceTransform().

For LBSE gradient support it would be useful to be able to fill a rectangle
using the _stroke_ gradient, therefore extend the GraphicsContext::fillRect()
variants to provide one that takes a specific Gradient + AffineTransform pair.

Implement the new fillRect() variant in various places: NullGraphicsContext,
BifurcatedGraphicsCOntext, and all other variants inheriting from GraphicsContext.

No change in existing functionality, thus no new tests.

* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.cpp:
(WebCore::BifurcatedGraphicsContext::fillRect):
* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.h:
* Source/WebCore/platform/graphics/GraphicsContext.h:
* Source/WebCore/platform/graphics/NullGraphicsContext.h:
* Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::FillSource::FillSource):
* Source/WebCore/platform/graphics/cairo/CairoOperations.h:
* Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContextCairo::fillRect):
* Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.h:
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::fillRect):
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItem.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::FillRectWithGradient::apply const):
(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform::FillRectWithGradientAndSpaceTransform):
(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform::apply const):
(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform::dump const):
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform::rect const):
(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform::gradient const):
(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform::gradientSpaceTransform const):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::fillRect):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::recordFillRectWithGradientAndSpaceTransform):
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h:
* Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::fillRect):
* Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
(WebKit::RemoteDisplayListRecorder::fillRectWithGradientAndSpaceTransform):
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h:
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in:
* Source/WebKit/Shared/DisplayListArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::recordFillRectWithGradientAndSpaceTransform):
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:

Canonical link: https://commits.webkit.org/272648@main
  • Loading branch information
nikolaszimmermann committed Jan 4, 2024
1 parent 21d9750 commit df59d72
Show file tree
Hide file tree
Showing 25 changed files with 162 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ void BifurcatedGraphicsContext::fillRect(const FloatRect& rect, Gradient& gradie
VERIFY_STATE_SYNCHRONIZATION();
}

void BifurcatedGraphicsContext::fillRect(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
m_primaryContext.fillRect(rect, gradient, gradientSpaceTransform);
m_secondaryContext.fillRect(rect, gradient, gradientSpaceTransform);

VERIFY_STATE_SYNCHRONIZATION();
}

void BifurcatedGraphicsContext::fillRoundedRectImpl(const FloatRoundedRect& rect, const Color& color)
{
m_primaryContext.fillRoundedRectImpl(rect, color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class WEBCORE_EXPORT BifurcatedGraphicsContext : public GraphicsContext {
void fillRect(const FloatRect&) final;
void fillRect(const FloatRect&, const Color&) final;
void fillRect(const FloatRect&, Gradient&) final;
void fillRect(const FloatRect&, Gradient&, const AffineTransform&) final;
void fillRoundedRectImpl(const FloatRoundedRect&, const Color&) final;
void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& roundedHoleRect, const Color&) final;
void clearRect(const FloatRect&) final;
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/graphics/GraphicsContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class GraphicsContext {

virtual void fillRect(const FloatRect&) = 0;
virtual void fillRect(const FloatRect&, const Color&) = 0;
virtual void fillRect(const FloatRect&, Gradient&, const AffineTransform&) = 0;
WEBCORE_EXPORT virtual void fillRect(const FloatRect&, Gradient&);
WEBCORE_EXPORT virtual void fillRect(const FloatRect&, const Color&, CompositeOperator, BlendMode = BlendMode::Normal);
virtual void fillRoundedRectImpl(const FloatRoundedRect&, const Color&) = 0;
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/graphics/NullGraphicsContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class NullGraphicsContext : public GraphicsContext {
void fillPath(const Path&) final { }
void strokePath(const Path&) final { }
void fillRect(const FloatRect&) final { }
void fillRect(const FloatRect&, Gradient&, const AffineTransform&) final { }
void fillRect(const FloatRect&, const Color&) final { }
void fillRoundedRectImpl(const FloatRoundedRect&, const Color&) final { }
void strokeRect(const FloatRect&, float) final { }
Expand Down
9 changes: 9 additions & 0 deletions Source/WebCore/platform/graphics/cairo/CairoOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,15 @@ FillSource::FillSource(const GraphicsContextState& state)
color = state.fillBrush().color();
}

FillSource::FillSource(const GraphicsContextState& state, Gradient& useGradient, const AffineTransform& gradientSpaceTransform)
: globalAlpha(state.alpha())
, fillRule(state.fillRule())
{
gradient.base = useGradient.createPattern(1, gradientSpaceTransform);
if (state.alpha() != 1)
gradient.alphaAdjusted = useGradient.createPattern(state.alpha(), gradientSpaceTransform);
}

StrokeSource::StrokeSource(const GraphicsContextState& state)
: globalAlpha(state.alpha())
{
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/cairo/CairoOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Color;
class FloatRect;
class FloatRoundedRect;
class FloatSize;
class Gradient;
class GraphicsContextState;
class Path;

Expand Down Expand Up @@ -76,6 +77,7 @@ enum class OrientationSizing {
struct FillSource {
FillSource() = default;
explicit FillSource(const GraphicsContextState&);
FillSource(const GraphicsContextState&, Gradient&, const AffineTransform&);

float globalAlpha { 0 };
struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ void GraphicsContextCairo::fillRect(const FloatRect& rect)
Cairo::fillRect(*this, rect, Cairo::FillSource(state), Cairo::ShadowState(state));
}

void GraphicsContextCairo::fillRect(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
auto& state = this->state();
Cairo::fillRect(*this, rect, Cairo::FillSource(state, gradient, gradientSpaceTransform), Cairo::ShadowState(state));
}

void GraphicsContextCairo::fillRect(const FloatRect& rect, const Color& color)
{
Cairo::fillRect(*this, rect, color, Cairo::ShadowState(state()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class WEBCORE_EXPORT GraphicsContextCairo final : public GraphicsContext {

using GraphicsContext::fillRect;
void fillRect(const FloatRect&) final;
void fillRect(const FloatRect&, Gradient&, const AffineTransform&) final;
void fillRect(const FloatRect&, const Color&) final;
void fillRoundedRectImpl(const FloatRoundedRect&, const Color&) final;
void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect&, const Color&) final;
Expand Down
49 changes: 28 additions & 21 deletions Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,27 +789,8 @@ void GraphicsContextCG::fillRect(const FloatRect& rect)
{
CGContextRef context = platformContext();

if (auto fillGradient = this->fillGradient()) {
CGContextStateSaver stateSaver(context);
if (hasDropShadow()) {
FloatSize layerSize = getCTM().mapSize(rect.size());

auto layer = adoptCF(CGLayerCreateWithContext(context, layerSize, 0));
CGContextRef layerContext = CGLayerGetContext(layer.get());

CGContextScaleCTM(layerContext, layerSize.width() / rect.width(), layerSize.height() / rect.height());
CGContextTranslateCTM(layerContext, -rect.x(), -rect.y());
CGContextAddRect(layerContext, rect);
CGContextClip(layerContext);

CGContextConcatCTM(layerContext, fillGradientSpaceTransform());
fillGradient->paint(layerContext);
CGContextDrawLayerInRect(context, rect, layer.get());
} else {
CGContextClipToRect(context, rect);
CGContextConcatCTM(context, fillGradientSpaceTransform());
fillGradient->paint(*this);
}
if (auto* fillGradient = this->fillGradient()) {
fillRect(rect, *fillGradient, fillGradientSpaceTransform());
return;
}

Expand All @@ -831,6 +812,32 @@ void GraphicsContextCG::fillRect(const FloatRect& rect)
CGContextFillRect(context, rect);
}

void GraphicsContextCG::fillRect(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
CGContextRef context = platformContext();

CGContextStateSaver stateSaver(context);
if (hasDropShadow()) {
FloatSize layerSize = getCTM().mapSize(rect.size());

auto layer = adoptCF(CGLayerCreateWithContext(context, layerSize, 0));
CGContextRef layerContext = CGLayerGetContext(layer.get());

CGContextScaleCTM(layerContext, layerSize.width() / rect.width(), layerSize.height() / rect.height());
CGContextTranslateCTM(layerContext, -rect.x(), -rect.y());
CGContextAddRect(layerContext, rect);
CGContextClip(layerContext);

CGContextConcatCTM(layerContext, gradientSpaceTransform);
gradient.paint(layerContext);
CGContextDrawLayerInRect(context, rect, layer.get());
} else {
CGContextClipToRect(context, rect);
CGContextConcatCTM(context, gradientSpaceTransform);
gradient.paint(*this);
}
}

void GraphicsContextCG::fillRect(const FloatRect& rect, const Color& color)
{
CGContextRef context = platformContext();
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/graphics/cg/GraphicsContextCG.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class WEBCORE_EXPORT GraphicsContextCG : public GraphicsContext {
using GraphicsContext::fillRect;
void fillRect(const FloatRect&) final;
void fillRect(const FloatRect&, const Color&) final;
void fillRect(const FloatRect&, Gradient&, const AffineTransform&) final;
void fillRoundedRectImpl(const FloatRoundedRect&, const Color&) final;
void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& roundedHoleRect, const Color&) final;
void clearRect(const FloatRect&) final;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class FillPath;
class FillRect;
class FillRectWithColor;
class FillRectWithGradient;
class FillRectWithGradientAndSpaceTransform;
class FillRectWithRoundedHole;
class FillRoundedRect;
class ResetClip;
Expand Down Expand Up @@ -154,6 +155,7 @@ using Item = std::variant
, FillRect
, FillRectWithColor
, FillRectWithGradient
, FillRectWithGradientAndSpaceTransform
, FillRectWithRoundedHole
, FillRoundedRect
, ResetClip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ FillRectWithGradient::FillRectWithGradient(FloatRect&& rect, Ref<Gradient>&& gra

void FillRectWithGradient::apply(GraphicsContext& context) const
{
context.fillRect(m_rect, m_gradient.get());
context.fillRect(m_rect, m_gradient);
}

void FillRectWithGradient::dump(TextStream& ts, OptionSet<AsTextFlag>) const
Expand All @@ -578,6 +578,32 @@ void FillRectWithGradient::dump(TextStream& ts, OptionSet<AsTextFlag>) const
ts.dumpProperty("rect", rect());
}

FillRectWithGradientAndSpaceTransform::FillRectWithGradientAndSpaceTransform(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
: m_rect(rect)
, m_gradient(gradient)
, m_gradientSpaceTransform(gradientSpaceTransform)
{
}

FillRectWithGradientAndSpaceTransform::FillRectWithGradientAndSpaceTransform(FloatRect&& rect, Ref<Gradient>&& gradient, AffineTransform&& gradientSpaceTransform)
: m_rect(WTFMove(rect))
, m_gradient(WTFMove(gradient))
, m_gradientSpaceTransform(WTFMove(gradientSpaceTransform))
{
}

void FillRectWithGradientAndSpaceTransform::apply(GraphicsContext& context) const
{
context.fillRect(m_rect, m_gradient, m_gradientSpaceTransform);
}

void FillRectWithGradientAndSpaceTransform::dump(TextStream& ts, OptionSet<AsTextFlag>) const
{
// FIXME: log gradient.
ts.dumpProperty("rect", rect());
ts.dumpProperty("gradient-space-transform", gradientSpaceTransform());
}

void FillCompositedRect::apply(GraphicsContext& context) const
{
context.fillRect(m_rect, m_color, m_op, m_blendMode);
Expand Down
22 changes: 21 additions & 1 deletion Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,27 @@ class FillRectWithGradient {

private:
FloatRect m_rect;
mutable Ref<Gradient> m_gradient; // FIXME: Make this not mutable
Ref<Gradient> m_gradient;
};

class FillRectWithGradientAndSpaceTransform {
public:
static constexpr char name[] = "fill-rect-with-gradient-and-space-transform";

WEBCORE_EXPORT FillRectWithGradientAndSpaceTransform(const FloatRect&, Gradient&, const AffineTransform&);
WEBCORE_EXPORT FillRectWithGradientAndSpaceTransform(FloatRect&&, Ref<Gradient>&&, AffineTransform&&);

const FloatRect& rect() const { return m_rect; }
const Ref<Gradient>& gradient() const { return m_gradient; }
const AffineTransform& gradientSpaceTransform() const { return m_gradientSpaceTransform; }

WEBCORE_EXPORT void apply(GraphicsContext&) const;
void dump(TextStream&, OptionSet<AsTextFlag>) const;

private:
FloatRect m_rect;
Ref<Gradient> m_gradient;
AffineTransform m_gradientSpaceTransform;
};

class FillCompositedRect {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ void Recorder::fillRect(const FloatRect& rect)
recordFillRect(rect);
}

void Recorder::fillRect(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
appendStateChangeItemIfNecessary();
recordFillRectWithGradientAndSpaceTransform(rect, gradient, gradientSpaceTransform);
}

void Recorder::fillRect(const FloatRect& rect, const Color& color)
{
appendStateChangeItemIfNecessary();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class Recorder : public GraphicsContext {
virtual void recordFillRect(const FloatRect&) = 0;
virtual void recordFillRectWithColor(const FloatRect&, const Color&) = 0;
virtual void recordFillRectWithGradient(const FloatRect&, Gradient&) = 0;
virtual void recordFillRectWithGradientAndSpaceTransform(const FloatRect&, Gradient&, const AffineTransform&) = 0;
virtual void recordFillCompositedRect(const FloatRect&, const Color&, CompositeOperator, BlendMode) = 0;
virtual void recordFillRoundedRect(const FloatRoundedRect&, const Color&, BlendMode) = 0;
virtual void recordFillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect&, const Color&) = 0;
Expand Down Expand Up @@ -211,6 +212,7 @@ class Recorder : public GraphicsContext {
WEBCORE_EXPORT void fillRect(const FloatRect&) final;
WEBCORE_EXPORT void fillRect(const FloatRect&, const Color&) final;
WEBCORE_EXPORT void fillRect(const FloatRect&, Gradient&) final;
WEBCORE_EXPORT void fillRect(const FloatRect&, Gradient&, const AffineTransform&) final;
WEBCORE_EXPORT void fillRect(const FloatRect&, const Color&, CompositeOperator, BlendMode) final;
WEBCORE_EXPORT void fillRoundedRect(const FloatRoundedRect&, const Color&, BlendMode) final;
WEBCORE_EXPORT void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& roundedHoleRect, const Color&) final;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ void RecorderImpl::recordFillRectWithGradient(const FloatRect& rect, Gradient& g
append(FillRectWithGradient(rect, gradient));
}

void RecorderImpl::recordFillRectWithGradientAndSpaceTransform(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
append(FillRectWithGradientAndSpaceTransform(rect, gradient, gradientSpaceTransform));
}

void RecorderImpl::recordFillCompositedRect(const FloatRect& rect, const Color& color, CompositeOperator op, BlendMode mode)
{
append(FillCompositedRect(rect, color, op, mode));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class RecorderImpl : public Recorder {
void recordFillRect(const FloatRect&) final;
void recordFillRectWithColor(const FloatRect&, const Color&) final;
void recordFillRectWithGradient(const FloatRect&, Gradient&) final;
void recordFillRectWithGradientAndSpaceTransform(const FloatRect&, Gradient&, const AffineTransform&) final;
void recordFillCompositedRect(const FloatRect&, const Color&, CompositeOperator, BlendMode) final;
void recordFillRoundedRect(const FloatRoundedRect&, const Color&, BlendMode) final;
void recordFillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect&, const Color&) final;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,26 @@ void CairoOperationRecorder::fillRect(const FloatRect& rect, Gradient& gradient)
append(createCommand<FillRect>(rect, gradient.createPattern(1.0, state.fillBrush().gradientSpaceTransform())));
}

void CairoOperationRecorder::fillRect(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
struct FillRect final : PaintingOperation, OperationData<FloatRect, Cairo::FillSource, Cairo::ShadowState> {
virtual ~FillRect() = default;

void execute(PaintingOperationReplay& replayer) override
{
Cairo::fillRect(contextForReplay(replayer), arg<0>(), arg<1>(), arg<2>());
}

void dump(TextStream& ts) override
{
ts << indent << "FillRect<>\n";
}
};

auto& state = this->state();
append(createCommand<FillRect>(rect, Cairo::FillSource(state, gradient, gradientSpaceTransform), Cairo::ShadowState(state)));
}

void CairoOperationRecorder::fillRect(const FloatRect& rect, const Color& color, CompositeOperator compositeOperator, BlendMode blendMode)
{
struct FillRect final : PaintingOperation, OperationData<FloatRect, Color, CompositeOperator, BlendMode, Cairo::ShadowState, CompositeOperator> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class CairoOperationRecorder final : public WebCore::GraphicsContext {
void fillRect(const WebCore::FloatRect&) override;
void fillRect(const WebCore::FloatRect&, const WebCore::Color&) override;
void fillRect(const WebCore::FloatRect&, WebCore::Gradient&) override;
void fillRect(const WebCore::FloatRect&, WebCore::Gradient&, const WebCore::AffineTransform&) override;
void fillRect(const WebCore::FloatRect&, const WebCore::Color&, WebCore::CompositeOperator, WebCore::BlendMode) override;
void fillRoundedRectImpl(const WebCore::FloatRoundedRect&, const WebCore::Color&) override { ASSERT_NOT_REACHED(); }
void fillRoundedRect(const WebCore::FloatRoundedRect&, const WebCore::Color&, WebCore::BlendMode) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,11 @@ void RemoteDisplayListRecorder::fillRectWithGradient(DisplayList::FillRectWithGr
handleItem(WTFMove(item));
}

void RemoteDisplayListRecorder::fillRectWithGradientAndSpaceTransform(DisplayList::FillRectWithGradientAndSpaceTransform&& item)
{
handleItem(WTFMove(item));
}

void RemoteDisplayListRecorder::fillCompositedRect(const FloatRect& rect, const Color& color, CompositeOperator op, BlendMode blendMode)
{
handleItem(DisplayList::FillCompositedRect(rect, color, op, blendMode));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class RemoteDisplayListRecorder : public IPC::StreamMessageReceiver, public CanM
void fillRect(const WebCore::FloatRect&);
void fillRectWithColor(const WebCore::FloatRect&, const WebCore::Color&);
void fillRectWithGradient(WebCore::DisplayList::FillRectWithGradient&&);
void fillRectWithGradientAndSpaceTransform(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform&&);
void fillCompositedRect(const WebCore::FloatRect&, const WebCore::Color&, WebCore::CompositeOperator, WebCore::BlendMode);
void fillRoundedRect(const WebCore::FloatRoundedRect&, const WebCore::Color&, WebCore::BlendMode);
void fillRectWithRoundedHole(const WebCore::FloatRect&, const WebCore::FloatRoundedRect&, const WebCore::Color&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ messages -> RemoteDisplayListRecorder NotRefCounted Stream {
FillRect(WebCore::FloatRect rect)
FillRectWithColor(WebCore::FloatRect rect, WebCore::Color color)
FillRectWithGradient(WebCore::DisplayList::FillRectWithGradient item)
FillRectWithGradientAndSpaceTransform(WebCore::DisplayList::FillRectWithGradientAndSpaceTransform item)
FillCompositedRect(WebCore::FloatRect rect, WebCore::Color color, enum:uint8_t WebCore::CompositeOperator op, enum:uint8_t WebCore::BlendMode blendMode)
FillRoundedRect(WebCore::FloatRoundedRect rect, WebCore::Color color, enum:uint8_t WebCore::BlendMode blendMode)
FillRectWithRoundedHole(WebCore::FloatRect rect, WebCore::FloatRoundedRect roundedHoleRect, WebCore::Color color)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ headers: <WebCore/DisplayListItems.h>
Ref<WebCore::Gradient> gradient();
};

[CustomHeader, AdditionalEncoder=StreamConnectionEncoder] class WebCore::DisplayList::FillRectWithGradientAndSpaceTransform {
WebCore::FloatRect rect();
Ref<WebCore::Gradient> gradient();
WebCore::AffineTransform gradientSpaceTransform();
};

[CustomHeader, AdditionalEncoder=StreamConnectionEncoder] class WebCore::DisplayList::FillCompositedRect {
WebCore::FloatRect rect();
WebCore::Color color();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ void RemoteDisplayListRecorderProxy::recordFillRectWithGradient(const FloatRect&
send(Messages::RemoteDisplayListRecorder::FillRectWithGradient(DisplayList::FillRectWithGradient { rect, gradient }));
}

void RemoteDisplayListRecorderProxy::recordFillRectWithGradientAndSpaceTransform(const FloatRect& rect, Gradient& gradient, const AffineTransform& gradientSpaceTransform)
{
send(Messages::RemoteDisplayListRecorder::FillRectWithGradientAndSpaceTransform(DisplayList::FillRectWithGradientAndSpaceTransform { rect, gradient, gradientSpaceTransform }));
}

void RemoteDisplayListRecorderProxy::recordFillCompositedRect(const FloatRect& rect, const Color& color, CompositeOperator op, BlendMode mode)
{
send(Messages::RemoteDisplayListRecorder::FillCompositedRect(rect, color, op, mode));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class RemoteDisplayListRecorderProxy : public WebCore::DisplayList::Recorder {
void recordFillRect(const WebCore::FloatRect&) final;
void recordFillRectWithColor(const WebCore::FloatRect&, const WebCore::Color&) final;
void recordFillRectWithGradient(const WebCore::FloatRect&, WebCore::Gradient&) final;
void recordFillRectWithGradientAndSpaceTransform(const WebCore::FloatRect&, WebCore::Gradient&, const WebCore::AffineTransform&) final;
void recordFillCompositedRect(const WebCore::FloatRect&, const WebCore::Color&, WebCore::CompositeOperator, WebCore::BlendMode) final;
void recordFillRoundedRect(const WebCore::FloatRoundedRect&, const WebCore::Color&, WebCore::BlendMode) final;
void recordFillRectWithRoundedHole(const WebCore::FloatRect&, const WebCore::FloatRoundedRect&, const WebCore::Color&) final;
Expand Down

0 comments on commit df59d72

Please sign in to comment.