Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Protected Member Functions | Static Protected Member Functions | List of all members
PathInverseFillGM Class Reference
Inheritance diagram for PathInverseFillGM:
skiagm::GM

Protected Member Functions

void onOnceBeforeDraw () override
 
SkString getName () const override
 
SkISize getISize () override
 
void onDraw (SkCanvas *canvas) override
 
- Protected Member Functions inherited from skiagm::GM
virtual DrawResult onGpuSetup (SkCanvas *, SkString *, GraphiteTestContext *)
 
virtual void onGpuTeardown ()
 
virtual DrawResult onDraw (SkCanvas *, SkString *errorMsg)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

Static Protected Member Functions

static void show (SkCanvas *canvas, const SkPath &path, const SkPaint &paint, const SkRect *clip, SkScalar top, const SkScalar bottom)
 

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
 
- 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 modifyGrContextOptions (GrContextOptions *)
 
virtual void modifyGraphiteContextOptions (skgpu::graphite::ContextOptions *) const
 
virtual bool isBazelOnly () const
 
virtual std::map< std::string, std::string > getGoldKeys () const
 
- Static Public Attributes inherited from skiagm::GM
static constexpr char kErrorMsg_DrawSkippedGpuOnly []
 

Detailed Description

Definition at line 353 of file pathfill.cpp.

Member Function Documentation

◆ getISize()

SkISize PathInverseFillGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 367 of file pathfill.cpp.

367{ return SkISize::Make(450, 220); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition SkSize.h:20

◆ getName()

SkString PathInverseFillGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 365 of file pathfill.cpp.

365{ return SkString("pathinvfill"); }

◆ onDraw()

void PathInverseFillGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 382 of file pathfill.cpp.

382 {
383 SkPath path = SkPathBuilder().addCircle(50, 50, 40)
385 .detach();
386
387 SkRect clipR = {0, 0, 100, 200};
388
389 canvas->translate(10, 10);
390
391 for (int doclip = 0; doclip <= 1; ++doclip) {
392 for (int aa = 0; aa <= 1; ++aa) {
394 paint.setAntiAlias(SkToBool(aa));
395
396 canvas->save();
397 canvas->clipRect(clipR);
398
399 const SkRect* clipPtr = doclip ? &clipR : nullptr;
400
401 show(canvas, path, paint, clipPtr, clipR.fTop, clipR.centerY());
402 show(canvas, path, paint, clipPtr, clipR.centerY(), clipR.fBottom);
403
404 canvas->restore();
405 canvas->translate(SkIntToScalar(110), 0);
406 }
407 }
408 }
#define SkIntToScalar(x)
Definition SkScalar.h:57
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35
static void show(SkCanvas *canvas, const SkPath &path, const SkPaint &paint, const SkRect *clip, SkScalar top, const SkScalar bottom)
Definition pathfill.cpp:369
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void restore()
Definition SkCanvas.cpp:465
void translate(SkScalar dx, SkScalar dy)
int save()
Definition SkCanvas.cpp:451
SkPathBuilder & toggleInverseFillType()
SkPathBuilder & addCircle(SkScalar center_x, SkScalar center_y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
const Paint & paint
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
SkScalar fBottom
larger y-axis bounds
Definition extension.cpp:17
constexpr float centerY() const
Definition SkRect.h:785
SkScalar fTop
smaller y-axis bounds
Definition extension.cpp:15

◆ onOnceBeforeDraw()

void PathInverseFillGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 357 of file pathfill.cpp.

357 {
358 for (size_t i = 0; i < N; i++) {
359 auto [path, dy] = gProcs[i]();
360 fPath[i] = path;
361 fDY[i] = dy;
362 }
363 }
#define N
Definition pathfill.cpp:299
constexpr MakePathProc gProcs[]
Definition pathfill.cpp:286

◆ show()

static void PathInverseFillGM::show ( SkCanvas canvas,
const SkPath path,
const SkPaint paint,
const SkRect clip,
SkScalar  top,
const SkScalar  bottom 
)
inlinestaticprotected

Definition at line 369 of file pathfill.cpp.

370 {
371 canvas->save();
372 if (clip) {
373 SkRect r = *clip;
374 r.fTop = top;
375 r.fBottom = bottom;
376 canvas->clipRect(r);
377 }
378 canvas->drawPath(path, paint);
379 canvas->restore();
380 }
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
void drawPath(const SkPath &path, const SkPaint &paint)

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