18#if defined(SK_GRAPHITE)
44 fStartX = kTileWidth * (1.0f + sinf(nanos * 1
e-9)) * 0.5f;
49#if defined(SK_GRAPHITE)
52 this->drawGraphite(canvas, recorder);
56 return this->drawNonGraphite(canvas, errorMsg);
60 static constexpr int kImageSize = 128;
61 static constexpr int kPadding = 2;
62 static constexpr int kPaddedImageSize = kImageSize + kPadding * 2;
63 static constexpr int kTileWidth = kPaddedImageSize * 2;
64 static constexpr int kTileHeight = kPaddedImageSize * 2;
70 void drawContent(
SkCanvas* canvas,
int y) {
72 constexpr SkPoint points[2] = {{0.0f, 0.0f}, {kImageSize, kImageSize}};
78 canvas->
drawImage(fImage, kPadding, kPadding +
y);
82 canvas->
translate(kPaddedImageSize + kPadding, kPadding +
y);
93 drawContent(canvas, 0);
99 drawContent(canvas, kPaddedImageSize);
103#if defined(SK_GRAPHITE)
109 ->backingTextureProxy()
113 std::unique_ptr<skgpu::graphite::Recorder> recorder =
114 context->
makeRecorder(ToolUtils::CreateTestingRecorderOptions());
115 SkCanvas* recordingCanvas = recorder->makeDeferredCanvas(tileImageInfo, textureInfo);
116 this->drawTile(recordingCanvas);
117 std::unique_ptr<skgpu::graphite::Recording> recording = recorder->snap();
120 std::unique_ptr<skgpu::graphite::Recording> canvasRecording = canvasRecorder->
snap();
123 for (
int y = 0;
y < 2; ++
y) {
124 for (
int x = 0;
x < 2; ++
x) {
128 {x * kTileWidth + SkScalarRoundToInt(fStartX), y * kTileHeight}});
140 *errorMsg =
"Cannot create new SkSurface.";
145 this->drawTile(imageCanvas);
148 for (
int y = 0;
y < 2; ++
y) {
149 for (
int x = 0;
x < 2; ++
x) {
157DEF_GM(
return new GraphiteReplayGM;)
static const int points[]
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
SkSurface * getSurface() const
void translate(SkScalar dx, SkScalar dy)
sk_sp< SkSurface > makeSurface(const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
void clipIRect(const SkIRect &irect, SkClipOp op=SkClipOp::kIntersect)
virtual skgpu::graphite::Recorder * recorder() const
void clear(SkColor color)
SkImageInfo imageInfo() const
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)
void setShader(sk_sp< SkShader > shader)
sk_sp< SkImage > makeImageSnapshot()
std::unique_ptr< Recorder > makeRecorder(const RecorderOptions &={})
bool insertRecording(const InsertRecordingInfo &)
std::unique_ptr< Recording > snap()
skiagm::DrawResult DrawResult
void onOnceBeforeDraw() override
GraphiteReplayGM()=default
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
SkISize getISize() override
SkString getName() const override
bool onAnimate(double nanos) override
sk_sp< const SkImage > image
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
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static constexpr SkISize Make(int32_t w, int32_t h)
SkImageInfo makeDimensions(SkISize newSize) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)