Go to the source code of this file.
|
static void | make_bitmap (SkBitmap *bm, int width, int height) |
|
| DEF_TEST (MipMap, reporter) |
|
static void | test_mipmap_generation (int width, int height, int expectedMipLevelCount, skiatest::Reporter *reporter) |
|
| DEF_TEST (MipMap_DirectLevelAccess, reporter) |
|
| DEF_TEST (MipMap_ComputeLevelCount, reporter) |
|
| DEF_TEST (MipMap_ComputeLevelSize, reporter) |
|
| DEF_TEST (MipMap_F16, reporter) |
|
static void | fill_in_mips (SkMipmapBuilder *builder, sk_sp< SkImage > img) |
|
| DEF_TEST (image_mip_factory, reporter) |
|
| DEF_TEST (image_mip_mismatch, reporter) |
|
◆ DEF_TEST() [1/7]
DEF_TEST |
( |
image_mip_factory |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 248 of file MipMapTest.cpp.
248 {
249
251
253 auto img1 = img->withDefaultMipmaps();
256
259
260 auto img2 =
builder.attachTo(img);
264}
static void fill_in_mips(SkMipmapBuilder *builder, sk_sp< SkImage > img)
#define REPORTER_ASSERT(r, cond,...)
sk_sp< SkImage > makeRasterImage(GrDirectContext *, CachingHint cachingHint=kDisallow_CachingHint) const
◆ DEF_TEST() [2/7]
DEF_TEST |
( |
image_mip_mismatch |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 268 of file MipMapTest.cpp.
268 {
272 auto img2 =
builder.attachTo(img);
273
275 };
276
278
279
280
282
285
288}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
const SkImageInfo & imageInfo() const
SkImageInfo makeWH(int newWidth, int newHeight) const
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const
SkAlphaType alphaType() const
SkColorType colorType() const
SkImageInfo makeColorType(SkColorType newColorType) const
◆ DEF_TEST() [3/7]
Definition at line 35 of file MipMapTest.cpp.
35 {
38
39 for (
int i = 0;
i < 500; ++
i) {
45 if (!mm) {
46 return;
47 }
48
51 nullptr));
53 nullptr));
54
56 sk_bzero(&prevLevel,
sizeof(prevLevel));
57
59 for (int j = 0; j < 30; ++j) {
61
68
72 }
74 }
75 }
76 }
77}
sk_bzero(glyphs, sizeof(glyphs))
static void make_bitmap(SkBitmap *bm, int width, int height)
static SkMipmap * Build(const SkPixmap &src, SkDiscardableFactoryProc, bool computeContents=true)
static int ComputeLevelCount(int baseWidth, int baseHeight)
const void * addr() const
static constexpr SkSize Make(SkScalar w, SkScalar h)
◆ DEF_TEST() [4/7]
DEF_TEST |
( |
MipMap_ComputeLevelCount |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 140 of file MipMapTest.cpp.
140 {
142
143 {-100, 100, 0},
144 {100, -100, 0},
145 {-100, -100, 0},
146
147
148
149
150
151 {0, 100, 0},
152 {100, 0, 0},
153 {0, 0, 0},
154
155 {1, 100, 6},
156 {100, 1, 6},
157 {1, 1, 0},
158
159 {2, 100, 6},
160 {100, 2, 6},
161 {2, 2, 1},
162
163
164 {63, 63, 5},
165 {64, 64, 6},
166 {127, 127, 6},
167 {128, 128, 7},
168 {255, 255, 7},
169 {256, 256, 8},
170
171
172 {64, 129, 7},
173 {255, 32, 7},
174 {500, 1000, 9}
175 };
176
177 for (
auto& currentTest :
tests) {
180 }
181}
◆ DEF_TEST() [5/7]
DEF_TEST |
( |
MipMap_ComputeLevelSize |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 190 of file MipMapTest.cpp.
190 {
192
196
197
198
199
200
204
205
209
213
214
221 };
222
223 for (
auto& currentTest :
tests) {
225 currentTest.fBaseHeight,
226 currentTest.fLevel);
228 }
229}
static SkISize ComputeLevelSize(int baseWidth, int baseHeight, int level)
static constexpr SkISize Make(int32_t w, int32_t h)
◆ DEF_TEST() [6/7]
DEF_TEST |
( |
MipMap_DirectLevelAccess |
, |
|
|
reporter |
|
|
) |
| |
Definition at line 111 of file MipMapTest.cpp.
111 {
112
113 {
114
119
121 }
122
123
124
125
127
128
129
130
132}
static void test_mipmap_generation(int width, int height, int expectedMipLevelCount, skiatest::Reporter *reporter)
constexpr SkColor SK_ColorWHITE
void allocN32Pixels(int width, int height, bool isOpaque=false)
void eraseColor(SkColor4f) const
◆ DEF_TEST() [7/7]
Definition at line 231 of file MipMapTest.cpp.
231 {
236}
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
void allocPixels(const SkImageInfo &info, size_t rowBytes)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
◆ fill_in_mips()
Definition at line 238 of file MipMapTest.cpp.
238 {
245 }
246}
SK_API sk_sp< SkSurface > WrapPixels(const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, const SkSurfaceProps *surfaceProps=nullptr)
static SkRect MakeIWH(int w, int h)
◆ make_bitmap()
◆ test_mipmap_generation()
Definition at line 79 of file MipMapTest.cpp.
80 {
86 if (!mm) {
87 return;
88 }
89
90 const int mipLevelCount = mm->countLevels();
93 for (
int i = 0;
i < mipLevelCount; ++
i) {
96
101
102
103 int twoToTheMipLevel = 1 << (
i + 1);
104 int currentWidth =
width / twoToTheMipLevel;
105 int currentHeight =
height / twoToTheMipLevel;
108 }
109}
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