Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DM::RasterSink Class Reference

#include <DMSrcSink.h>

Inheritance diagram for DM::RasterSink:
DM::Sink

Public Member Functions

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

Detailed Description

Definition at line 515 of file DMSrcSink.h.

Constructor & Destructor Documentation

◆ RasterSink()

DM::RasterSink::RasterSink ( SkColorType  colorType)
explicit

Definition at line 2119 of file DMSrcSink.cpp.

2120 : fColorType(colorType) {}
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)

Member Function Documentation

◆ colorInfo()

SkColorInfo DM::RasterSink::colorInfo ( ) const
inlineoverridevirtual

Returns the color type and space used by the sink.

Reimplemented from DM::Sink.

Definition at line 524 of file DMSrcSink.h.

524 {
525 // If there's an appropriate alpha type for this color type, use it, otherwise use premul.
527 (void)SkColorTypeValidateAlphaType(fColorType, alphaType, &alphaType);
528
529 return SkColorInfo(fColorType, alphaType, fColorSpace);
530 }
SkAlphaType
Definition SkAlphaType.h:26
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
SK_API bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, SkAlphaType *canonical=nullptr)

◆ draw()

Result DM::RasterSink::draw ( const Src src,
SkBitmap dst,
SkWStream ,
SkString  
) const
overridevirtual

Implements DM::Sink.

Definition at line 2122 of file DMSrcSink.cpp.

2122 {
2123 const SkISize size = src.size();
2124 if (size.isEmpty()) {
2125 return Result(Result::Status::Skip,
2126 SkStringPrintf("Skipping empty source: %s", src.name().c_str()));
2127 }
2128
2129 dst->allocPixelsFlags(SkImageInfo::Make(size, this->colorInfo()),
2131
2132 SkSurfaceProps props(/*flags=*/0, kRGB_H_SkPixelGeometry);
2133 auto surface = SkSurfaces::WrapPixels(dst->pixmap(), &props);
2134 return src.draw(surface->getCanvas(), /*GraphiteTestContext=*/nullptr);
2135}
SK_API SkString static SkString SkStringPrintf()
Definition SkString.h:287
@ kRGB_H_SkPixelGeometry
SkColorInfo colorInfo() const override
Definition DMSrcSink.h:524
@ kZeroPixels_AllocFlag
zero pixel memory. No effect. This is the default.
Definition SkBitmap.h:435
VkSurfaceKHR surface
Definition main.cc:49
SK_API sk_sp< SkSurface > WrapPixels(const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, const SkSurfaceProps *surfaceProps=nullptr)
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
dst
Definition cp.py:12
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)

◆ fileExtension()

const char * DM::RasterSink::fileExtension ( ) const
inlineoverridevirtual

Implements DM::Sink.

Definition at line 520 of file DMSrcSink.h.

520{ return "png"; }

◆ flags()

SinkFlags DM::RasterSink::flags ( ) const
inlineoverridevirtual

Implements DM::Sink.

Definition at line 521 of file DMSrcSink.h.

521{ return SinkFlags{ SinkFlags::kRaster, SinkFlags::kDirect }; }

◆ setColorSpace()

void DM::RasterSink::setColorSpace ( sk_sp< SkColorSpace colorSpace)
inlineoverridevirtual

Reimplemented from DM::Sink.

Definition at line 522 of file DMSrcSink.h.

522{ fColorSpace = colorSpace; }

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