Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
skiagm::ManyPathAtlasesGM Class Reference
Inheritance diagram for skiagm::ManyPathAtlasesGM:
skiagm::GM

Public Member Functions

 ManyPathAtlasesGM (int maxAtlasSize)
 
- Public Member Functions inherited from skiagm::GM
 GM (SkColor backgroundColor=SK_ColorWHITE)
 
virtual ~GM ()
 
void setMode (Mode mode)
 
Mode getMode () const
 
DrawResult gpuSetup (SkCanvas *, SkString *errorMsg, GraphiteTestContext *=nullptr)
 
void gpuTeardown ()
 
void onceBeforeDraw ()
 
DrawResult draw (SkCanvas *canvas)
 
DrawResult draw (SkCanvas *, SkString *errorMsg)
 
void drawBackground (SkCanvas *)
 
DrawResult drawContent (SkCanvas *canvas)
 
DrawResult drawContent (SkCanvas *, SkString *errorMsg)
 
virtual bool runAsBench () const
 
SkScalar width ()
 
SkScalar height ()
 
SkColor getBGColor () const
 
void setBGColor (SkColor)
 
void drawSizeBounds (SkCanvas *, SkColor)
 
bool animate (double)
 
virtual bool onChar (SkUnichar)
 
bool getControls (SkMetaData *controls)
 
void setControls (const SkMetaData &controls)
 
virtual void modifyGraphiteContextOptions (skgpu::graphite::ContextOptions *) const
 
virtual bool isBazelOnly () const
 
virtual std::map< std::string, std::string > getGoldKeys () const
 

Private Member Functions

SkString getName () const override
 
SkISize getISize () override
 
void modifyGrContextOptions (GrContextOptions *ctxOptions) override
 
void onDraw (SkCanvas *canvas) override
 

Additional Inherited Members

- Public Types inherited from skiagm::GM
enum  Mode { kGM_Mode , kSample_Mode , kBench_Mode }
 
using DrawResult = skiagm::DrawResult
 
using GraphiteTestContext = skiatest::graphite::GraphiteTestContext
 
- Static Public Attributes inherited from skiagm::GM
static constexpr char kErrorMsg_DrawSkippedGpuOnly []
 
- Protected Member Functions inherited from skiagm::GM
virtual DrawResult onGpuSetup (SkCanvas *, SkString *, GraphiteTestContext *)
 
virtual void onGpuTeardown ()
 
virtual void onOnceBeforeDraw ()
 
virtual DrawResult onDraw (SkCanvas *, SkString *errorMsg)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

Detailed Description

This test originally ensured that the ccpr path cache preserved fill rules properly. CCPR is gone now, but we decided to keep the test.

Definition at line 29 of file manypathatlases.cpp.

Constructor & Destructor Documentation

◆ ManyPathAtlasesGM()

skiagm::ManyPathAtlasesGM::ManyPathAtlasesGM ( int  maxAtlasSize)
inline

Definition at line 31 of file manypathatlases.cpp.

31: fMaxAtlasSize(maxAtlasSize) {}

Member Function Documentation

◆ getISize()

SkISize skiagm::ManyPathAtlasesGM::getISize ( )
inlineoverrideprivatevirtual

Implements skiagm::GM.

Definition at line 36 of file manypathatlases.cpp.

36{ return SkISize::Make(128, 128); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition SkSize.h:20

◆ getName()

SkString skiagm::ManyPathAtlasesGM::getName ( ) const
inlineoverrideprivatevirtual

Implements skiagm::GM.

Definition at line 33 of file manypathatlases.cpp.

33 {
34 return SkStringPrintf("manypathatlases_%i", fMaxAtlasSize);
35 }
SK_API SkString static SkString SkStringPrintf()
Definition SkString.h:287

◆ modifyGrContextOptions()

void skiagm::ManyPathAtlasesGM::modifyGrContextOptions ( GrContextOptions ctxOptions)
inlineoverrideprivatevirtual

Reimplemented from skiagm::GM.

Definition at line 38 of file manypathatlases.cpp.

38 {
39 // This will test the case where the atlas runs out of room if fMaxAtlasSize is small.
40 ctxOptions->fMaxTextureAtlasSize = fMaxAtlasSize;
41 }

◆ onDraw()

void skiagm::ManyPathAtlasesGM::onDraw ( SkCanvas canvas)
inlineoverrideprivatevirtual

Reimplemented from skiagm::GM.

Definition at line 50 of file manypathatlases.cpp.

50 {
51 canvas->clear(SkColors::kYellow);
52
53 // Flush the context to make the DAG empty. This will test the case where we try to add an
54 // atlas task to an empty DAG.
55 auto dContext = GrAsDirectContext(canvas->recordingContext());
56 if (dContext) {
57 dContext->flush();
58 }
59
60 SkPath clip = SkPath().moveTo(-50, 20)
61 .cubicTo(-50, -20, 50, -20, 50, 40)
62 .cubicTo(20, 0, -20, 0, -50, 20);
64 for (int i = 0; i < 4; ++i) {
65 SkPath rotatedClip = clip;
66 rotatedClip.transform(SkMatrix::RotateDeg(30 * i + 128, {64, 70}));
67 rotatedClip.setIsVolatile(true);
68 canvas->clipPath(rotatedClip, SkClipOp::kDifference, true);
69 }
70 SkPath path = SkPath().moveTo(20, 0)
71 .lineTo(108, 0).cubicTo(108, 20, 108, 20, 128, 20)
72 .lineTo(128, 108).cubicTo(108, 108, 108, 108, 108, 128)
73 .lineTo(20, 128).cubicTo(20, 108, 20, 108, 0, 108)
74 .lineTo(0, 20).cubicTo(20, 20, 20, 20, 20, 0);
75 path.setIsVolatile(true);
76 SkPaint teal;
77 teal.setColor4f({.03f, .91f, .87f, 1});
78 teal.setAntiAlias(true);
79 canvas->drawPath(path, teal);
80 }
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
virtual GrRecordingContext * recordingContext() const
void clear(SkColor color)
Definition SkCanvas.h:1199
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
void drawPath(const SkPath &path, const SkPaint &paint)
static SkMatrix RotateDeg(SkScalar deg)
Definition SkMatrix.h:104
static SkMatrix Translate(SkScalar dx, SkScalar dy)
Definition SkMatrix.h:91
void setAntiAlias(bool aa)
Definition SkPaint.h:170
void setColor4f(const SkColor4f &color, SkColorSpace *colorSpace=nullptr)
Definition SkPaint.h:253
SkPath & moveTo(SkScalar x, SkScalar y)
Definition SkPath.cpp:678
SkPath & lineTo(SkScalar x, SkScalar y)
Definition SkPath.cpp:718
SkPath & setIsVolatile(bool isVolatile)
Definition SkPath.h:370
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition SkPath.cpp:789
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition SkPath.cpp:1647
constexpr SkColor4f kYellow
Definition SkColor.h:443
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

The documentation for this class was generated from the following file: