37 std::vector<FilterNode> fInputNodes;
68 this->computeInputBounds();
69 this->computeOutputBounds();
71 fInputNodes.reserve(fFilter->countInputs());
72 for (
int i = 0;
i < fFilter->countInputs(); ++
i) {
73 fInputNodes.emplace_back(fFilter->getInput(
i), mapping,
content, depth + 1);
79 void computeOutputBounds() {
85 std::optional<skif::DeviceSpace<SkIRect>> pseudoDeviceBounds =
88 if (pseudoDeviceBounds) {
89 fOutputBounds = layerOnly.deviceToLayer(*pseudoDeviceBounds);
95 fOutputBounds = fMapping.
paramToLayer(fContent).roundOut();
99 for (
size_t i = 0;
i < fInputNodes.size(); ++
i) {
100 fInputNodes[
i].computeOutputBounds();
104 void computeInputBounds() {
115 fHintedLayerBounds = fMapping.
paramToLayer(fContent).roundOut();
130 return FilterNode(rootFilter, mapping,
content, 0);
148 line.setStrokeWidth(0.f);
152 canvas->
concat(node.fMapping.layerToDevice());
154 canvas->
concat(node.fMapping.layerMatrix());
180 static const SkScalar kDashParams[] = {6.f, 12.f};
194 for (
int i = 0;
i < 3; ++
i) {
196 row.
appendf(
"[%.2f %.2f %.2f]",
217 text.setAntiAlias(
true);
223 if (node.fDepth == 0) {
225 y =
print_matrix(canvas,
"Param->Layer", node.fMapping.layerMatrix(),
229 node.fMapping.layerToDevice(),
264 line.setAntiAlias(
true);
266 line.setStrokeWidth(3.f);
278 static const float kPad = 20.f;
281 for (
size_t i = 0;
i < node.fInputNodes.size(); ++
i) {
287 y +=
draw_dag(canvas, nodeSurface, node.fInputNodes[
i]);
334 draw_dag(canvas, merge0.
get(), kFilterRect, kFilterSurfaceSize);
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static const int points[]
static FilterNode build_dag(const SkMatrix &ctm, const SkRect &rect, const SkImageFilter *rootFilter)
static float print_matrix(SkCanvas *canvas, const char *prefix, const SkMatrix &matrix, float x, float y, const SkFont &font, const SkPaint &paint)
static constexpr float kLineHeight
static float print_size(SkCanvas *canvas, const char *prefix, const SkIRect &rect, float x, float y, const SkFont &font, const SkPaint &paint)
static float print_info(SkCanvas *canvas, const FilterNode &node)
static void draw_node(SkCanvas *canvas, const FilterNode &node)
static constexpr float kLineInset
static float draw_dag(SkCanvas *canvas, SkSurface *nodeSurface, const FilterNode &node)
constexpr SkColor SK_ColorLTGRAY
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
static SkImageFilter_Base * as_IFB(SkImageFilter *filter)
sk_sp< T > sk_ref_sp(T *obj)
static SkScalar center(float pos0, float pos1)
void draw(SkCanvas *canvas) override
SkISize getDimensions() const override
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void clear(SkColor color)
SkMatrix getTotalMatrix() const
void concat(const SkMatrix &matrix)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
std::optional< skif::DeviceSpace< SkIRect > > getOutputBounds(const skif::Mapping &mapping, const skif::ParameterSpace< SkRect > &contentBounds) const
skif::LayerSpace< SkIRect > getInputBounds(const skif::Mapping &mapping, const skif::DeviceSpace< SkIRect > &desiredOutput, std::optional< skif::ParameterSpace< SkRect > > knownContentBounds) const
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DropShadow(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor color, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Merge(sk_sp< SkImageFilter > *const filters, int count, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
@ kStroke_Style
set to stroke geometry
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
sk_sp< SkImage > makeImageSnapshot()
const SkMatrix & deviceToLayer() const
SkMatrix totalMatrix() const
const SkMatrix & layerMatrix() const
LayerSpace< T > paramToLayer(const ParameterSpace< T > ¶mGeometry) const
static float max(float r, float g, float b)
union flutter::testing::@2836::KeyboardChange::@76 content
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
SK_API sk_sp< SkShader > Empty()
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
font
Font Metadata and Metrics.
static constexpr SkISize Make(int32_t w, int32_t h)
SkImageInfo makeDimensions(SkISize newSize) const
static SkRect Make(const SkISize &size)
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkRect makeOutset(float dx, float dy) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
SkScalar fRight
larger x-axis bounds
static constexpr SkRect MakeWH(float w, float h)
SkScalar fTop
smaller y-axis bounds