Flutter Engine
 
Loading...
Searching...
No Matches
impeller::skia_conversions Namespace Reference

Functions

Color ToColor (const flutter::DlColor &color)
 
impeller::SamplerDescriptor ToSamplerDescriptor (const flutter::DlImageSampling options)
 

Function Documentation

◆ ToColor()

Color impeller::skia_conversions::ToColor ( const flutter::DlColor color)

Definition at line 13 of file skia_conversions.cc.

13 {
16 return {
17 static_cast<Scalar>(color.getRedF()), //
18 static_cast<Scalar>(color.getGreenF()), //
19 static_cast<Scalar>(color.getBlueF()), //
20 static_cast<Scalar>(color.getAlphaF()) //
21 };
22}
#define FML_DCHECK(condition)
Definition logging.h:122
float Scalar
Definition scalar.h:19
constexpr DlColorSpace getColorSpace() const
Definition dl_color.h:118
constexpr DlScalar getRedF() const
Definition dl_color.h:114
constexpr DlScalar getAlphaF() const
Definition dl_color.h:113
constexpr DlScalar getBlueF() const
Definition dl_color.h:116
constexpr DlScalar getGreenF() const
Definition dl_color.h:115

References FML_DCHECK, flutter::DlColor::getAlphaF(), flutter::DlColor::getBlueF(), flutter::DlColor::getColorSpace(), flutter::DlColor::getGreenF(), flutter::DlColor::getRedF(), flutter::kExtendedSRGB, and flutter::kSRGB.

Referenced by impeller::Paint::ConvertStops(), impeller::DlAtlasGeometry::CreateBlendVertexBuffer(), impeller::DlDispatcherBase::drawColor(), impeller::DlDispatcherBase::drawShadow(), impeller::GetCPUColorFilterProc(), impeller::DlVerticesGeometry::GetPositionUVColorBuffer(), impeller::DlDispatcherBase::setColor(), impeller::FirstPassDispatcher::setColor(), impeller::testing::TEST(), and impeller::WrapWithGPUColorFilter().

◆ ToSamplerDescriptor()

impeller::SamplerDescriptor impeller::skia_conversions::ToSamplerDescriptor ( const flutter::DlImageSampling  options)

Definition at line 24 of file skia_conversions.cc.

25 {
27 switch (options) {
31 desc.label = "Nearest Sampler";
32 break;
36 desc.label = "Linear Sampler";
37 break;
42 desc.label = "Mipmap Linear Sampler";
43 break;
44 }
45 return desc;
46}
@ kLinear
Sample from the two nearest mip levels and linearly interpolate.
@ kBase
The texture is sampled as if it only had a single mipmap level.
@ kNearest
Select nearest to the sample point. Most widely supported.

References impeller::kBase, flutter::kCubic, flutter::kLinear, impeller::kLinear, flutter::kMipmapLinear, impeller::kNearest, flutter::kNearestNeighbor, impeller::SamplerDescriptor::label, impeller::SamplerDescriptor::mag_filter, impeller::SamplerDescriptor::min_filter, and impeller::SamplerDescriptor::mip_filter.

Referenced by impeller::Paint::CreateContents(), impeller::DlDispatcherBase::drawAtlas(), impeller::DlDispatcherBase::drawImageRect(), impeller::Canvas::DrawVertices(), impeller::testing::TEST(), and impeller::WrapInput().