Flutter Engine
The Flutter Engine
Functions
fadefilter.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/effects/SkImageFilters.h"
#include <utility>

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (fadefilter, canvas, 256, 256)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( fadefilter  ,
canvas  ,
256  ,
256   
)

Definition at line 20 of file fadefilter.cpp.

20 {
21 float matrix[20] = { 1, 0, 0, 0, 0.5f,
22 0, 1, 0, 0, 0.5f,
23 0, 0, 1, 0, 0.5f,
24 0, 0, 0, 1, 0 };
26 SkPaint layerPaint;
27 layerPaint.setImageFilter(SkImageFilters::ColorFilter(std::move(colorFilter), nullptr));
28 canvas->drawRect(SkRect::MakeLTRB(64, 64, 192, 192), layerPaint);
29}
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646