Flutter Engine
The Flutter Engine
Classes | Functions
ImageFilterCollapse.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorFilter.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkSurface.h"
#include "include/effects/SkGradientShader.h"
#include "include/effects/SkImageFilters.h"

Go to the source code of this file.

Classes

class  BaseImageFilterCollapseBench
 
class  TableCollapseBench
 
class  MatrixCollapseBench
 

Functions

static sk_sp< SkColorFiltermake_brightness (float amount)
 
static sk_sp< SkColorFiltermake_grayscale ()
 

Function Documentation

◆ make_brightness()

static sk_sp< SkColorFilter > make_brightness ( float  amount)
static

Definition at line 99 of file ImageFilterCollapse.cpp.

99 {
100 SkScalar matrix[20] = { 1, 0, 0, 0, amount,
101 0, 1, 0, 0, amount,
102 0, 0, 1, 0, amount,
103 0, 0, 0, 1, 0 };
105}
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
float SkScalar
Definition: extension.cpp:12
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ make_grayscale()

static sk_sp< SkColorFilter > make_grayscale ( )
static

Definition at line 107 of file ImageFilterCollapse.cpp.

107 {
108 float matrix[20];
109 memset(matrix, 0, 20 * sizeof(float));
110 matrix[0] = matrix[5] = matrix[10] = 0.2126f;
111 matrix[1] = matrix[6] = matrix[11] = 0.7152f;
112 matrix[2] = matrix[7] = matrix[12] = 0.0722f;
113 matrix[18] = 1.0f;
115}