24#include <initializer_list>
34 SkScalar pos[
count] = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6 };
45 const SkScalar cx = 128, cy = 128, rad = 100;
53 const SkRect r = {cx-50, cy-50, cx+50, cy+50};
54 const SkRect* drawrptr = useHintRect ? &r :
nullptr;
89 for (
bool useHintRect : {
false,
true}) {
90 for (
bool useClip : {
false,
true}) {
92 do_draw(canvas, useClip, useHintRect, 1.0f);
96 canvas->translate(256, 0);
100 canvas->translate(0, 256);
114 for (
bool useHintRect : {
false,
true}) {
115 for (
bool useClip : {
false,
true}) {
117 do_draw(canvas, useClip, useHintRect, 1.0f);
118 canvas->translate(256, 0);
119 do_draw(canvas, useClip, useHintRect, 0.25f);
120 canvas->translate(256, 0);
121 do_draw(canvas, useClip, useHintRect, 0.1f);
124 canvas->translate(0, 256);
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
DEF_SIMPLE_GM(backdrop_hintrect_clipping, canvas, 512, 1024)
static void do_draw(SkCanvas *canvas, bool useClip, bool useHintRect, SkScalar scaleFactor)
static sk_sp< SkShader > make_shader(SkScalar cx, SkScalar cy, SkScalar rad)
static SkCanvas::SaveLayerRec ScaledBackdropLayer(const SkRect *bounds, const SkPaint *paint, const SkImageFilter *backdrop, SkScalar backdropScale, SkCanvas::SaveLayerFlags saveLayerFlags, SkCanvas::FilterSpan filters={})
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
SkMatrix getLocalToDeviceAs3x3() const
SkImageInfo imageInfo() const
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static bool InverseMapRect(const SkMatrix &mx, SkRect *dst, const SkRect &src)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
PODArray< SkColor > colors
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 constexpr SkRect MakeWH(float w, float h)