Flutter Engine
The Flutter Engine
DMSrcSink.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef DMSrcSink_DEFINED
9#define DMSrcSink_DEFINED
10
11#include "gm/gm.h"
15#include "include/core/SkData.h"
22
23#include <functional>
24
25//#define TEST_VIA_SVG
26
28class VerifierList;
29}
30namespace DM {
31
32// This is just convenience. It lets you use either return "foo" or return SkStringPrintf(...).
33struct ImplicitString : public SkString {
34 template <typename T>
35 ImplicitString(const T& s) : SkString(s) {}
37};
40
41class Result {
42public:
43 enum class Status : int { Ok, Fatal, Skip };
44
45 Result(Status status, SkString msg) : fMsg(std::move(msg)), fStatus(status) {}
46
47 Result(const Result&) = default;
48 Result& operator=(const Result&) = default;
49
50 static Result Ok() { return Result{Status::Ok, {}}; }
51
52 static Result Fatal(const char* fmt, ...) SK_PRINTF_LIKE(1, 2) {
53 SkString msg;
54 va_list args;
58
59 return Result{Status::Fatal, std::move(msg)};
60 }
61
62 static Result Skip(const char* fmt, ...) SK_PRINTF_LIKE(1, 2) {
63 SkString msg;
64 va_list args;
68
69 return Result{Status::Skip, std::move(msg)};
70 }
71
72 bool isOk() { return fStatus == Status::Ok; }
73 bool isFatal() { return fStatus == Status::Fatal; }
74 bool isSkip() { return fStatus == Status::Skip; }
75
76 const char* c_str() const { return fMsg.c_str(); }
77 Status status() const { return fStatus; }
78
79private:
80 SkString fMsg;
81 Status fStatus;
82};
83
84struct SinkFlags {
89 : type(t), approach(a), multisampled(ms) {}
90};
91
92struct Src {
94
95 virtual ~Src() {}
96 [[nodiscard]] virtual Result draw(SkCanvas* canvas, GraphiteTestContext*) const = 0;
97 virtual SkISize size() const = 0;
98 virtual Name name() const = 0;
101 virtual bool veto(SinkFlags) const { return false; }
102
103 virtual int pageCount() const { return 1; }
104 [[nodiscard]] virtual Result draw([[maybe_unused]] int page,
105 SkCanvas* canvas,
106 GraphiteTestContext* graphiteTestContext) const {
107 return this->draw(canvas, graphiteTestContext);
108 }
109 virtual SkISize size([[maybe_unused]] int page) const { return this->size(); }
110 // Force Tasks using this Src to run on the main thread?
111 virtual bool serial() const { return false; }
112};
113
114struct Sink {
115 virtual ~Sink() {}
116 // You may write to either the bitmap or stream. If you write to log, we'll print that out.
117 [[nodiscard]] virtual Result draw(const Src&, SkBitmap*, SkWStream*, SkString* log) const = 0;
118
119 // Override the color space of this Sink, after creation
121
122 // Force Tasks using this Sink to run on the main thread?
123 virtual bool serial() const { return false; }
124
125 // File extension for the content draw() outputs, e.g. "png", "pdf".
126 virtual const char* fileExtension() const = 0;
127
128 virtual SinkFlags flags() const = 0;
129
130 /** Returns the color type and space used by the sink. */
131 virtual SkColorInfo colorInfo() const { return SkColorInfo(); }
132};
133
134/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
135
136class GMSrc : public Src {
137public:
138 explicit GMSrc(skiagm::GMFactory);
139
140 Result draw(SkCanvas*, GraphiteTestContext*) const override;
141 SkISize size() const override;
142 Name name() const override;
143 void modifyGrContextOptions(GrContextOptions* options) const override;
144#if defined(SK_GRAPHITE)
146#endif
147
148private:
149 skiagm::GMFactory fFactory;
150};
151
152class CodecSrc : public Src {
153public:
154 enum Mode {
156 // We choose to test only one mode with zero initialized memory.
157 // This will exercise all of the interesting cases in SkSwizzler
158 // without doubling the size of our test suite.
161 kStripe_Mode, // Tests the skipping of scanlines
162 kCroppedScanline_Mode, // Tests (jpeg) cropped scanline optimization
163 kSubset_Mode, // For codecs that support subsets directly.
164 kAnimated_Mode, // For codecs that support animation.
165 };
170 };
172
173 Result draw(SkCanvas*, GraphiteTestContext*) const override;
174 SkISize size() const override;
175 Name name() const override;
176 bool veto(SinkFlags) const override;
177 bool serial() const override { return fRunSerially; }
178private:
179 Path fPath;
180 Mode fMode;
181 DstColorType fDstColorType;
182 SkAlphaType fDstAlphaType;
183 float fScale;
184 bool fRunSerially;
185};
186
187class AndroidCodecSrc : public Src {
188public:
190
191 Result draw(SkCanvas*, GraphiteTestContext*) const override;
192 SkISize size() const override;
193 Name name() const override;
194 bool veto(SinkFlags) const override;
195 bool serial() const override { return fRunSerially; }
196private:
197 Path fPath;
198 CodecSrc::DstColorType fDstColorType;
199 SkAlphaType fDstAlphaType;
200 int fSampleSize;
201 bool fRunSerially;
202};
203
204#ifdef SK_ENABLE_ANDROID_UTILS
205// Allows for testing of various implementations of Android's BitmapRegionDecoder
206class BRDSrc : public Src {
207public:
208 enum Mode {
209 // Decode the entire image as one region.
210 kFullImage_Mode,
211 // Splits the image into multiple regions using a divisor and decodes the regions
212 // separately. Also, this test adds a border of a few pixels to each of the regions
213 // that it is decoding. This tests the behavior when a client asks for a region that
214 // does not fully fit in the image.
215 kDivisor_Mode,
216 };
217
218 BRDSrc(Path, Mode, CodecSrc::DstColorType, uint32_t);
219
220 Result draw(SkCanvas*, GraphiteTestContext*) const override;
221 SkISize size() const override;
222 Name name() const override;
223 bool veto(SinkFlags) const override;
224private:
225 Path fPath;
226 Mode fMode;
227 CodecSrc::DstColorType fDstColorType;
228 uint32_t fSampleSize;
229};
230#endif
231
232class ImageGenSrc : public Src {
233public:
234 enum Mode {
235 kCodec_Mode, // Use CodecImageGenerator
236 kPlatform_Mode, // Uses CG or WIC
237 };
239
240 Result draw(SkCanvas*, GraphiteTestContext*) const override;
241 SkISize size() const override;
242 Name name() const override;
243 bool veto(SinkFlags) const override;
244 bool serial() const override { return fRunSerially; }
245private:
246 Path fPath;
247 Mode fMode;
248 SkAlphaType fDstAlphaType;
249 bool fIsGpu;
250 bool fRunSerially;
251};
252
253class ColorCodecSrc : public Src {
254public:
255 ColorCodecSrc(Path, bool decode_to_dst);
256
257 Result draw(SkCanvas*, GraphiteTestContext*) const override;
258 SkISize size() const override;
259 Name name() const override;
260 bool veto(SinkFlags) const override;
261private:
262 Path fPath;
263 bool fDecodeToDst;
264};
265
266class SKPSrc : public Src {
267public:
268 explicit SKPSrc(Path path);
269
270 Result draw(SkCanvas*, GraphiteTestContext*) const override;
271 SkISize size() const override;
272 Name name() const override;
273private:
274 Path fPath;
275};
276
277// This class extracts all the paths from an SKP and then removes unwanted paths according to the
278// provided l/r trail. It then just draws the remaining paths. (Non-path draws are thrown out.) It
279// is useful for finding a reduced repo case for path drawing bugs.
280class BisectSrc : public SKPSrc {
281public:
282 explicit BisectSrc(Path path, const char* trail);
283
284 Result draw(SkCanvas*, GraphiteTestContext*) const override;
285
286private:
287 SkString fTrail;
288
289 using INHERITED = SKPSrc;
290};
291
292#if defined(SK_ENABLE_SKOTTIE)
293class SkottieSrc final : public Src {
294public:
295 explicit SkottieSrc(Path path);
296
297 Result draw(SkCanvas*, GraphiteTestContext*) const override;
298 SkISize size() const override;
299 Name name() const override;
300 bool veto(SinkFlags) const override;
301
302private:
303 // Generates a kTileCount x kTileCount filmstrip with evenly distributed frames.
304 inline static constexpr int kTileCount = 5;
305
306 // Fit kTileCount x kTileCount frames to a 1000x1000 film strip.
307 inline static constexpr SkScalar kTargetSize = 1000;
308 inline static constexpr SkScalar kTileSize = kTargetSize / kTileCount;
309
310 Path fPath;
311};
312#endif
313
314#if defined(SK_ENABLE_SVG)
315} // namespace DM
316
317class SkSVGDOM;
318
319namespace DM {
320
321class SVGSrc : public Src {
322public:
323 explicit SVGSrc(Path path);
324
325 Result draw(SkCanvas*, GraphiteTestContext*) const override;
326 SkISize size() const override;
327 Name name() const override;
328 bool veto(SinkFlags) const override;
329
330private:
331 Name fName;
332 sk_sp<SkSVGDOM> fDom;
333 SkScalar fScale;
334
335 using INHERITED = Src;
336};
337#endif // SK_ENABLE_SVG
338/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
339
340class MSKPSrc : public Src {
341public:
342 explicit MSKPSrc(Path path);
343
344 int pageCount() const override;
345 Result draw(SkCanvas* c, GraphiteTestContext*) const override;
346 Result draw(int, SkCanvas*, GraphiteTestContext*) const override;
347 SkISize size() const override;
348 SkISize size(int) const override;
349 Name name() const override;
350
351private:
352 Path fPath;
354};
355
356/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
357
358class NullSink : public Sink {
359public:
361
362 Result draw(const Src& src, SkBitmap*, SkWStream*, SkString*) const override;
363 const char* fileExtension() const override { return ""; }
365};
366
367class GPUSink : public Sink {
368public:
370
371 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
373 const GrContextOptions& baseOptions,
374 std::function<void(GrDirectContext*)> initContext = nullptr,
375 std::function<SkCanvas*(SkCanvas*)> wrapCanvas = nullptr) const;
376
377 skgpu::ContextType contextType() const { return fContextType; }
379 return fContextOverrides;
380 }
381 SkCommandLineConfigGpu::SurfType surfType() const { return fSurfType; }
382 bool serial() const override { return true; }
383 const char* fileExtension() const override { return "png"; }
384 SinkFlags flags() const override {
388 }
389 const GrContextOptions& baseContextOptions() const { return fBaseContextOptions; }
390 void setColorSpace(sk_sp<SkColorSpace> colorSpace) override { fColorSpace = colorSpace; }
391 SkColorInfo colorInfo() const override {
392 return SkColorInfo(fColorType, fAlphaType, fColorSpace);
393 }
394
395protected:
397 bool readBack(SkSurface*, SkBitmap* dst) const;
398
399private:
400 skgpu::ContextType fContextType;
403 int fSampleCount;
404 uint32_t fSurfaceFlags;
405 SkColorType fColorType;
406 SkAlphaType fAlphaType;
407 sk_sp<SkColorSpace> fColorSpace;
408 GrContextOptions fBaseContextOptions;
409 sk_gpu_test::MemoryCache fMemoryCache;
410};
411
412// Wrap a gpu canvas in one that routes all text draws through Slugs.
413// Note that text blobs that have an RSXForm aren't converted.
414class GPUSlugSink : public GPUSink {
415public:
417
418 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
419};
420
422public:
424
425 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
426};
427
429public:
431
432 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
433};
434
436public:
438
439 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
440
441 const char* fileExtension() const override {
442 // Suppress writing out results from this config - we just want to do our matching test
443 return nullptr;
444 }
445
446private:
447 int fCacheType;
448
449 using INHERITED = GPUSink;
450};
451
453public:
455
456 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
457
458 const char* fileExtension() const override {
459 // Suppress writing out results from this config - we just want to do our matching test
460 return nullptr;
461 }
462
463private:
464 using INHERITED = GPUSink;
465};
466
467// This sink attempts to better simulate the Chrome DDL use-case. It:
468// creates the DDLs on separate recording threads
469// performs all the GPU work on a separate GPU thread
470// In the future this should be expanded to:
471// upload on a utility thread w/ access to a shared context
472// compile the programs on the utility thread
473// perform fine grained scheduling of gpu tasks based on their image and program prerequisites
474// create a single "compositing" DDL that is replayed last
475class GPUDDLSink : public GPUSink {
476public:
478
479 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
480
481private:
482 Result ddlDraw(const Src&,
483 sk_sp<SkSurface> dstSurface,
484 SkTaskGroup* recordingTaskGroup,
485 SkTaskGroup* gpuTaskGroup,
486 sk_gpu_test::TestContext* gpuTestCtx,
487 GrDirectContext* gpuThreadCtx) const;
488
489 std::unique_ptr<SkExecutor> fRecordingExecutor;
490 std::unique_ptr<SkExecutor> fGPUExecutor;
491
492 using INHERITED = GPUSink;
493};
494
495class PDFSink : public Sink {
496public:
497 PDFSink(bool pdfa, SkScalar rasterDpi) : fPDFA(pdfa), fRasterDpi(rasterDpi) {}
498 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
499 const char* fileExtension() const override { return "pdf"; }
501
502 bool fPDFA;
504};
505
506class XPSSink : public Sink {
507public:
508 XPSSink();
509
510 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
511 const char* fileExtension() const override { return "xps"; }
513};
514
515class RasterSink : public Sink {
516public:
517 explicit RasterSink(SkColorType);
518
519 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
520 const char* fileExtension() const override { return "png"; }
522 void setColorSpace(sk_sp<SkColorSpace> colorSpace) override { fColorSpace = colorSpace; }
523
524 SkColorInfo colorInfo() const override {
525 // If there's an appropriate alpha type for this color type, use it, otherwise use premul.
527 (void)SkColorTypeValidateAlphaType(fColorType, alphaType, &alphaType);
528
529 return SkColorInfo(fColorType, alphaType, fColorSpace);
530 }
531
532private:
533 SkColorType fColorType;
534 sk_sp<SkColorSpace> fColorSpace;
535};
536
537class SKPSink : public Sink {
538public:
539 SKPSink();
540
541 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
542 const char* fileExtension() const override { return "skp"; }
544};
545
546class DebugSink : public Sink {
547public:
548 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
549 const char* fileExtension() const override { return "json"; }
551};
552
553class SVGSink : public Sink {
554public:
555 SVGSink(int pageIndex = 0);
556
557 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
558 const char* fileExtension() const override { return "svg"; }
560
561private:
562 int fPageIndex;
563};
564
565#if defined(SK_GRAPHITE)
566
567class GraphiteSink : public Sink {
568public:
569 GraphiteSink(const SkCommandLineConfigGraphite*);
570
571 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
572 bool serial() const override { return true; }
573 const char* fileExtension() const override { return "png"; }
574 SinkFlags flags() const override { return SinkFlags{SinkFlags::kGPU, SinkFlags::kDirect}; }
575 void setColorSpace(sk_sp<SkColorSpace> colorSpace) override { fColorSpace = colorSpace; }
576 SkColorInfo colorInfo() const override {
577 return SkColorInfo(fColorType, fAlphaType, fColorSpace);
578 }
579
580protected:
582
584
586 skgpu::ContextType fContextType;
587 SurfaceType fSurfaceType;
590 sk_sp<SkColorSpace> fColorSpace;
591};
592
593#if defined(SK_ENABLE_PRECOMPILE)
594// In general this sink:
595// renders a gm, skp or svg (in drawSrc)
596// collects all the UniqueKeys |
597// clears the pipeline cache | (in resetAndRecreatePipelines)
598// recreates the pipelines from the UniqueKeys |
599// renders a second time (in drawSrc)
600// asserts that no new pipelines were created
601class GraphitePrecompileTestingSink : public GraphiteSink {
602public:
603 GraphitePrecompileTestingSink(const SkCommandLineConfigGraphite*);
604 ~GraphitePrecompileTestingSink() override;
605
606 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
607
608 const char* fileExtension() const override {
609 // Suppress writing out results from this config - we just want to check that
610 // the precompilation API is expressive enough and prepopulates the cache.
611 // If desired, this could be updated to save the result of the precompiled rendering.
612 // However; if all the keys match, as is expected, the images should always match.
613 return nullptr;
614 }
615
616private:
617 Result drawSrc(const Src&,
620 Result resetAndRecreatePipelines(skgpu::graphite::Context*) const;
621
622 mutable std::unique_ptr<skgpu::graphite::Recorder> fRecorder;
623};
624#endif // SK_ENABLE_PRECOMPILE
625#endif // SK_GRAPHITE
626
627/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
628
629class Via : public Sink {
630public:
631 explicit Via(Sink* sink) : fSink(sink) {}
632 const char* fileExtension() const override { return fSink->fileExtension(); }
633 bool serial() const override { return fSink->serial(); }
634 SinkFlags flags() const override {
635 SinkFlags flags = fSink->flags();
637 return flags;
638 }
639 void setColorSpace(sk_sp<SkColorSpace> colorSpace) override {
640 fSink->setColorSpace(colorSpace);
641 }
642protected:
643 std::unique_ptr<Sink> fSink;
644};
645
646class ViaMatrix : public Via {
647public:
649 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
650
651private:
652 const SkMatrix fMatrix;
653};
654
655class ViaUpright : public Via {
656public:
658 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
659
660private:
661 const SkMatrix fMatrix;
662};
663
664class ViaSerialization : public Via {
665public:
666 explicit ViaSerialization(Sink* sink) : Via(sink) {}
667 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
668};
669
670class ViaPicture : public Via {
671public:
672 explicit ViaPicture(Sink* sink) : Via(sink) {}
673 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
674};
675
676class ViaRuntimeBlend : public Via {
677public:
678 explicit ViaRuntimeBlend(Sink* sink) : Via(sink) {}
679 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
680};
681
682class ViaSVG : public Via {
683public:
684 explicit ViaSVG(Sink* sink) : Via(sink) {}
685 Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
686};
687
688} // namespace DM
689
690#endif//DMSrcSink_DEFINED
SkPath fPath
const char * options
const char * fName
SkColorType fColorType
SkAlphaType fAlphaType
SkAlphaType
Definition: SkAlphaType.h:26
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
#define SK_PRINTF_LIKE(A, B)
Definition: SkAttributes.h:52
SkColorType
Definition: SkColorType.h:19
SK_API bool SkColorTypeValidateAlphaType(SkColorType colorType, SkAlphaType alphaType, SkAlphaType *canonical=nullptr)
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
bool serial() const override
Definition: DMSrcSink.h:195
SkISize size() const override
Definition: DMSrcSink.cpp:934
AndroidCodecSrc(Path, CodecSrc::DstColorType, SkAlphaType, int sampleSize)
Definition: DMSrcSink.cpp:865
bool veto(SinkFlags) const override
Definition: DMSrcSink.cpp:874
Result draw(SkCanvas *, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:880
Name name() const override
Definition: DMSrcSink.cpp:943
Result draw(SkCanvas *, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:1216
BisectSrc(Path path, const char *trail)
Definition: DMSrcSink.cpp:1214
bool veto(SinkFlags) const override
Definition: DMSrcSink.cpp:405
bool serial() const override
Definition: DMSrcSink.h:177
CodecSrc(Path, Mode, DstColorType, SkAlphaType, float)
Definition: DMSrcSink.cpp:395
SkISize size() const override
Definition: DMSrcSink.cpp:827
@ kGetFromCanvas_DstColorType
Definition: DMSrcSink.h:167
@ kGrayscale_Always_DstColorType
Definition: DMSrcSink.h:168
@ kNonNative8888_Always_DstColorType
Definition: DMSrcSink.h:169
Name name() const override
Definition: DMSrcSink.cpp:852
Result draw(SkCanvas *, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:474
@ kCroppedScanline_Mode
Definition: DMSrcSink.h:162
@ kCodecZeroInit_Mode
Definition: DMSrcSink.h:159
Result draw(SkCanvas *, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:1074
Name name() const override
Definition: DMSrcSink.cpp:1126
bool veto(SinkFlags) const override
Definition: DMSrcSink.cpp:1069
ColorCodecSrc(Path, bool decode_to_dst)
Definition: DMSrcSink.cpp:1066
SkISize size() const override
Definition: DMSrcSink.cpp:1117
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2077
const char * fileExtension() const override
Definition: DMSrcSink.h:549
SinkFlags flags() const override
Definition: DMSrcSink.h:550
Name name() const override
Definition: DMSrcSink.cpp:180
GMSrc(skiagm::GMFactory)
Definition: DMSrcSink.cpp:144
Result draw(SkCanvas *, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:146
void modifyGrContextOptions(GrContextOptions *options) const override
Definition: DMSrcSink.cpp:185
SkISize size() const override
Definition: DMSrcSink.cpp:175
GPUDDLSink(const SkCommandLineConfigGpu *, const GrContextOptions &)
Definition: DMSrcSink.cpp:1792
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1900
GPUPersistentCacheTestingSink(const SkCommandLineConfigGpu *, const GrContextOptions &)
Definition: DMSrcSink.cpp:1705
const char * fileExtension() const override
Definition: DMSrcSink.h:441
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1710
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1747
GPUPrecompileTestingSink(const SkCommandLineConfigGpu *, const GrContextOptions &)
Definition: DMSrcSink.cpp:1743
const char * fileExtension() const override
Definition: DMSrcSink.h:458
GPURemoteSlugSink(const SkCommandLineConfigGpu *, const GrContextOptions &)
Definition: DMSrcSink.cpp:1685
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1689
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1669
GPUSerializeSlugSink(const SkCommandLineConfigGpu *, const GrContextOptions &)
Definition: DMSrcSink.cpp:1665
SinkFlags flags() const override
Definition: DMSrcSink.h:384
const sk_gpu_test::GrContextFactory::ContextOverrides & contextOverrides() const
Definition: DMSrcSink.h:378
const char * fileExtension() const override
Definition: DMSrcSink.h:383
GPUSink(const SkCommandLineConfigGpu *, const GrContextOptions &)
Definition: DMSrcSink.cpp:1523
skgpu::ContextType contextType() const
Definition: DMSrcSink.h:377
Result onDraw(const Src &, SkBitmap *, SkWStream *, SkString *, const GrContextOptions &baseOptions, std::function< void(GrDirectContext *)> initContext=nullptr, std::function< SkCanvas *(SkCanvas *)> wrapCanvas=nullptr) const
Definition: DMSrcSink.cpp:1584
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1538
const GrContextOptions & baseContextOptions() const
Definition: DMSrcSink.h:389
bool readBack(SkSurface *, SkBitmap *dst) const
Definition: DMSrcSink.cpp:1575
SkColorInfo colorInfo() const override
Definition: DMSrcSink.h:391
SkCommandLineConfigGpu::SurfType surfType() const
Definition: DMSrcSink.h:381
bool serial() const override
Definition: DMSrcSink.h:382
sk_sp< SkSurface > createDstSurface(GrDirectContext *, SkISize size) const
Definition: DMSrcSink.cpp:1542
void setColorSpace(sk_sp< SkColorSpace > colorSpace) override
Definition: DMSrcSink.h:390
GPUSlugSink(const SkCommandLineConfigGpu *, const GrContextOptions &)
Definition: DMSrcSink.cpp:1647
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1650
bool veto(SinkFlags) const override
Definition: DMSrcSink.cpp:962
Name name() const override
Definition: DMSrcSink.cpp:1060
ImageGenSrc(Path, Mode, SkAlphaType, bool)
Definition: DMSrcSink.cpp:954
bool serial() const override
Definition: DMSrcSink.h:244
SkISize size() const override
Definition: DMSrcSink.cpp:1051
Result draw(SkCanvas *, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:972
SkISize size() const override
Definition: DMSrcSink.cpp:1440
Result draw(SkCanvas *c, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:1445
int pageCount() const override
Definition: DMSrcSink.cpp:1438
MSKPSrc(Path path)
Definition: DMSrcSink.cpp:1428
Name name() const override
Definition: DMSrcSink.cpp:1471
const char * fileExtension() const override
Definition: DMSrcSink.h:363
SinkFlags flags() const override
Definition: DMSrcSink.h:364
Result draw(const Src &src, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1475
SkScalar fRasterDpi
Definition: DMSrcSink.h:503
SinkFlags flags() const override
Definition: DMSrcSink.h:500
PDFSink(bool pdfa, SkScalar rasterDpi)
Definition: DMSrcSink.h:497
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:1996
bool fPDFA
Definition: DMSrcSink.h:502
const char * fileExtension() const override
Definition: DMSrcSink.h:499
void setColorSpace(sk_sp< SkColorSpace > colorSpace) override
Definition: DMSrcSink.h:522
SinkFlags flags() const override
Definition: DMSrcSink.h:521
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2123
RasterSink(SkColorType)
Definition: DMSrcSink.cpp:2120
SkColorInfo colorInfo() const override
Definition: DMSrcSink.h:524
const char * fileExtension() const override
Definition: DMSrcSink.h:520
const char * c_str() const
Definition: DMSrcSink.h:76
bool isFatal()
Definition: DMSrcSink.h:73
Result(Status status, SkString msg)
Definition: DMSrcSink.h:45
bool isOk()
Definition: DMSrcSink.h:72
Result & operator=(const Result &)=default
Status status() const
Definition: DMSrcSink.h:77
static Result Skip(const char *fmt,...) SK_PRINTF_LIKE(1
static Result va_list args
Definition: DMSrcSink.h:54
va_start(args, fmt)
static Result Ok()
Definition: DMSrcSink.h:50
bool isSkip()
Definition: DMSrcSink.h:74
static Result Fatal(const char *fmt,...) SK_PRINTF_LIKE(1
va_end(args)
Result(const Result &)=default
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2062
SinkFlags flags() const override
Definition: DMSrcSink.h:543
const char * fileExtension() const override
Definition: DMSrcSink.h:542
SKPSrc(Path path)
Definition: DMSrcSink.cpp:1135
Name name() const override
Definition: DMSrcSink.cpp:1210
Result draw(SkCanvas *, GraphiteTestContext *) const override
Definition: DMSrcSink.cpp:1137
SkISize size() const override
Definition: DMSrcSink.cpp:1202
const char * fileExtension() const override
Definition: DMSrcSink.h:558
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2097
SinkFlags flags() const override
Definition: DMSrcSink.h:559
SVGSink(int pageIndex=0)
Definition: DMSrcSink.cpp:2095
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2478
ViaMatrix(SkMatrix, Sink *)
Definition: DMSrcSink.cpp:2476
ViaPicture(Sink *sink)
Definition: DMSrcSink.h:672
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2556
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2581
ViaRuntimeBlend(Sink *sink)
Definition: DMSrcSink.h:678
ViaSVG(Sink *sink)
Definition: DMSrcSink.h:684
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
ViaSerialization(Sink *sink)
Definition: DMSrcSink.h:666
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2525
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2493
ViaUpright(SkMatrix, Sink *)
Definition: DMSrcSink.cpp:2491
const char * fileExtension() const override
Definition: DMSrcSink.h:632
bool serial() const override
Definition: DMSrcSink.h:633
std::unique_ptr< Sink > fSink
Definition: DMSrcSink.h:643
Via(Sink *sink)
Definition: DMSrcSink.h:631
void setColorSpace(sk_sp< SkColorSpace > colorSpace) override
Definition: DMSrcSink.h:639
SinkFlags flags() const override
Definition: DMSrcSink.h:634
const char * fileExtension() const override
Definition: DMSrcSink.h:511
SinkFlags flags() const override
Definition: DMSrcSink.h:512
Result draw(const Src &, SkBitmap *, SkWStream *, SkString *) const override
Definition: DMSrcSink.cpp:2045
void void printVAList(const char format[], va_list) SK_PRINTF_LIKE(2
Definition: SkString.cpp:541
const char * c_str() const
Definition: SkString.h:133
float SkScalar
Definition: extension.cpp:12
struct MyStruct s
struct MyStruct a[10]
FlutterSemanticsFlag flags
Dart_NativeFunction function
Definition: fuchsia.cc:51
ImplicitString Path
Definition: DMSrcSink.h:39
ImplicitString Name
Definition: DMSrcSink.h:38
sk_sp< SkSurface > makeSurface(SkCanvas *canvas, const SkImageInfo &info, const SkSurfaceProps *props)
Definition: ToolUtils.cpp:512
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
Definition: switches.h:57
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
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
Definition: switches.h:259
dst
Definition: cp.py:12
ContextType
Definition: ContextType.h:19
std::function< std::unique_ptr< skiagm::GM >()> GMFactory
Definition: gm.h:239
Definition: ref_ptr.h:256
static SkString fmt(SkColor4f c)
Definition: p3.cpp:43
#define T
Definition: precompiler.cc:65
ImplicitString(const T &s)
Definition: DMSrcSink.h:35
SinkFlags(Type t, Approach a, Multisampled ms=kNotMultisampled)
Definition: DMSrcSink.h:88
enum DM::SinkFlags::Multisampled multisampled
enum DM::SinkFlags::Approach approach
@ kNotMultisampled
Definition: DMSrcSink.h:87
enum DM::SinkFlags::Type type
virtual SkColorInfo colorInfo() const
Definition: DMSrcSink.h:131
virtual Result draw(const Src &, SkBitmap *, SkWStream *, SkString *log) const =0
virtual bool serial() const
Definition: DMSrcSink.h:123
virtual const char * fileExtension() const =0
virtual ~Sink()
Definition: DMSrcSink.h:115
virtual void setColorSpace(sk_sp< SkColorSpace >)
Definition: DMSrcSink.h:120
virtual SinkFlags flags() const =0
virtual void modifyGrContextOptions(GrContextOptions *) const
Definition: DMSrcSink.h:99
virtual Name name() const =0
virtual Result draw(SkCanvas *canvas, GraphiteTestContext *) const =0
virtual int pageCount() const
Definition: DMSrcSink.h:103
virtual bool veto(SinkFlags) const
Definition: DMSrcSink.h:101
virtual bool serial() const
Definition: DMSrcSink.h:111
virtual ~Src()
Definition: DMSrcSink.h:95
virtual void modifyGraphiteContextOptions(skgpu::graphite::ContextOptions *) const
Definition: DMSrcSink.h:100
virtual SkISize size(int page) const
Definition: DMSrcSink.h:109
skiatest::graphite::GraphiteTestContext GraphiteTestContext
Definition: DMSrcSink.h:93
virtual SkISize size() const =0
virtual Result draw(int page, SkCanvas *canvas, GraphiteTestContext *graphiteTestContext) const
Definition: DMSrcSink.h:104
Definition: SkSize.h:16
SkBlendMode fMode
Definition: xfermodes.cpp:52