5#include "flutter/shell/platform/fuchsia/flutter/canvas_spy.h"
7#include "gtest/gtest.h"
14TEST(CanvasSpyTest, DrawingIsTracked) {
31TEST(CanvasSpyTest, SpiedCanvasIsDrawing) {
34 SkCanvas* actual_canvas = actual_surface->getCanvas();
36 auto expected_surface =
38 SkCanvas* expected_canvas = expected_surface->getCanvas();
49 multi_canvas.
scale(.5, .5);
58 ASSERT_TRUE(actual_surface->peekPixels(&actual));
59 ASSERT_TRUE(expected_surface->peekPixels(&expected));
64 ASSERT_EQ(::memcmp(actual.
addr(), expected.
addr(),
size), 0);
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void clear(SkColor color)
void scale(SkScalar sx, SkScalar sy)
virtual void addCanvas(SkCanvas *)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
const void * addr() const
SkCanvas * GetRawSpyingCanvas()
The underlying Skia canvas that implements the spying (mainly for testing)
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.
Developer-facing API for rendering anything within the engine.
virtual void DrawCircle(const SkPoint ¢er, SkScalar radius, const DlPaint &paint)=0
virtual void Translate(SkScalar tx, SkScalar ty)=0
void Clear(DlColor color)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
TEST(DisplayListComplexity, EmptyDisplayList)
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
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)
static constexpr DlColor kTransparent()