Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
filterbug.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"

Go to the source code of this file.

Classes

class  FilterBugGM
 

Functions

static sk_sp< SkImagemake_image (int firstBlackRow, int lastBlackRow)
 

Function Documentation

◆ make_image()

static sk_sp< SkImage > make_image ( int  firstBlackRow,
int  lastBlackRow 
)
static

Definition at line 24 of file filterbug.cpp.

24 {
25 static const int kWidth = 25;
26 static const int kHeight = 27;
27
28 SkBitmap bm;
31 for (int y = firstBlackRow; y < lastBlackRow; ++y) {
32 for (int x = 0; x < kWidth; ++x) {
33 *bm.getAddr32(x, y) = SkPackARGB32(0xFF, 0x0, 0x0, 0x0);
34 }
35 }
36
38 bm.setImmutable();
39
40 return bm.asImage();
41}
@ kOpaque_SkAlphaType
pixel is opaque
Definition SkAlphaType.h:28
static SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorWHITE
Definition SkColor.h:122
sk_sp< SkImage > asImage() const
Definition SkBitmap.cpp:645
void setImmutable()
Definition SkBitmap.cpp:400
void allocN32Pixels(int width, int height, bool isOpaque=false)
Definition SkBitmap.cpp:232
bool setAlphaType(SkAlphaType alphaType)
Definition SkBitmap.cpp:148
uint32_t * getAddr32(int x, int y) const
Definition SkBitmap.h:1260
void eraseColor(SkColor4f) const
Definition SkBitmap.cpp:442
double y
double x
constexpr size_t kHeight
constexpr size_t kWidth