5#include "flutter/shell/platform/fuchsia/flutter/canvas_spy.h"
12 std::make_unique<SkNWayCanvas>(canvas_size.
width(), canvas_size.
height());
13 did_draw_canvas_ = std::make_unique<DidDrawCanvas>(canvas_size.
width(),
15 n_way_canvas_->addCanvas(target_canvas);
16 n_way_canvas_->addCanvas(did_draw_canvas_.get());
25 return n_way_canvas_.get();
33void DidDrawCanvas::MarkDrawIfNonTransparentPaint(
const SkPaint&
paint) {
34 bool isTransparent =
paint.getAlpha() == 0;
35 did_draw_ |= !isTransparent;
39 return did_draw_canvas_->DidDrawIntoCanvas();
46void DidDrawCanvas::willSave() {}
49 const SaveLayerRec& rec) {
53bool DidDrawCanvas::onDoSaveBehind(
const SkRect*
bounds) {
57void DidDrawCanvas::willRestore() {}
59void DidDrawCanvas::didConcat44(
const SkM44&) {}
65void DidDrawCanvas::onClipRect(
const SkRect&
rect,
67 ClipEdgeStyle edgeStyle) {}
71 ClipEdgeStyle edgeStyle) {}
73void DidDrawCanvas::onClipPath(
const SkPath&
path,
75 ClipEdgeStyle edgeStyle) {}
80 MarkDrawIfNonTransparentPaint(
paint);
84 MarkDrawIfNonTransparentPaint(
paint);
91 MarkDrawIfNonTransparentPaint(
paint);
95 MarkDrawIfNonTransparentPaint(
paint);
99 MarkDrawIfNonTransparentPaint(
paint);
103 MarkDrawIfNonTransparentPaint(
paint);
106void DidDrawCanvas::onDrawArc(
const SkRect&
rect,
111 MarkDrawIfNonTransparentPaint(
paint);
115 MarkDrawIfNonTransparentPaint(
paint);
118void DidDrawCanvas::onDrawDRRect(
const SkRRect& outer,
121 MarkDrawIfNonTransparentPaint(
paint);
125 MarkDrawIfNonTransparentPaint(
paint);
128#ifdef SK_SUPPORT_LEGACY_ONDRAWIMAGERECT
136void DidDrawCanvas::onDrawImageRect(
const SkImage*
image,
140 SrcRectConstraint constraint) {
144void DidDrawCanvas::onDrawImageLattice(
const SkImage*
image,
145 const Lattice& lattice,
162void DidDrawCanvas::onDrawEdgeAAImageSet(
const ImageSetEntry
set[],
167 SrcRectConstraint constraint) {
180void DidDrawCanvas::onDrawImageRect2(
const SkImage*
image,
185 SrcRectConstraint constraint) {
189void DidDrawCanvas::onDrawImageLattice2(
const SkImage*
image,
190 const Lattice& lattice,
201 MarkDrawIfNonTransparentPaint(
paint);
210void DidDrawCanvas::onDrawDrawable(
SkDrawable* drawable,
215void DidDrawCanvas::onDrawVerticesObject(
const SkVertices* vertices,
218 MarkDrawIfNonTransparentPaint(
paint);
226 MarkDrawIfNonTransparentPaint(
paint);
241void DidDrawCanvas::onDrawShadowRec(
const SkPath&
path,
246void DidDrawCanvas::onDrawAnnotation(
const SkRect&
rect,
252void DidDrawCanvas::onDrawEdgeAAQuad(
const SkRect&
rect,
260void DidDrawCanvas::onDrawEdgeAAImageSet2(
const ImageSetEntry
set[],
266 SrcRectConstraint constraint) {
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
virtual SkISize getBaseLayerSize() const
@ kNoLayer_SaveLayerStrategy
SkCanvas * GetRawSpyingCanvas()
The underlying Skia canvas that implements the spying (mainly for testing)
CanvasSpy(SkCanvas *target_canvas)
bool DidDrawIntoCanvas()
Returns true if any non transparent content has been drawn into the spying canvas....
DlCanvas * GetSpyingCanvas()
The returned canvas delegate all operations to the target canvas while spying on them.
virtual void onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
DidDrawCanvas(int width, int height)
~DidDrawCanvas() override
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode, const SkPaint &paint) override
Developer-facing API for rendering anything within the engine.
void set_canvas(SkCanvas *canvas)
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
PODArray< SkPoint > dstClips
sk_sp< const SkImage > image
ClipOpAndAA opAA SkRegion region
sk_sp< const SkPicture > picture
sk_sp< SkBlender > blender SkRect rect
PODArray< SkMatrix > preViewMatrices
PODArray< SkColor > colors
DlCanvas::PointMode PointMode
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
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
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
constexpr int32_t width() const
constexpr int32_t height() const