Go to the source code of this file.
|
static sk_sp< SkImage > | make_image () |
|
| DEF_SIMPLE_GM (mipmap, canvas, 400, 200) |
|
static sk_sp< SkImage > | make (sk_sp< SkColorSpace > cs) |
|
static void | show_mips (SkCanvas *canvas, SkImage *img) |
|
| DEF_SIMPLE_GM (mipmap_srgb, canvas, 260, 230) |
|
static sk_sp< SkImage > | make_g8_gradient (sk_sp< SkColorSpace > cs) |
|
static void | show_mips_only (SkCanvas *canvas, SkImage *img) |
|
| DEF_SIMPLE_GM (mipmap_gray8_srgb, canvas, 260, 230) |
|
◆ DEF_SIMPLE_GM() [1/3]
DEF_SIMPLE_GM |
( |
mipmap |
, |
|
|
canvas |
, |
|
|
400 |
, |
|
|
200 |
|
|
) |
| |
Definition at line 38 of file mipmap.cpp.
38 {
40
42
44 str.
printf(
"scale %g %g",
dst.width() / img->width(),
dst.height() / img->height());
45
46
52 };
53
54 canvas->translate(20, 20);
56 canvas->drawImageRect(img.get(),
dst, samplings[
i],
nullptr);
57 canvas->translate(0, 20);
58 }
59 canvas->drawImage(img.get(), 20, 20);
60}
void printf(const char format[],...) SK_PRINTF_LIKE(2
static sk_sp< SkImage > make_image()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkCubicResampler Mitchell()
static constexpr SkRect MakeWH(float w, float h)
◆ DEF_SIMPLE_GM() [2/3]
DEF_SIMPLE_GM |
( |
mipmap_gray8_srgb |
, |
|
|
canvas |
, |
|
|
260 |
, |
|
|
230 |
|
|
) |
| |
Definition at line 150 of file mipmap.cpp.
150 {
153
154 canvas->translate(10, 10);
156 canvas->translate(0, limg->
height() + 10.0f);
158}
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkImage > make_g8_gradient(sk_sp< SkColorSpace > cs)
static void show_mips_only(SkCanvas *canvas, SkImage *img)
◆ DEF_SIMPLE_GM() [3/3]
DEF_SIMPLE_GM |
( |
mipmap_srgb |
, |
|
|
canvas |
, |
|
|
260 |
, |
|
|
230 |
|
|
) |
| |
Definition at line 101 of file mipmap.cpp.
101 {
104
105 canvas->translate(10, 10);
107 canvas->translate(0, limg->
height() + 10.0f);
109}
static sk_sp< SkImage > make(sk_sp< SkColorSpace > cs)
static void show_mips(SkCanvas *canvas, SkImage *img)
◆ make()
Definition at line 65 of file mipmap.cpp.
65 {
70
71 for (
int y = 0;
y <
N; ++
y) {
72 for (
int x = 0;
x <
N; ++
x) {
74 }
75 }
78}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
uint32_t * getAddr32(int x, int y) const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
◆ make_g8_gradient()
Definition at line 114 of file mipmap.cpp.
114 {
119
120 for (
int y = 0;
y <
N; ++
y) {
121 for (
int x = 0;
x <
N; ++
x) {
122 *bm.
getAddr8(
x,
y) =
static_cast<uint8_t
>(255.0f * ((
x +
y) / (2.0f * (
N - 1))));
123 }
124 }
127}
@ kOpaque_SkAlphaType
pixel is opaque
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
uint8_t * getAddr8(int x, int y) const
◆ make_image()
Definition at line 21 of file mipmap.cpp.
21 {
26
28 paint.setAntiAlias(
true);
29
31 for (
int i = 0;
i < 20; ++
i) {
34 }
35 return surface->makeImageSnapshot();
36}
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
◆ show_mips()
Definition at line 80 of file mipmap.cpp.
80 {
83
84
86 while (
dst.width() > 5) {
88 dst.offset(
dst.width() + 10, 0);
91 }
92}
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
SkSamplingOptions sampling
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static SkRect Make(const SkISize &size)
◆ show_mips_only()
Definition at line 129 of file mipmap.cpp.
129 {
132
133
135 while (
dst.width() > 5) {
137 dst.offset(
dst.width() + 10, 0);
138 dst.fRight =
dst.fLeft +
dst.width() / 2;
139 dst.fBottom =
dst.fTop +
dst.height() / 2;
140 }
141}