69 using namespace skgpu;
71 static constexpr SkISize kDimensions = {128, 128};
98 bool allUniqueProxies,
99 int requestedTotNumQuads,
106 bool allUniqueProxies,
107 int requestedTotNumQuads,
int expectedNumOps) {
109 if (addOneByOne || allUniqueProxies) {
113 std::unique_ptr<skgpu::ganesh::SurfaceDrawContext> sdc =
new_SDC(dContext);
117 for (
int i = 0;
i < requestedTotNumQuads; ++
i) {
121 quads[
i].fAAFlags = perQuadAA(
i);
134 requestedTotNumQuads);
136 auto opsTask = sdc->testingOnly_PeekLastOpsTask();
137 int actualNumOps = opsTask->numOpChains();
139 int actualTotNumQuads = 0;
141 for (
int i = 0;
i < actualNumOps; ++
i) {
142 const GrOp* tmp = opsTask->getChain(
i);
145 actualTotNumQuads += ((
const GrDrawOp*) tmp)->numQuads();
160 bool allUniqueProxies,
161 int requestedTotNumQuads,
int expectedNumOps) {
162 std::unique_ptr<skgpu::ganesh::SurfaceDrawContext> sdc =
new_SDC(dContext);
166 if (!allUniqueProxies) {
179 for (
int i = 0;
i < requestedTotNumQuads; ++
i) {
180 if (!allUniqueProxies) {
183 set[
i].fProxyView =
i % 2 == 0 ? proxyViewA : proxyViewB;
195 set[
i].fDstClipQuad =
nullptr;
196 set[
i].fPreViewMatrix =
nullptr;
197 set[
i].fColor = {1.f, 1.f, 1.f, 1.f};
198 set[
i].fAAFlags = perQuadAA(
i);
202 for (
int i = 0;
i < requestedTotNumQuads; ++
i) {
211 set[
i].fSrcAlphaType,
216 TextureOp::Saturate::kYes,
221 sdc->addDrawOp(
nullptr, std::move(op));
224 TextureOp::AddTextureSetOps(sdc.get(),
228 requestedTotNumQuads,
229 requestedTotNumQuads,
232 TextureOp::Saturate::kYes,
240 auto opsTask = sdc->testingOnly_PeekLastOpsTask();
241 int actualNumOps = opsTask->numOpChains();
243 int actualTotNumQuads = 0;
250 expectedNumOps = requestedTotNumQuads;
253 ? TextureOp::ClassID()
254 : skgpu::ganesh::FillRectOp::ClassID();
255 for (
int i = 0;
i < actualNumOps; ++
i) {
256 const GrOp* tmp = opsTask->getChain(
i);
260 actualTotNumQuads += ((
const GrDrawOp*) tmp)->numQuads();
282 static const int kNumExpectedOps = 2;
295 static const int kNumExpectedOps = 2;
324 static const int kNumExpectedOps = 2;
339 static const int kNumExpectedOps = 2;
353 static const int kNumExpectedOps = 3;
356 true,
true, 1024, kNumExpectedOps);
366 static const int kNumExpectedOps = 2;
369 false,
true, 1024, kNumExpectedOps);
GrQuadAAFlags(* PerQuadAAFunc)(int i)
static void run_test(GrDirectContext *dContext, skiatest::Reporter *reporter, BulkRectTest test)
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(BulkFillRectTest, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
void(* BulkRectTest)(skiatest::Reporter *, GrDirectContext *, PerQuadAAFunc, GrAAType overallAA, SkBlendMode, bool addOneByOne, bool allUniqueProxies, int requestedTotNumQuads, int expectedNumOps)
static void fillrectop_creation_test(skiatest::Reporter *reporter, GrDirectContext *dContext, PerQuadAAFunc perQuadAA, GrAAType overallAA, SkBlendMode blendMode, bool addOneByOne, bool allUniqueProxies, int requestedTotNumQuads, int expectedNumOps)
static sk_sp< GrSurfaceProxy > create_proxy(GrRecordingContext *rContext)
static std::unique_ptr< skgpu::ganesh::SurfaceDrawContext > new_SDC(GrRecordingContext *rContext)
static void textureop_creation_test(skiatest::Reporter *reporter, GrDirectContext *dContext, PerQuadAAFunc perQuadAA, GrAAType overallAA, SkBlendMode blendMode, bool addOneByOne, bool allUniqueProxies, int requestedTotNumQuads, int expectedNumOps)
@ kTopLeft_GrSurfaceOrigin
skgpu::Protected Protected
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kSrcOver
r = s + (1-sa)*d
@ kSrcATop
r = s*da + d*(1-sa)
constexpr SkPMColor4f SK_PMColor4fWHITE
#define REPORTER_ASSERT(r, cond,...)
const GrCaps * caps() const
bool supportsProtectedContent() const
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
bool dynamicStateArrayGeometryProcessorTextureSupport() const
void flushAndSubmit(GrSyncCpu sync=GrSyncCpu::kNo)
GrDirectContextPriv priv()
std::unique_ptr< GrOp > Owner
GrOp * nextInChain() const
sk_sp< GrTextureProxy > createProxy(const GrBackendFormat &, SkISize dimensions, GrRenderable, int renderTargetSampleCnt, skgpu::Mipmapped, SkBackingFit, skgpu::Budgeted, GrProtected, std::string_view label, GrInternalSurfaceFlags=GrInternalSurfaceFlags::kNone, UseAllocator useAllocator=UseAllocator::kYes)
static GrQuad MakeFromRect(const SkRect &, const SkMatrix &)
GrProxyProvider * proxyProvider()
GrRecordingContextPriv priv()
static int MaxNumNonAAQuads()
static int MaxNumAAQuads()
static const GrXPFactory * FromBlendMode(SkBlendMode)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
static const SkMatrix & I()
static constexpr Swizzle RGBA()
static void AddFillRectOps(SurfaceDrawContext *, const GrClip *, GrRecordingContext *, GrPaint &&, GrAAType, const SkMatrix &viewMatrix, const GrQuadSetEntry quads[], int quadCount, const GrUserStencilSettings *=nullptr)
static std::unique_ptr< SurfaceDrawContext > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &)
uint32_t uint32_t * format
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
static constexpr SkRect MakeWH(float w, float h)