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

#include <DMSrcSink.h>

Inheritance diagram for DM::ViaSerialization:
DM::Via DM::Sink

Public Member Functions

 ViaSerialization (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 664 of file DMSrcSink.h.

Constructor & Destructor Documentation

◆ ViaSerialization()

DM::ViaSerialization::ViaSerialization ( Sink sink)
inlineexplicit

Definition at line 666 of file DMSrcSink.h.

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

Member Function Documentation

◆ draw()

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

Implements DM::Sink.

Definition at line 2525 of file DMSrcSink.cpp.

2526 {
2527 // Record our Src into a picture.
2528 auto size = src.size();
2529 SkPictureRecorder recorder;
2530 Result result = src.draw(recorder.beginRecording(SkIntToScalar(size.width()),
2531 SkIntToScalar(size.height())),
2532 /*GraphiteTestContext=*/nullptr);
2533 if (!result.isOk()) {
2534 return result;
2535 }
2537
2539 // Serialize it and then deserialize it.
2540 sk_sp<SkPicture> deserialized = SkPicture::MakeFromData(pic->serialize(&procs).get());
2541
2543 [&](SkCanvas* canvas, Src::GraphiteTestContext*) {
2544 canvas->drawPicture(deserialized);
2545 return Result::Ok();
2546 });
2547 if (!result.isOk()) {
2548 return result;
2549 }
2550
2551 return check_against_reference(bitmap, src, fSink.get());
2552}
#define SkIntToScalar(x)
Definition: SkScalar.h:57
std::unique_ptr< Sink > fSink
Definition: DMSrcSink.h:643
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
static sk_sp< SkPicture > MakeFromData(const SkData *data, const SkDeserialProcs *procs=nullptr)
Definition: SkPicture.cpp:160
GAsyncResult * result
static SkSerialProcs serial_procs_using_png()
Definition: DMSrcSink.cpp:2050
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
static Result check_against_reference(const SkBitmap *bitmap, const Src &src, Sink *sink)
Definition: DMSrcSink.cpp:2449
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 keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
skiatest::graphite::GraphiteTestContext GraphiteTestContext
Definition: DMSrcSink.h:93

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