37 return surface->makeImageSnapshot();
49 name.printf(
"persp_shaders_%s",
85 fPath.
lineTo(kCellSize/2.0f, kCellSize/2.0f);
111 canvas->
concat(fPerspMatrix);
117 canvas->
concat(fPerspMatrix);
123 canvas->
concat(fPerspMatrix);
129 canvas->
concat(fPerspMatrix);
135 canvas->
concat(fPerspMatrix);
141 canvas->
concat(fPerspMatrix);
142 canvas->
drawPath(fPath, gradPaint2);
150 fImage =
make_image(canvas, kCellSize, kCellSize);
166 inline static constexpr int kCellSize = 50;
167 inline static constexpr int kNumRows = 5;
168 inline static constexpr int kNumCols = 6;
178 using INHERITED =
GM;
180DEF_GM(
return new PerspShadersGM(
true);)
181DEF_GM(
return new PerspShadersGM(
false);)
197 for (
int i = 0;
i < 4; ++
i) {
199 for (
auto&
p : pts) {
202 path.moveTo(pts[0]).quadTo(pts[1], pts[2]).quadTo(pts[3], pts[4]).lineTo(pts[5]);
213 paint.setColor({0.75, 0.75, 0.75, 1});
221 -1.7866f, 1.3357f, 273.0295f,
222 -1.0820f, 1.3186f, 135.5196f,
223 -0.0047f, -0.0015f, 2.1485f,
227 paint.setShader(shader);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
static SkPoint rand_pt(SkRandom &rand)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void drawPath(const SkPath &path, const SkPaint &paint)
void concat(const SkMatrix &matrix)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
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)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
virtual bool isValid(GrRecordingContext *context) const =0
static SkMatrix Scale(SkScalar sx, SkScalar sy)
SkMatrix & set9(const SkScalar buffer[9])
SkMatrix & setPerspY(SkScalar v)
void setAntiAlias(bool aa)
void setShader(sk_sp< SkShader > shader)
SkPath & moveTo(SkScalar x, SkScalar y)
SkPath & lineTo(SkScalar x, SkScalar y)
GM(SkColor backgroundColor=SK_ColorWHITE)
void onDraw(SkCanvas *canvas) override
void onOnceBeforeDraw() override
SkString getName() const override
void drawRow(SkCanvas *canvas, const SkSamplingOptions &sampling)
SkISize getISize() override
PerspShadersGM(bool doAA)
PODArray< SkColor > colors
SkSamplingOptions sampling
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
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
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
SkSamplingOptions(SkFilterMode::kLinear))
static sk_sp< SkImage > make_image(SkColorType colorType, SkAlphaType alphaType)
DEF_SIMPLE_GM(perspective_clip, canvas, 800, 800)
static sk_sp< SkImage > make_image(SkCanvas *origCanvas, int w, int h)
static SkPath make_path()
static constexpr SkCubicResampler Mitchell()
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkSamplingOptions Aniso(int maxAniso)