Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
ImageMagnifierBounds Class Reference
Inheritance diagram for ImageMagnifierBounds:
skiagm::GM

Public Member Functions

 ImageMagnifierBounds ()
 
- 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 SkISize getISize ()=0
 
virtual SkString getName () const =0
 
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
 

Protected Member Functions

SkString getName () const override
 
SkISize getISize () override
 
bool onAnimate (double nanos) override
 
void onDraw (SkCanvas *canvas) override
 
- 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 void onDraw (SkCanvas *)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

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 []
 

Detailed Description

Definition at line 99 of file imagemagnifier.cpp.

Constructor & Destructor Documentation

◆ ImageMagnifierBounds()

ImageMagnifierBounds::ImageMagnifierBounds ( )
inline

Definition at line 101 of file imagemagnifier.cpp.

101: fX(0.f), fY(0.f) {}

Member Function Documentation

◆ getISize()

SkISize ImageMagnifierBounds::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 105 of file imagemagnifier.cpp.

105{ return SkISize::Make(768, 512); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString ImageMagnifierBounds::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 104 of file imagemagnifier.cpp.

104{ return SkString("imagemagnifier_bounds"); }

◆ onAnimate()

bool ImageMagnifierBounds::onAnimate ( double  nanos)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 107 of file imagemagnifier.cpp.

107 {
108 fX = TimeUtils::SineWave(nanos, 10.f, 0.f, -200.f, 200.f);
109 fY = TimeUtils::SineWave(nanos, 10.f, 3.f, -200.f, 200.f);
110 return true;
111 }
static float SineWave(double time, float periodInSecs, float phaseInSecs, float min, float max)
Definition: TimeUtils.h:48

◆ onDraw()

void ImageMagnifierBounds::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 113 of file imagemagnifier.cpp.

113 {
114 this->drawRow(canvas, 16.f); // fish eye distortion
115 canvas->translate(0.f, 256.f);
116 this->drawRow(canvas, 0.f); // no distortion, just zoom
117 }
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278

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