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

Public Member Functions

 GiantBitmapGM (SkTileMode mode, bool doFilter, bool doRotate)
 
 ~GiantBitmapGM () override
 
- 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
 

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 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 28 of file giantbitmap.cpp.

Constructor & Destructor Documentation

◆ GiantBitmapGM()

GiantBitmapGM::GiantBitmapGM ( SkTileMode  mode,
bool  doFilter,
bool  doRotate 
)
inline

Definition at line 70 of file giantbitmap.cpp.

70 : fBM(nullptr) {
71 fMode = mode;
72 fDoFilter = doFilter;
73 fDoRotate = doRotate;
74 }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition switches.h:228

◆ ~GiantBitmapGM()

GiantBitmapGM::~GiantBitmapGM ( )
inlineoverride

Definition at line 76 of file giantbitmap.cpp.

76{ delete fBM; }

Member Function Documentation

◆ getISize()

SkISize GiantBitmapGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 102 of file giantbitmap.cpp.

102{ return SkISize::Make(640, 480); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition SkSize.h:20

◆ getName()

SkString GiantBitmapGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 79 of file giantbitmap.cpp.

79 {
80 SkString str("giantbitmap_");
81 switch (fMode) {
83 str.append("clamp");
84 break;
86 str.append("repeat");
87 break;
89 str.append("mirror");
90 break;
92 str.append("decal");
93 break;
94 default:
95 break;
96 }
97 str.append(fDoFilter ? "_bilerp" : "_point");
98 str.append(fDoRotate ? "_rotate" : "_scale");
99 return str;
100 }

◆ onDraw()

void GiantBitmapGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 104 of file giantbitmap.cpp.

104 {
106
107 SkMatrix m;
108 if (fDoRotate) {
109 m.setSkew(SK_Scalar1, 0, 0, 0);
110 } else {
111 SkScalar scale = 11*SK_Scalar1/12;
112 m.setScale(scale, scale);
113 }
114 paint.setShader(getBitmap().makeShader(
115 fMode, fMode,
118 m));
119
120 canvas->translate(50, 50);
121
122 canvas->drawPaint(paint);
123 }
SkFilterMode
#define SK_Scalar1
Definition SkScalar.h:18
void translate(SkScalar dx, SkScalar dy)
void drawPaint(const SkPaint &paint)
const Paint & paint
float SkScalar
Definition extension.cpp:12
const Scalar scale

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