MCPcopy Create free account
hub / github.com/dejwk/roo_display / drawTo

Method drawTo

src/roo_display/composition/streamable_stack.cpp:761–788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759} // namespace
760
761void StreamableStack::drawTo(const Surface& s) const {
762 Box bounds = Box::Intersect(s.clip_box(), extents_.translate(s.dx(), s.dy()));
763 if (bounds.empty()) return;
764 std::vector<internal::BufferingStream> streams;
765 std::vector<BlendingMode> blending_modes;
766 Composition composition(bounds);
767 for (const auto& input : inputs_) {
768 Box extents =
769 Box::Intersect(input.extents(), bounds.translate(-s.dx(), -s.dy()));
770 if (composition.Add(extents.translate(s.dx(), s.dy()),
771 input.blending_mode())) {
772 streams.emplace_back(input.createStream(extents), extents.area());
773 } else {
774 streams.emplace_back(nullptr, 0);
775 }
776 blending_modes.push_back(input.blending_mode());
777 }
778
779 Program prg;
780 composition.Compile(&prg);
781 Engine engine(&prg);
782 if (s.fill_mode() == FillMode::kExtents) {
783 WriteRect(&engine, bounds, &*streams.begin(), &*blending_modes.begin(), s);
784 } else {
785 WriteVisible(&engine, bounds, &*streams.begin(), &*blending_modes.begin(),
786 s);
787 }
788}
789
790std::unique_ptr<PixelStream> StreamableStack::createStream() const {
791 Box bounds = extents();

Callers

nothing calls this directly

Calls 15

WriteRectFunction · 0.85
WriteVisibleFunction · 0.85
clip_boxMethod · 0.80
AddMethod · 0.80
CompileMethod · 0.80
translateMethod · 0.45
dxMethod · 0.45
dyMethod · 0.45
emptyMethod · 0.45
extentsMethod · 0.45
blending_modeMethod · 0.45
createStreamMethod · 0.45

Tested by

no test coverage detected