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

Public Member Functions

 ImageFilterComposedTransform ()
 
- 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 onOnceBeforeDraw () 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 221 of file imagefilterstransformed.cpp.

Constructor & Destructor Documentation

◆ ImageFilterComposedTransform()

ImageFilterComposedTransform::ImageFilterComposedTransform ( )
inline

Definition at line 225 of file imagefilterstransformed.cpp.

225: fDegrees(70.f) {}

Member Function Documentation

◆ getISize()

SkISize ImageFilterComposedTransform::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 230 of file imagefilterstransformed.cpp.

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

◆ getName()

SkString ImageFilterComposedTransform::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 228 of file imagefilterstransformed.cpp.

228{ return SkString("imagefilter_composed_transform"); }

◆ onAnimate()

bool ImageFilterComposedTransform::onAnimate ( double  nanos)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 232 of file imagefilterstransformed.cpp.

232 {
233 // Animate the rotation angle to test a variety of transformations
234 fDegrees = TimeUtils::Scaled(1e-9f * nanos, 360.f);
235 return true;
236 }
static float Scaled(float time, float speed, float period=0)
Definition: TimeUtils.h:27

◆ onDraw()

void ImageFilterComposedTransform::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 242 of file imagefilterstransformed.cpp.

242 {
244 // All four quadrants should render the same
245 this->drawFilter(canvas, 0.f, 0.f, this->makeDirectFilter(matrix));
246 this->drawFilter(canvas, 256.f, 0.f, this->makeEarlyComposeFilter(matrix));
247 this->drawFilter(canvas, 0.f, 256.f, this->makeLateComposeFilter(matrix));
248 this->drawFilter(canvas, 256.f, 256.f, this->makeFullComposeFilter(matrix));
249 }
static SkMatrix RotateDeg(SkScalar deg)
Definition: SkMatrix.h:104
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ onOnceBeforeDraw()

void ImageFilterComposedTransform::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 238 of file imagefilterstransformed.cpp.

238 {
239 fImage = ToolUtils::GetResourceAsImage("images/mandrill_256.png");
240 }
sk_sp< SkImage > GetResourceAsImage(const char *resource)
Definition: DecodeUtils.h:25

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