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

Public Member Functions

 ScalePixelsGM ()
 
- 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
 
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 288 of file image.cpp.

Constructor & Destructor Documentation

◆ ScalePixelsGM()

ScalePixelsGM::ScalePixelsGM ( )
inline

Definition at line 290 of file image.cpp.

290{}

Member Function Documentation

◆ getISize()

SkISize ScalePixelsGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 295 of file image.cpp.

295{ return SkISize::Make(960, 1200); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString ScalePixelsGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 293 of file image.cpp.

293{ return SkString("scale-pixels"); }

◆ onDraw()

void ScalePixelsGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 297 of file image.cpp.

297 {
299
300 const ImageMakerProc procs[] = {
302 };
303 for (auto& proc : procs) {
305 if (image) {
306 show_scaled_pixels(canvas, image.get());
307 }
308 canvas->translate(0, 120);
309 }
310 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
virtual GrRecordingContext * recordingContext() const
Definition: SkCanvas.cpp:1637
T * get() const
Definition: SkRefCnt.h:303
sk_sp< const SkImage > image
Definition: SkRecords.h:269
static SkImageInfo MakeN32Premul(int width, int height)
sk_sp< SkImage >(* ImageMakerProc)(const SkImageInfo &, GrRecordingContext *, void(*)(SkCanvas *))
Definition: image.cpp:284
static sk_sp< SkImage > make_gpu(const SkImageInfo &info, GrRecordingContext *ctx, void(*draw)(SkCanvas *))
Definition: image.cpp:268
static void draw_contents(SkSurface *surface, SkColor fillC)
Definition: image.cpp:64
static void show_scaled_pixels(SkCanvas *canvas, SkImage *image)
Definition: image.cpp:206
static sk_sp< SkImage > make_codec(const SkImageInfo &info, GrRecordingContext *, void(*draw)(SkCanvas *))
Definition: image.cpp:261
static sk_sp< SkImage > make_picture(const SkImageInfo &info, GrRecordingContext *, void(*draw)(SkCanvas *))
Definition: image.cpp:248
static sk_sp< SkImage > make_raster(const SkImageInfo &info, GrRecordingContext *, void(*draw)(SkCanvas *))
Definition: image.cpp:240

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