Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
OverdrawColorFilter Struct Reference
Inheritance diagram for OverdrawColorFilter:
skiagm::GM

Public Member Functions

SkString getName () const override
 
SkISize getISize () override
 
void onDraw (SkCanvas *canvas) 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 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
 

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

Detailed Description

Definition at line 33 of file overdrawcolorfilter.cpp.

Member Function Documentation

◆ getISize()

SkISize OverdrawColorFilter::getISize ( )
inlineoverridevirtual

Implements skiagm::GM.

Definition at line 36 of file overdrawcolorfilter.cpp.

36{ return {200, 400}; }

◆ getName()

SkString OverdrawColorFilter::getName ( ) const
inlineoverridevirtual

Implements skiagm::GM.

Definition at line 34 of file overdrawcolorfilter.cpp.

34{ return SkString{"overdrawcolorfilter"}; }

◆ onDraw()

void OverdrawColorFilter::onDraw ( SkCanvas canvas)
inlineoverridevirtual

Reimplemented from skiagm::GM.

Definition at line 38 of file overdrawcolorfilter.cpp.

38 {
40 0x80FF0000, 0x8000FF00, 0x800000FF, 0x80FFFF00, 0x8000FFFF, 0x80FF00FF,
41 };
42
46
49 bitmap.allocPixels(info);
50 set_bitmap(&bitmap, 0);
51 canvas->drawImage(bitmap.asImage(), 0, 0, sampling, &paint);
52 set_bitmap(&bitmap, 1);
53 canvas->drawImage(bitmap.asImage(), 0, 100, sampling, &paint);
54 set_bitmap(&bitmap, 2);
55 canvas->drawImage(bitmap.asImage(), 0, 200, sampling, &paint);
56 set_bitmap(&bitmap, 3);
57 canvas->drawImage(bitmap.asImage(), 0, 300, sampling, &paint);
58 set_bitmap(&bitmap, 4);
59 canvas->drawImage(bitmap.asImage(), 100, 0, sampling, &paint);
60 set_bitmap(&bitmap, 5);
61 canvas->drawImage(bitmap.asImage(), 100, 100, sampling, &paint);
62 set_bitmap(&bitmap, 6);
63 canvas->drawImage(bitmap.asImage(), 100, 200, sampling, &paint);
64 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
uint32_t SkColor
Definition: SkColor.h:37
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
static sk_sp< SkColorFilter > MakeWithSkColors(const SkColor[kNumColors])
static constexpr int kNumColors
const Paint & paint
Definition: color_source.cc:38
PODArray< SkColor > colors
Definition: SkRecords.h:276
SkSamplingOptions sampling
Definition: SkRecords.h:337
Definition: bitmap.py:1
static void set_bitmap(SkBitmap *bitmap, uint8_t alpha)
static SkImageInfo MakeA8(int width, int height)

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