Flutter Engine
The Flutter Engine
GrDrawOpTest.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
12#include "src/base/SkRandom.h"
16
17#if defined(GR_TEST_UTILS)
18
19const GrUserStencilSettings* GrGetRandomStencil(SkRandom* random, GrContext_Base* context) {
20 if (context->priv().caps()->avoidStencilBuffers()) {
22 }
23 static constexpr GrUserStencilSettings kReads(
25 0x8080,
27 0xffff,
30 0xffff>()
31 );
32 static constexpr GrUserStencilSettings kWrites(
34 0xffff,
36 0xffff,
39 0xffff>()
40 );
41 static constexpr GrUserStencilSettings kReadsAndWrites(
43 0x8000,
45 0x6000,
48 0x77ff>()
49 );
50
51 static const GrUserStencilSettings* kStencilSettings[] = {
53 &kReads,
54 &kWrites,
55 &kReadsAndWrites,
56 };
57 return kStencilSettings[random->nextULessThan(std::size(kStencilSettings))];
58}
59
60#endif
const GrCaps * caps() const
bool avoidStencilBuffers() const
Definition: GrCaps.h:139
GrBaseContextPriv priv()
uint32_t nextULessThan(uint32_t count)
Definition: SkRandom.h:93
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
Definition: switches.h:259
static constexpr Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > StaticInit()
static const GrUserStencilSettings & kUnused