Flutter Engine
The Flutter Engine
Classes | Functions | Variables
TileBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"

Go to the source code of this file.

Classes

class  ConstXTileBench
 

Functions

static void create_gradient (SkBitmap *bm)
 

Variables

constexpr SkFilterMode gNN = SkFilterMode::kNearest
 
constexpr SkFilterMode gLI = SkFilterMode::kLinear
 

Function Documentation

◆ create_gradient()

static void create_gradient ( SkBitmap bm)
static

Definition at line 15 of file TileBench.cpp.

15 {
16 SkASSERT(1 == bm->width());
17 const int height = bm->height();
18
19 float deltaB = 255.0f / height;
20 float blue = 255.0f;
21
22 for (int y = 0; y < height; y++) {
23 *bm->getAddr32(0, y) = SkColorSetRGB(0, 0, (U8CPU) blue);
24 blue -= deltaB;
25 }
26}
#define SkASSERT(cond)
Definition: SkAssert.h:116
unsigned U8CPU
Definition: SkCPUTypes.h:18
#define SkColorSetRGB(r, g, b)
Definition: SkColor.h:57
int width() const
Definition: SkBitmap.h:149
int height() const
Definition: SkBitmap.h:158
uint32_t * getAddr32(int x, int y) const
Definition: SkBitmap.h:1260
double y
int32_t height

Variable Documentation

◆ gLI

constexpr SkFilterMode gLI = SkFilterMode::kLinear
constexpr

Definition at line 123 of file TileBench.cpp.

◆ gNN

constexpr SkFilterMode gNN = SkFilterMode::kNearest
constexpr

Definition at line 122 of file TileBench.cpp.