225 {
228
231
233 alphaOnlyLayerPaint.
setColor(0x03000000);
235 translucentLayerPaint.
setColor(0x03040506);
241
242 SkPaint opaqueFilterLayerPaint;
243 opaqueFilterLayerPaint.
setColor(0xFF020202);
244 SkPaint translucentFilterLayerPaint;
245 translucentFilterLayerPaint.
setColor(0x0F020202);
247 {
254 }
256
257 int index = 0;
258
259 {
261
263
264
266 SkPaint* firstPaints[] = {
nullptr, &alphaOnlyLayerPaint };
268 SkPaint* secondPaints[] = { &opaqueFilterLayerPaint, &translucentFilterLayerPaint };
269
270 for (auto outerF : filters) {
271 bool outerNoOped = !outerF;
272 for (auto innerF : filters) {
274 for (
size_t j = 0; j <
std::size(firstPaints); ++j) {
275 for (
size_t k = 0; k <
std::size(secondBounds); ++k) {
277 bool innerNoOped = !secondBounds[k] && !secondPaints[
m] && !innerF;
278
279 recorder.saveLayer({firstBounds[
i], firstPaints[j], outerF, 0});
280 recorder.save();
281 recorder.clipRect(
clip);
282 recorder.saveLayer({secondBounds[k], secondPaints[
m], innerF, 0});
283 recorder.restore();
284 recorder.restore();
285 recorder.restore();
287 outerNoOped);
288 #ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
290 #endif
291 index += 7;
292 }
293 }
294 }
295 }
296 }
297 }
298 }
299
300
301 struct {
304 } noChangeTests[] = {
305
306 { &alphaOnlyLayerPaint, nullptr },
307
308 { &translucentLayerPaint, &opaqueFilterLayerPaint },
309
310 { &xfermodePaint, &opaqueFilterLayerPaint },
311
312 { &alphaOnlyLayerPaint, &xfermodePaint },
313
314 { &colorFilterPaint, &opaqueFilterLayerPaint },
315
316
317 { &alphaOnlyLayerPaint, &colorFilterPaint }
318 };
319
321 recorder.saveLayer(
nullptr, noChangeTests[
i].firstPaint);
322 recorder.save();
323 recorder.clipRect(
clip);
324 recorder.saveLayer(
nullptr, noChangeTests[
i].secondPaint);
325 recorder.restore();
326 recorder.restore();
327 recorder.restore();
329 index += 7;
330 }
331
332
333 recorder.saveLayer(nullptr, &alphaOnlyLayerPaint);
334 recorder.save();
335 recorder.clipRect(
clip);
336 recorder.saveLayer(nullptr, &opaqueFilterLayerPaint);
337 recorder.restore();
338 recorder.restore();
339 recorder.restore();
341
342 const SkRecords::SaveLayer* saveLayer = assert_type<SkRecords::SaveLayer>(r, record, index + 3);
345
346 index += 7;
347
348
349
350 recorder.saveLayer(nullptr, &alphaOnlyLayerPaint);
351 recorder.saveLayer(nullptr, &opaqueFilterLayerPaint);
352 recorder.restore();
353 recorder.restore();
355 assert_type<SkRecords::SaveLayer>(r, record, index);
356 assert_type<SkRecords::SaveLayer>(r, record, index + 1);
357 assert_type<SkRecords::Restore>(r, record, index + 2);
358 assert_type<SkRecords::Restore>(r, record, index + 3);
359 index += 4;
360}
static void assert_merge_svg_opacity_and_filter_layers(skiatest::Reporter *r, SkRecord *record, int i, bool shouldBeNoOped)
static void assert_savelayer_restore(skiatest::Reporter *r, SkRecord *record, int i, bool shouldBeNoOped)
constexpr SkColor SK_ColorLTGRAY
constexpr SkColor SK_ColorWHITE
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
#define REPORTER_ASSERT(r, cond,...)
void drawRect(const SkRect &rect, const SkPaint &paint)
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Picture(sk_sp< SkPicture > pic, const SkRect &targetRect)
void setColor(SkColor color)
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
void setBlendMode(SkBlendMode mode)
void setColorFilter(sk_sp< SkColorFilter > colorFilter)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
Optional< SkRect > bounds
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
static constexpr SkRect MakeWH(float w, float h)