Go to the source code of this file.
|
static sk_sp< SkSurface > | make_surface (SkCanvas *root, int N, int padLeft, int padTop, int padRight, int padBottom) |
|
static sk_sp< SkImage > | make_image (SkCanvas *root, int *xDivs, int *yDivs, int padLeft, int padTop, int padRight, int padBottom) |
|
static void | image_to_bitmap (GrDirectContext *dContext, const SkImage *image, SkBitmap *bm) |
|
| DEF_SIMPLE_GM_BG (lattice_alpha, canvas, 120, 120, SK_ColorWHITE) |
|
◆ DEF_SIMPLE_GM_BG()
DEF_SIMPLE_GM_BG |
( |
lattice_alpha |
, |
|
|
canvas |
, |
|
|
120 |
, |
|
|
120 |
, |
|
|
SK_ColorWHITE |
|
|
) |
| |
Definition at line 357 of file lattice.cpp.
357 {
359 surface->getCanvas()->clear(0);
362
363 int divs[] = { 20, 40, 60, 80 };
364
373
378}
constexpr SkColor SK_ColorMAGENTA
sk_sp< const SkImage > image
int fYCount
number of y-coordinates
const SkIRect * fBounds
source bounds to draw from
const int * fYDivs
y-axis values dividing bitmap
int fXCount
number of x-coordinates
const RectType * fRectTypes
array of fill types
const SkColor * fColors
array of colors
const int * fXDivs
x-axis values dividing bitmap
static SkImageInfo MakeA8(int width, int height)
static constexpr SkRect MakeWH(float w, float h)
◆ image_to_bitmap()
Definition at line 84 of file lattice.cpp.
84 {
88}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
void allocPixels(const SkImageInfo &info, size_t rowBytes)
bool readPixels(GrDirectContext *context, const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint cachingHint=kAllow_CachingHint) const
static SkImageInfo MakeN32Premul(int width, int height)
◆ make_image()
Definition at line 32 of file lattice.cpp.
33 {
34 const int kCap = 28;
35 const int kMid = 8;
36 const int kSize = 2*kCap + 3*kMid;
37
40 canvas->
translate((
float) padLeft, (
float) padTop);
41
45
46 xDivs[0] = kCap + padLeft;
47 yDivs[0] = kCap + padTop;
48 xDivs[1] = kCap + kMid + padLeft;
49 yDivs[1] = kCap + kMid + padTop;
50 xDivs[2] = kCap + 2 * kMid + padLeft;
51 yDivs[2] = kCap + 2 * kMid + padTop;
52 xDivs[3] = kCap + 3 * kMid + padLeft;
53 yDivs[3] = kCap + 3 * kMid + padTop;
54
56 paint.setAntiAlias(
true);
57
58 paint.setColor(0xFFFFFF00);
60
62 paint.setColor(0x8800FF00);
65 paint.setColor(0x880000FF);
68 paint.setColor(0x88FF00FF);
70
72 paint.setColor(0x8800FF00);
75 paint.setColor(0x880000FF);
78 paint.setColor(0x88FF00FF);
80
81 return surface->makeImageSnapshot();
82}
static const int strokeWidth
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawRoundRect(const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
static sk_sp< SkSurface > make_surface(SkCanvas *root, int N, int padLeft, int padTop, int padRight, int padBottom)
void setXYWH(float x, float y, float width, float height)
◆ make_surface()