Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
DM::ViaRuntimeBlend Class Reference

#include <DMSrcSink.h>

Inheritance diagram for DM::ViaRuntimeBlend:
DM::Via DM::Sink

Public Member Functions

 ViaRuntimeBlend (Sink *sink)
 
Result draw (const Src &, SkBitmap *, SkWStream *, SkString *) const override
 
- Public Member Functions inherited from DM::Via
 Via (Sink *sink)
 
const char * fileExtension () const override
 
bool serial () const override
 
SinkFlags flags () const override
 
void setColorSpace (sk_sp< SkColorSpace > colorSpace) override
 
- Public Member Functions inherited from DM::Sink
virtual ~Sink ()
 
virtual Result draw (const Src &, SkBitmap *, SkWStream *, SkString *log) const =0
 
virtual void setColorSpace (sk_sp< SkColorSpace >)
 
virtual bool serial () const
 
virtual const char * fileExtension () const =0
 
virtual SinkFlags flags () const =0
 
virtual SkColorInfo colorInfo () const
 

Additional Inherited Members

- Protected Attributes inherited from DM::Via
std::unique_ptr< SinkfSink
 

Detailed Description

Definition at line 676 of file DMSrcSink.h.

Constructor & Destructor Documentation

◆ ViaRuntimeBlend()

DM::ViaRuntimeBlend::ViaRuntimeBlend ( Sink sink)
inlineexplicit

Definition at line 678 of file DMSrcSink.h.

678: Via(sink) {}
Via(Sink *sink)
Definition: DMSrcSink.h:631

Member Function Documentation

◆ draw()

Result DM::ViaRuntimeBlend::draw ( const Src src,
SkBitmap bitmap,
SkWStream stream,
SkString log 
) const
overridevirtual

Implements DM::Sink.

Definition at line 2581 of file DMSrcSink.cpp.

2584 {
2585 class RuntimeBlendFilterCanvas : public SkPaintFilterCanvas {
2586 public:
2587 RuntimeBlendFilterCanvas(SkCanvas* canvas) : INHERITED(canvas) { }
2588
2589 protected:
2590 bool onFilter(SkPaint& paint) const override {
2591 if (std::optional<SkBlendMode> mode = paint.asBlendMode()) {
2593 }
2594 return true;
2595 }
2596
2597 private:
2599 };
2600
2601 return draw_to_canvas(fSink.get(), bitmap, stream, log, src.size(),
2602 [&](SkCanvas* canvas, Src::GraphiteTestContext* testContext) {
2603 RuntimeBlendFilterCanvas runtimeBlendCanvas{canvas};
2604 return src.draw(&runtimeBlendCanvas, testContext);
2605 });
2606}
sk_sp< SkBlender > GetRuntimeBlendForBlendMode(SkBlendMode mode)
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
std::unique_ptr< Sink > fSink
Definition: DMSrcSink.h:643
const Paint & paint
Definition: color_source.cc:38
static void draw_to_canvas(SkCanvas *canvas, const SkImageInfo &info, void *pixels, size_t rowBytes, CodecSrc::DstColorType dstColorType, SkScalar left=0, SkScalar top=0)
Definition: DMSrcSink.cpp:456
Definition: bitmap.py:1
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228
skiatest::graphite::GraphiteTestContext GraphiteTestContext
Definition: DMSrcSink.h:93

The documentation for this class was generated from the following files: