Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
HalfPlaneSlide3 Class Reference

Inherits CameraSlide.

Public Member Functions

 HalfPlaneSlide3 ()
 
void load (SkScalar w, SkScalar h) override
 
bool onChar (SkUnichar uni) override
 
void draw (SkCanvas *canvas) override
 

Protected Member Functions

Click * onFindClickHandler (SkScalar x, SkScalar y, skui::ModifierKey) override
 
bool onClick (Click *click) override
 

Detailed Description

Definition at line 498 of file ClipSlide.cpp.

Constructor & Destructor Documentation

◆ HalfPlaneSlide3()

HalfPlaneSlide3::HalfPlaneSlide3 ( )
inline

Definition at line 504 of file ClipSlide.cpp.

504{ fName = "halfplane3"; }
const char * fName

Member Function Documentation

◆ draw()

void HalfPlaneSlide3::draw ( SkCanvas canvas)
inlineoverride

Definition at line 520 of file ClipSlide.cpp.

520 {
521 SkM44 mx = this->get44({0, 0, 400, 400});
522
524 paint.setColor({0.75, 0.75, 0.75, 1});
525 canvas->drawPath(fPath, paint);
526
527 paint.setShader(fShader);
528
529 if (fShowUnclipped) {
530 canvas->save();
531 canvas->concat(mx);
532 paint.setAlphaf(0.33f);
533 canvas->drawPath(fPath, paint);
534 paint.setAlphaf(1.f);
535 canvas->restore();
536 }
537
538
539 SkColor planeColor = SK_ColorBLUE;
540 SkPath clippedPath, *path = &fPath;
541 if (SkPathPriv::PerspectiveClip(fPath, mx.asM33(), &clippedPath)) {
542 path = &clippedPath;
543 planeColor = SK_ColorRED;
544 }
545 canvas->save();
546 canvas->concat(mx);
547 canvas->drawPath(*path, paint);
548 canvas->restore();
549
550 SkHalfPlane hpw = half_plane_w0(mx.asM33());
551 draw_halfplane(canvas, hpw, planeColor);
552 }
static SkHalfPlane half_plane_w0(const SkMatrix &m)
Definition: ClipSlide.cpp:433
static void draw_halfplane(SkCanvas *canvas, SkPoint p0, SkPoint p1, SkColor c)
Definition: ClipSlide.cpp:275
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
void restore()
Definition: SkCanvas.cpp:461
int save()
Definition: SkCanvas.cpp:447
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
void concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
Definition: SkM44.h:150
SkMatrix asM33() const
Definition: SkM44.h:409
static bool PerspectiveClip(const SkPath &src, const SkMatrix &, SkPath *result)
Definition: SkPath.cpp:3962
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
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

◆ load()

void HalfPlaneSlide3::load ( SkScalar  w,
SkScalar  h 
)
inlineoverride

Definition at line 506 of file ClipSlide.cpp.

506 {
507 fPath = make_path();
508 fShader = ToolUtils::GetResourceAsImage("images/mandrill_128.png")
510 }
static SkPath make_path()
Definition: ClipSlide.cpp:285
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
Definition: SkImage.cpp:179
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition: SkMatrix.h:75
sk_sp< SkImage > GetResourceAsImage(const char *resource)
Definition: DecodeUtils.h:25
SkSamplingOptions(SkFilterMode::kLinear))

◆ onChar()

bool HalfPlaneSlide3::onChar ( SkUnichar  uni)
inlineoverride

Definition at line 512 of file ClipSlide.cpp.

512 {
513 switch (uni) {
514 case 'u': fShowUnclipped = !fShowUnclipped; return true;
515 default: break;
516 }
517 return this->CameraSlide::onChar(uni);
518 }
bool onChar(SkUnichar uni) override
Definition: ClipSlide.cpp:475

◆ onClick()

bool HalfPlaneSlide3::onClick ( Click *  click)
inlineoverrideprotected

Definition at line 558 of file ClipSlide.cpp.

558{ return false; }

◆ onFindClickHandler()

Click * HalfPlaneSlide3::onFindClickHandler ( SkScalar  x,
SkScalar  y,
skui::ModifierKey   
)
inlineoverrideprotected

Definition at line 555 of file ClipSlide.cpp.

555 {
556 return nullptr;
557 }

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