48 blending_mode_ = mode;
70 return inputs_.back();
76 return inputs_.back();
81 inputs_.emplace_back(
input,
input->extents(), dx, dy);
82 return inputs_.back();
90 return inputs_.back();
100 if (inputs_.empty())
return Box(0, 0, -1, -1);
102 for (
size_t i = 1;
i < inputs_.size();
i++) {
109 std::unique_ptr<PixelStream>
createStream()
const override;
112 std::unique_ptr<PixelStream>
createStream(
const Box& clip_box)
const override;
123 void drawTo(
const Surface&
s)
const override;
127 std::vector<Input> inputs_;
Axis-aligned integer rectangle.
Box translate(int16_t x_offset, int16_t y_offset) const
Return a translated copy of this box.
static Box Extent(const Box &a, const Box &b)
Return the smallest box that contains both input boxes.
static Box Intersect(const Box &a, const Box &b)
Return the intersection of two boxes (may be empty).
Multi-layer stack of streamables composited in order.
Input & addInput(const Streamable *input)
Add an input using its full extents.
void setAnchorExtents(const Box &anchor_extents)
Set anchor extents used for alignment.
Box anchorExtents() const override
Return the bounds used for alignment.
Input & addInput(const Streamable *input, uint16_t dx, uint16_t dy)
Add an input with an offset.
Box extents() const override
Return the overall extents of the stack.
Input & addInput(const Streamable *input, Box clip_box, uint16_t dx, uint16_t dy)
Add an input with an offset and clip box.
std::unique_ptr< PixelStream > createStream() const override
Create a stream for the full stack.
void setExtents(const Box &extents)
Set the stack extents.
Input & addInput(const Streamable *input, Box clip_box)
Add an input clipped to clip_box.
Box naturalExtents()
Return minimal extents that fit all inputs without clipping.
StreamableStack(const Box &extents)
Create a stack with the given extents.
Drawable that can provide a sequential pixel stream.
virtual std::unique_ptr< PixelStream > createStream() const =0
Create a stream covering the full extents().
Low-level handle used to draw to an underlying device.
Defines 140 opaque HTML named colors.
BlendingMode
Porter-Duff style blending modes.
@ kSourceOver
Source is placed (alpha-blended) over the destination. This is the default blending mode.